diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 000000000..609cd9aae Binary files /dev/null and b/.DS_Store differ diff --git a/.github/issue_template.md b/.github/issue_template.md new file mode 100644 index 000000000..5ef78cb3f --- /dev/null +++ b/.github/issue_template.md @@ -0,0 +1,45 @@ +--- +name: Issue Report +about: Report a bug, suggest an enhancement, or ask a question +title: "" +labels: "" +assignees: "" +--- + +## Issue Type + +Please inform the type(s) of issue(s) you are reporting: + +- Bug Report +- Feature Request +- Discussion +- Question + +## Description + +Please provide a clear and concise description of the issue or enhancement. +Include any relevant information that could help reproduce the issue or +understand the request. + +## Steps to Reproduce (for bugs) + +1. Step one +2. Step two +3. ... + +## Expected Behavior + +Describe what you expected to happen. + +## Actual Behavior + +Describe what actually happened. + +## Additional Context + +Add any other context about the issue here, including screenshots, logs, or +other supporting information. + +--- + +Thank you for taking the time to report this issue! diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 000000000..988cd8c60 --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,18 @@ + +## What is this Contribution About? + +Please provide a brief description of the changes or enhancements you are proposing in this pull request. + +## Issue Link + +Please link to the relevant issue that this pull request addresses: + +- Issue: [#ISSUE_NUMBER](link_to_issue) + +## Loom Video + +> Record a quick screencast describing your changes to help the team understand and review your contribution. This will greatly assist in the review process. + +## Demonstration Link + +> Provide a link to a branch or environment where this pull request can be tested and seen in action. diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index b7384362d..9c677b714 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -19,18 +19,18 @@ jobs: steps: - uses: actions/checkout@v3 - name: cache deno installation and deno.land dependencies - uses: actions/cache@v2 + uses: actions/cache@v4 with: key: ${{ runner.os }}-deno-${{ hashFiles('**/*') }} restore-keys: ${{ runner.os }}-deno- path: | /home/runner/.deno /home/runner/.cache/deno/deps/https/deno.land - - uses: denoland/setup-deno@v1 + - uses: denoland/setup-deno@v2 with: - deno-version: v1.x + deno-version: v2.4.5 - name: Bundle Apps - run: deno run -A --lock=deno.lock --lock-write --reload scripts/start.ts + run: deno run -A --lock=deno.lock --frozen=false --reload scripts/start.ts - name: Check run: deno task check @@ -40,15 +40,15 @@ jobs: shell: bash run: | git status --porcelain - if [[ $(git status --porcelain | wc -c) -eq 0 ]]; then + if [[ $(git status --porcelain | wc -c) -ne 0 ]]; then echo "uncommitted changes detected" exit 1 fi - name: Test continue-on-error: true - run: deno test --lock=deno.lock --lock-write -A . + run: deno test --lock=deno.lock --frozen=false -A . - name: Benchmark continue-on-error: true - run: deno bench --lock=deno.lock --lock-write -A . \ No newline at end of file + run: deno bench --lock=deno.lock --frozen=false -A . diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml new file mode 100644 index 000000000..0ab9cb25f --- /dev/null +++ b/.github/workflows/claude.yml @@ -0,0 +1,44 @@ +name: Claude Code + +on: + issue_comment: + types: [created] + pull_request_review_comment: + types: [created] + issues: + types: [opened, assigned] + pull_request_review: + types: [submitted] + +jobs: + claude: + if: | + (github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) || + (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) || + (github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude'))) + runs-on: ubuntu-latest + permissions: + contents: read + pull-requests: read + issues: read + id-token: write + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Check if user is maintainer + id: check_maintainer + run: | + if ! grep -Fxq "${{ github.actor }}" MAINTAINERS.txt; then + echo "User ${{ github.actor }} is not a maintainer. Exiting." + exit 1 + fi + + - name: Run Claude Code + id: claude + uses: anthropics/claude-code-action@beta + with: + anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} diff --git a/.github/workflows/issues.yaml b/.github/workflows/issues.yaml new file mode 100644 index 000000000..d5f99f015 --- /dev/null +++ b/.github/workflows/issues.yaml @@ -0,0 +1,18 @@ +name: Label issues +on: + issues: + types: + - reopened + - opened +jobs: + label_issues: + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - run: gh issue edit "$NUMBER" --add-label "$LABELS" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + NUMBER: ${{ github.event.issue.number }} + LABELS: triage diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 74c872444..c7e75e636 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -6,7 +6,11 @@ on: # yamllint disable-line rule:truthy push: tags: - "**" - + workflow_dispatch: # Allows manual dispatch with parameters + inputs: + tag_name: + description: "The tag to be published" + required: true permissions: write-all jobs: release: @@ -15,10 +19,9 @@ jobs: runs-on: "ubuntu-latest" steps: - - name: "Determine tag" - run: 'echo "RELEASE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV' - - name: "Create release" + env: + RELEASE_TAG: ${{ github.event.inputs.tag_name || github.ref_name }} uses: "actions/github-script@v6" with: github-token: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/releaser.yaml b/.github/workflows/releaser.yaml new file mode 100644 index 000000000..f4fb8d2a0 --- /dev/null +++ b/.github/workflows/releaser.yaml @@ -0,0 +1,172 @@ +name: Release Tagging + +on: + pull_request_target: + types: [opened] + + push: + branches: + - main + +permissions: + contents: write # Necessary for accessing and modifying repository content + pull-requests: write # Necessary for interacting with pull requests + actions: write # Necessary for triggering other workflows + +jobs: + tag-discussion: + if: github.event_name == 'pull_request_target' && github.event.action == 'opened' + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + with: + ref: ${{ github.event.pull_request.base.ref }} # Checkout the base branch (target repository) + repository: ${{ github.event.pull_request.base.repo.full_name }} # Checkout from the target repo + + - name: Calculate new versions + id: calculate_versions + run: | + git fetch --tags + LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) + if [ -z "$LATEST_TAG" ]; then + LATEST_TAG="0.0.0" + fi + MAJOR=$(echo $LATEST_TAG | cut -d. -f1) + MINOR=$(echo $LATEST_TAG | cut -d. -f2) + PATCH=$(echo $LATEST_TAG | cut -d. -f3) + NEW_PATCH_VERSION="$MAJOR.$MINOR.$((PATCH + 1))" + NEW_MINOR_VERSION="$MAJOR.$((MINOR + 1)).0" + NEW_MAJOR_VERSION="$((MAJOR + 1)).0.0" + echo "patch_version=$NEW_PATCH_VERSION" >> $GITHUB_OUTPUT + echo "minor_version=$NEW_MINOR_VERSION" >> $GITHUB_OUTPUT + echo "major_version=$NEW_MAJOR_VERSION" >> $GITHUB_OUTPUT + + - name: Start Discussion for Tagging + uses: peter-evans/create-or-update-comment@v2 + id: comment + with: + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.pull_request.number }} + body: | + ## Tagging Options + Should a new tag be published when this PR is merged? + - 👍 for **Patch** ${{ steps.calculate_versions.outputs.patch_version }} update + - 🎉 for **Minor** ${{ steps.calculate_versions.outputs.minor_version }} update + - 🚀 for **Major** ${{ steps.calculate_versions.outputs.major_version }} update + + determine-tag: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - name: Checkout Code + uses: actions/checkout@v3 + + - name: Find the Merged Pull Request + id: find_pr + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + BASE_BRANCH="main" + RECENT_PR=$(gh pr list --state closed --base $BASE_BRANCH --json number,title,closedAt --jq '.[] | select(.closedAt >= "'$(date -u -d '1 minute ago' +%Y-%m-%dT%H:%M:%SZ)'") | {number, title}') + echo "RECENT_PR=$RECENT_PR" >> $GITHUB_ENV + echo "PR_NUMBER=$(echo $RECENT_PR | jq -r '.number')" >> $GITHUB_ENV + + - name: Fetch latest stable tag (excluding prerelease tags) + id: get_latest_tag + run: | + git fetch --tags + LATEST_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | head -n 1) + if [ -z "$LATEST_TAG" ]; then + LATEST_TAG="0.0.0" + fi + echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT + + - name: Determine the next version based on comments + id: determine_version + if: env.PR_NUMBER != '' + env: + PR_NUMBER: ${{ env.PR_NUMBER }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + LATEST_TAG=${{ steps.get_latest_tag.outputs.latest_tag }} + MAJOR=$(echo $LATEST_TAG | cut -d. -f1) + MINOR=$(echo $LATEST_TAG | cut -d. -f2) + PATCH=$(echo $LATEST_TAG | cut -d. -f3) + + # Define allowed users as a JSON array + ALLOWED_USERS=$(cat MAINTAINERS.txt | jq -R -s -c 'split("\n")[:-1]') + echo "Maintainers list: $ALLOWED_USERS" + + # Fetch reactions and filter by allowed users + REACTION=$(gh api graphql -f query=' + query { + repository(owner:"${{ github.repository_owner }}", name:"${{ github.event.repository.name }}") { + pullRequest(number: '${PR_NUMBER}') { + comments(last: 100) { + nodes { + body + id + reactions(last: 100) { + nodes { + content + user { + login + } + } + } + } + } + } + } + }' | jq -r --argjson allowed_users "$ALLOWED_USERS" ' + .data.repository.pullRequest.comments.nodes[] | + select(.body | contains("## Tagging Options")) | + .reactions.nodes[] | + select(.user.login | IN($allowed_users[])) | + .content' + ) + # Print the reaction to debug + echo "Captured reaction: $REACTION" + + # Convert reaction to uppercase to handle any case inconsistencies + REACTION=$(echo "$REACTION" | tr '[:lower:]' '[:upper:]') + + # Determine the new tag version based on the allowed reactions + if [[ "$REACTION" == *"ROCKET"* ]]; then + NEW_TAG="$((MAJOR + 1)).0.0" + elif [[ "$REACTION" == *"HOORAY"* ]]; then + NEW_TAG="$MAJOR.$((MINOR + 1)).0" + elif [[ "$REACTION" == *"THUMBS_UP"* ]]; then # Ensure thumbs up reaction is correctly identified + NEW_TAG="$MAJOR.$MINOR.$((PATCH + 1))" + else + echo "No valid reactions found for version bump. Exiting." + exit 0 + fi + + + echo "new_version=$NEW_TAG" >> $GITHUB_OUTPUT + + - name: Update deno.json Version + if: steps.determine_version.outputs.new_version != '' + run: | + jq --arg new_version "${{ steps.determine_version.outputs.new_version }}" '.version = $new_version' deno.json > tmp.$$.json && mv tmp.$$.json deno.json + git config user.name "decobot" + git config user.email "github-actions[bot]@users.noreply.github.com" + git add deno.json + git commit -m "Update version to ${{ steps.determine_version.outputs.new_version }}" + git push origin main + + - name: Create and Push Tag + if: steps.determine_version.outputs.new_version != '' + run: | + git tag ${{ steps.determine_version.outputs.new_version }} + git push origin ${{ steps.determine_version.outputs.new_version }} + + - name: Trigger Release Workflow + run: | + curl -X POST \ + -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \ + -H "Accept: application/vnd.github.everest-preview+json" \ + https://api.github.com/repos/${{ github.repository }}/actions/workflows/release.yaml/dispatches \ + -d '{"ref":"main", "inputs":{"tag_name":"${{ steps.determine_version.outputs.new_version }}"}}' diff --git a/1001fx/README.md b/1001fx/README.md new file mode 100644 index 000000000..fda50c6cb --- /dev/null +++ b/1001fx/README.md @@ -0,0 +1,69 @@ +# 1001fx MCP + +This app integrates with the 1001fx API to provide media processing capabilities for your applications. + +## Features + +### Audio2Video + +Converts an MP3 audio file into an MP4 video file with images displayed for specified durations. The result is a URL to the MP4 file that is available for 48 hours. + +#### Parameters + +- `url` (string, required): The URL of the audio file (MP3). +- `images` (array, optional): Array of images to show in your video. Each object contains: + - `imageUrl` (string, required): The URL of an image to show in your video. + - `duration` (number, required): The number of seconds this image should be shown. +- `thumbnailImageUrl` (string, optional): The URL of the thumbnail image. +- `videoResolution` (object, optional): The resolution of the output video. + - `width` (number): Width in pixels (default: 1280). + - `height` (number): Height in pixels (default: 720). +- `presignedUrl` (string, optional): When provided, the video URL will be uploaded to this URL rather than returned directly. + +#### Example + +```typescript +// Basic usage with just audio URL and thumbnail +const result1 = await client.action("1001fx/actions/audio2video", { + url: "https://api.1001fx.com/testdata/jingle.mp3", + thumbnailImageUrl: "https://api.1001fx.com/testdata/image.jpg" +}); + +// Advanced usage with images and video resolution +const result2 = await client.action("1001fx/actions/audio2video", { + url: "https://api.1001fx.com/testdata/jingle.mp3", + images: [ + { + imageUrl: "https://example.com/image1.jpg", + duration: 2 + }, + { + imageUrl: "https://example.com/image2.jpg", + duration: 3 + } + ], + thumbnailImageUrl: "https://example.com/thumbnail.jpg", + videoResolution: { + width: 1280, + height: 720 + } +}); + +// Result: { url: "https://cdn.1001fx.com/output/video123.mp4", statusCode: 200 } +``` + +## Installation + +To use this app, you need to provide your 1001fx API key when installing the app. + +```typescript +import { createClient } from "deco"; + +const client = createClient({ + apps: { + "1001fx": { + apiKey: "your-api-key" + } + } +}); +``` \ No newline at end of file diff --git a/1001fx/actions/audio2video.ts b/1001fx/actions/audio2video.ts new file mode 100644 index 000000000..859ccf8fc --- /dev/null +++ b/1001fx/actions/audio2video.ts @@ -0,0 +1,182 @@ +import { AppContext } from "../mod.ts"; +import { isValidUrl, validateImages } from "../utils.ts"; +import { ImageConfig, VideoResolution } from "../client.ts"; +import { Buffer } from "node:buffer"; + +export interface Props { + /** + * @description The URL of the audio file (MP3). + * @example https://api.1001fx.com/testdata/jingle.mp3 + */ + url: string; + + /** + * @description Array of images to show in your video. The length of your video will be the sum of your image durations. + * It is recommended that all your images have the same aspect ratio. + * @minItems 1 + * @maxItems 10 + */ + images: ImageConfig[]; + + /** + * @description The URL of the thumbnail image (optional). + * @example https://api.1001fx.com/testdata/image.jpg + */ + thumbnailImageUrl?: string; + + /** + * @description The resolution of the output video (optional). + * @default { "width": 1280, "height": 720 } + */ + videoResolution?: VideoResolution; + + /** + * @description The presigned URLs to upload the result to. When provided, the video URL will be + * uploaded to this URL rather than returned directly. This allows for easier integration with storage systems. + */ + presignedUrl: string; +} + +interface AudioVideoResponse { + url: string; + statusCode: number; +} + +/** + * @title Convert MP3 to MP4 with Images + * @description Converts an MP3 audio file into an MP4 video file with images displayed for specified durations. + * The service adds images to the audio and creates a video file. The result is a URL to the MP4 file that is + * available for 48 hours. + */ +export default async function audio2videoAction( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { url, images, thumbnailImageUrl, videoResolution, presignedUrl } = + props; + + // Validate inputs + if (!isValidUrl(url)) { + throw new Error("Invalid audio URL provided"); + } + + if (images && !validateImages(images)) { + throw new Error( + "Invalid images array: must contain 1-10 valid image objects with URLs and durations", + ); + } + + if (thumbnailImageUrl && !isValidUrl(thumbnailImageUrl)) { + throw new Error("Invalid thumbnail image URL provided"); + } + + try { + // Prepare request body + const requestBody = { + url, + ...(images && { images }), + ...(thumbnailImageUrl && { thumbnailImageUrl }), + ...(videoResolution && { videoResolution }), + }; + + // Make API call to 1001fx + const response = await ctx.api["POST /audiovideo/audio2video"]( + {}, + { body: requestBody }, + ); + + const data = await response.json(); + + // If presignedUrl is provided, upload the result + if (presignedUrl && isValidUrl(presignedUrl)) { + await uploadToPresignedUrl(data.result.url, presignedUrl); + return { + url: presignedUrl.split("?")[0].replace("_presigned/", ""), // Return clean URL without query params + statusCode: 200, + }; + } + + // Return the direct result from 1001fx + return { + url: response.url, + statusCode: response.statusCode, + }; + } catch (error) { + console.error("Error in audio2video conversion:", error); + + // If we have a presignedUrl, try to write error message to it + if (presignedUrl) { + await writeErrorToPresignedUrl( + presignedUrl, + error instanceof Error ? error.message : "Unknown error occurred", + ); + } + + throw error; + } +} + +/** + * Uploads the video URL result to a presigned URL + */ +async function uploadToPresignedUrl( + videoUrl: string, + presignedUrl: string, +): Promise { + try { + // Create a JSON response with the video URL + const videoResponse = await fetch(videoUrl); + const arrayBuffer = await videoResponse.arrayBuffer(); + const buffer = Buffer.from(arrayBuffer); + + // Upload to presigned URL + const response = await fetch(presignedUrl, { + method: "PUT", + headers: { + "Content-Type": "application/octet-stream", + }, + body: buffer, + }); + + if (!response.ok) { + throw new Error( + `Failed to upload to presigned URL: ${response.status} ${response.statusText}`, + ); + } + } catch (error) { + console.error("Error uploading to presigned URL:", error); + throw error; + } +} + +/** + * Writes an error message to the presigned URL + */ +async function writeErrorToPresignedUrl( + presignedUrl: string, + errorMessage: string, +): Promise { + try { + const errorJson = JSON.stringify({ + error: errorMessage, + statusCode: 5, + }); + + const response = await fetch(presignedUrl, { + method: "PUT", + headers: { + "Content-Type": "application/json", + }, + body: errorJson, + }); + + if (!response.ok) { + console.error( + `Failed to write error to presigned URL: ${response.status} ${response.statusText}`, + ); + } + } catch (error) { + console.error("Error writing error to presigned URL:", error); + } +} diff --git a/1001fx/client.ts b/1001fx/client.ts new file mode 100644 index 000000000..fb51470b7 --- /dev/null +++ b/1001fx/client.ts @@ -0,0 +1,45 @@ +import { createHttpClient } from "../utils/http.ts"; +import { fetchSafe } from "../utils/fetch.ts"; + +export interface ImageConfig { + imageUrl: string; + duration: number; +} + +export interface VideoResolution { + width: number; + height: number; +} + +export interface Audio2VideoRequest { + url: string; + images?: ImageConfig[]; + thumbnailImageUrl?: string; + videoResolution?: VideoResolution; +} + +export interface Audio2VideoResponse { + url: string; + statusCode: number; +} + +export interface FX1001Client { + "POST /audiovideo/audio2video": { + body: Audio2VideoRequest; + response: Audio2VideoResponse; + }; +} + +export const createFX1001Client = ( + apiKey: string, + base = "https://api.1001fx.com", +) => { + return createHttpClient({ + base, + headers: new Headers({ + "Content-Type": "application/json", + "x-api-key": apiKey, + }), + fetcher: fetchSafe, + }); +}; diff --git a/1001fx/manifest.gen.ts b/1001fx/manifest.gen.ts new file mode 100644 index 000000000..e074d039c --- /dev/null +++ b/1001fx/manifest.gen.ts @@ -0,0 +1,17 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/audio2video.ts"; + +const manifest = { + "actions": { + "1001fx/actions/audio2video.ts": $$$$$$$$$0, + }, + "name": "1001fx", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/1001fx/mod.ts b/1001fx/mod.ts new file mode 100644 index 000000000..7c6e7ad10 --- /dev/null +++ b/1001fx/mod.ts @@ -0,0 +1,41 @@ +import { type App, type AppContext as AC } from "@deco/deco"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { createFX1001Client } from "./client.ts"; +import { Secret } from "../website/loaders/secret.ts"; + +export interface State { + api: ReturnType; +} + +export interface Props { + /** + * @description Your 1001fx API key + */ + apiKey: Secret | string; +} + +/** + * @title 1001fx + * @appName 1001fx + * @description Process and transform audio and video using AI-powered tools. + * @category Media + * @logo https://assets.decocache.com/mcp/b9109fab-421a-4275-911d-cec5651737d2/1001fx.svg + */ +export default function FX1001App(props: Props): App { + const { apiKey } = props; + + const api = createFX1001Client( + typeof apiKey === "string" ? apiKey : apiKey.get() || "", + ); + + return { + state: { + api, + }, + manifest, + dependencies: [], + }; +} + +export type FX1001App = ReturnType; +export type AppContext = AC; diff --git a/1001fx/utils.ts b/1001fx/utils.ts new file mode 100644 index 000000000..f1c2b334e --- /dev/null +++ b/1001fx/utils.ts @@ -0,0 +1,53 @@ +/** + * Extracts the install ID from a URL pathname with the format: + * /apps/1001fx/7afa4147-0903-4416-a52a-c1f7d3b35762/mcp/messages + * + * @param url URL object or string representation of the URL + * @returns The install ID from the pathname or null if not found + */ +export function getInstallId(url: URL | string): string | null { + const pathName = typeof url === "string" ? url : url.pathname; + + // Match the UUID pattern in the pathname after /apps/1001fx/ + const match = pathName.match( + /\/apps\/1001fx\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i, + ); + + return match ? match[1] : null; +} + +/** + * Helper function to validate a URL + * + * @param url URL to validate + * @returns boolean indicating if URL is valid + */ +export function isValidUrl(url: string): boolean { + try { + new URL(url); + return true; + } catch { + return false; + } +} + +/** + * Helper function to validate images array + * + * @param images Array of image configs to validate + * @returns boolean indicating if images array is valid + */ +export function validateImages( + images: Array<{ imageUrl: string; duration: number }>, +): boolean { + if (!Array.isArray(images) || images.length < 1 || images.length > 10) { + return false; + } + + return images.every((img) => + typeof img === "object" && + isValidUrl(img.imageUrl) && + typeof img.duration === "number" && + img.duration > 0 + ); +} diff --git a/CODE-OF-CONDUCT.md b/CODE-OF-CONDUCT.md new file mode 100644 index 000000000..e967f6cd7 --- /dev/null +++ b/CODE-OF-CONDUCT.md @@ -0,0 +1,74 @@ +# Contributor Covenant Code of Conduct + +## Our Pledge + +In the interest of fostering an open and welcoming environment, we as +contributors and maintainers pledge to making participation in our project and +our community a harassment-free experience for everyone, regardless of age, body +size, disability, ethnicity, gender identity and expression, level of +experience, education, socio-economic status, nationality, personal appearance, +race, religion, or sexual identity and orientation. + +## Our Standards + +Examples of behavior that contributes to creating a positive environment +include: + +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members + +Examples of unacceptable behavior by participants include: + +- The use of sexualized language or imagery and unwelcome sexual attention or + advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic + address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a + professional setting + +## Our Responsibilities + +Project maintainers are responsible for clarifying the standards of acceptable +behavior and are expected to take appropriate and fair corrective action in +response to any instances of unacceptable behavior. + +Project maintainers have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, or to ban temporarily or permanently any +contributor for other behaviors that they deem inappropriate, threatening, +offensive, or harmful. + +## Scope + +This Code of Conduct applies both within project spaces and in public spaces +when an individual is representing the project or its community. Examples of +representing a project or community include using an official project e-mail +address, posting via an official social media account, or acting as an appointed +representative at an online or offline event. Representation of a project may be +further defined and clarified by project maintainers. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported by contacting the project team at {{ email }}. All complaints will be +reviewed and investigated and will result in a response that is deemed necessary +and appropriate to the circumstances. The project team is obligated to maintain +confidentiality with regard to the reporter of an incident. Further details of +specific enforcement policies may be posted separately. + +Project maintainers who do not follow or enforce the Code of Conduct in good +faith may face temporary or permanent repercussions as determined by other +members of the project's leadership. + +## Attribution + +This Code of Conduct is adapted from the [Contributor Covenant][homepage], +version 1.4, available at +https://www.contributor-covenant.org/version/1/4/code-of-conduct.html + +[homepage]: https://www.contributor-covenant.org diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 000000000..5114d78e1 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,88 @@ +# Contributing Guidelines + +Thank you for your interest in contributing to the `deco-cx/apps` repository! We +are excited to have community members like you involved in improving our +collection of powerful apps. This document outlines how you can contribute +effectively to the project. + +## How to Contribute + +### Issues + +When submitting an issue, please use one of the following types: + +- **Issue/Bug**: Report bugs or track existing issues. +- **Issue/Discussion**: Start a discussion to gather input on a topic before it + becomes a proposal. +- **Issue/Proposal**: Propose a new idea or functionality. This allows for + feedback before any code is written. +- **Issue/Question**: Ask for help or clarification on any topic related to the + project. + +### Before You File an Issue + +Before submitting an issue, ensure the following: + +1. **Correct Repository**: Verify that you are filing the issue in the correct + repository within the deco ecosystem. +2. **Existing Issues**: Search through [open issues](./issues) to check if the + issue has already been reported or the feature has already been requested. +3. **For Bugs**: + - Confirm that it’s not an environment-specific issue. Ensure all + prerequisites (e.g., dependencies, configurations) are met. + - Provide detailed logs, stack traces, or any other relevant data to help + diagnose the issue. +4. **For Proposals**: + - Discuss potential features in the appropriate issue to gather feedback + before coding. + +### Pull Requests + +We welcome contributions via pull requests (PRs). Follow this workflow to submit +your changes: + +1. **Issue Reference**: Ensure there is an issue raised that corresponds to your + PR. +2. **Fork and Branch**: Fork the repository and create a new branch for your + changes. +3. **Code Changes**: + - Include appropriate tests with your code changes. + - Run linters and format the code according to project standards: + - Run `deno task check` +4. **Documentation**: Update any relevant documentation with your changes. +5. **Commit and PR**: Commit your changes and submit a PR for review. +6. **CI Checks**: Ensure that all Continuous Integration (CI) checks pass + successfully. +7. **Review Process**: A maintainer will review your PR, usually within a few + days. + +#### Work-in-Progress (WIP) PRs + +If you’d like early feedback on your work, you can create a PR with the prefix +`[WIP]` to indicate that it is still under development and not ready for +merging. + +### Testing Your Contributions + +Since this repository contains integrations that must be tested against a deco +site, you cannot test your contributions in isolation. Please refer to this +[Helpful content](https://www.notion.so/decocx/Helpful-Community-Content-101eec7ce64f4becaebb685dd9571e24) +for instructions on how to set up a deco site for testing purposes. + +### Use of Third-Party Code + +- Ensure that any third-party code included in your contributions comes with the + appropriate licenses. + +### Releasing a New Version + +We follow semantic versioning, and all apps in this repository are versioned +collectively using git tags. To release a new version: + +1. Fork the repository and create a pull request with your changes. +2. After the PR is approved and merged, request a maintainer to react the + releaser comment with the required emoji 👍 for **Patch** 🎉 for **Minor** 🚀 + for **Major** + +When your PR got merged, a new tag will arrive with the desired semver +modification. diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..2b04acdad --- /dev/null +++ b/LICENSE @@ -0,0 +1,204 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2021 The Dapr Authors. + + and others that have contributed code to the public domain. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/MAINTAINERS.txt b/MAINTAINERS.txt new file mode 100644 index 000000000..9f191be96 --- /dev/null +++ b/MAINTAINERS.txt @@ -0,0 +1,13 @@ +guitavano +matheusgr +viktormarinho +mcandeia +pedrofrxncx +lucis +vitoUwu +JonasJesus42 +aka-sacci-ccr +lui-dias +vibegui +igorbrasileiro +tlgimenes diff --git a/NewAppPrompt.md b/NewAppPrompt.md new file mode 100644 index 000000000..dac726711 --- /dev/null +++ b/NewAppPrompt.md @@ -0,0 +1,360 @@ +# Prompt to Create a New App + +> Use this prompt in an AI editor (Cursor, Windsurf) to create a new app + +**Important:** Run this alongside information about the app you're creating, be +it a documentation or OpenAPI specification. + +A deco app allows a service API to be exposed using Typescript functions. After +a service it wrapped in an app, it can be used + +- As a data source in deco CMS +- As a MCP server in deco.chat + +For the AI to create the necessary typings and functions, you need to provide a +data source for the API documentation. It can be the plain text of an API docs +or an OpenAPI specification. + +## Instructions + +A new app should be placed inside a folder on the root of this repo with the app +name. For example, if we're creating an app for Figma, the app files will be on +`figma/` + +### client.ts + +The client.ts is one of the central pieces of an app. It defines: + +- Typings for the data entities that the API accepts/returns. +- All API methods with typed input and output + +The client interface follows a specific pattern that works with the +`createHttpClient` utility. Here's a detailed example: + +```typescript +// First, define your data types/interfaces +export interface GithubUser { + login: string; + id: number; + avatar_url: string; +} + +// Then define your client interface +// The key format must be: "HTTP_METHOD /path/to/endpoint" +// Parameters in the URL path must be prefixed with : (e.g. :username) +// Optional parameters must end with ? (e.g. :filter?) +export interface GithubClient { + // Simple GET request with URL parameters + "GET /users/:username": { + response: GithubUser; // Type of the response + }; + + // POST request with body and URL parameters + "POST /users/:username": { + response: GithubUser; + body: { + filter: string; + }; + }; + + // GET request with query parameters (searchParams) + "GET /search/users": { + response: { users: GithubUser[] }; + searchParams: { + q: string; + page?: number; + per_page?: number; + }; + }; + + // POST with both URL params, query params and body + "POST /repos/:owner/:repo/issues": { + response: { id: number }; + body: { + title: string; + body: string; + }; + searchParams: { + assignee?: string; + labels?: string[]; + }; + }; +} +``` + +Key points about the client interface: + +1. **HTTP Methods**: Must be one of: GET, PUT, POST, DELETE, PATCH, HEAD + +2. **URL Parameters**: + - Required parameters: `:paramName` + - Optional parameters: `:paramName?` + - Wildcard parameters: `*` or `*paramName` + +3. **Response Type**: + - Always defined in the `response` property + - Can be any TypeScript type/interface + - Optional if the endpoint doesn't return data + +4. **Request Body**: + - Defined in the `body` property + - Required for POST/PUT/PATCH methods + - Must be a JSON-serializable object + +5. **Query Parameters**: + - Defined in the `searchParams` property + - All parameters are optional by default + - Can be primitive types or arrays + +Example usage with the client: + +```typescript +const api = createHttpClient({ + base: "https://api.github.com", + headers: new Headers({ + "Authorization": `Bearer ${token}`, + }), +}); + +// Using URL parameters +const user = await api["GET /users/:username"]({ + username: "octocat", +}); + +// Using query parameters +const search = await api["GET /search/users"]({ + q: "john", + page: 1, + per_page: 10, +}); + +// Using body and URL parameters +const issue = await api["POST /repos/:owner/:repo/issues"]( + { + owner: "octocat", + repo: "Hello-World", + }, + { + body: { + title: "Found a bug", + body: "This is a bug report", + }, + }, +); +``` + +The client interface is used by the `createHttpClient` utility to: + +- Type-check URL parameters +- Type-check request bodies +- Type-check query parameters +- Provide type-safe responses +- Handle URL construction +- Handle JSON serialization +- Manage headers and authentication + +### mod.ts + +The mod.ts is the entrypoint for the app and it declares the **app +configuration**, like API token or account name. This is information that is +required for all methods in the API and it might be better if the user informs +only once (when installing the app). + +It also instantiates the client or any other SDK/information that will be passed +as context for every action and loader when executed. It uses the + +Example: + +```typescript +import type { App, FnContext } from "@deco/deco"; +import { fetchSafe } from "../utils/fetch.ts"; +import { createHttpClient } from "../utils/http.ts"; +import type { Secret } from "../website/loaders/secret.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { ClientInterfaceExample } from "./client.ts"; + +export type AppContext = FnContext; + +export interface Props { + /** + * @title Account Name + * @description erploja2 etc + */ + account: string; + + /** + * @title API token + * @description The token for accessing your API + */ + token?: string | Secret; +} + +// Here we define the state of the app +// You choose what to put in the state +export interface State extends Omit { + api: ReturnType>; +} + +/** + * @name App Template + * @description This is an template of an app to be used as a reference. + * @category Developer Tools + * @logo https:// + */ +export default function App(props: Props): App { + const { token, account: _account } = props; + + const _stringToken = typeof token === "string" ? token : token?.get?.() ?? ""; + + const api = createHttpClient({ + base: `https://api.github.com/users/guitavano`, + headers: new Headers({ "Authorization": `Bearer ${_stringToken}` }), + fetcher: fetchSafe, + }); + + // it is the state of the app, all data + // here will be available in the context of + // loaders, actions and workflows + const state = { ...props, api }; + + return { + state, + manifest, + }; +} +``` + +### Actions and Loaders + +An app is used, after installed, by calling its actions and loaders. + +Actions and Loaders are Typescript functions that abstract the API methods of +the service being wrapped. + +Loaders are used to retrieve data. + +Actions are used when you save or update data in the external services. + +To declare an action or loader, it's just needed to create a `{actionName}.ts` +inside `{appFolder}/actions/` or `{loaderName}.ts` inside +`{appFolder}/loaders/`. You can use intermediary folders for organization. + +Examples: + +### Loader Example + +```typescript +import { AppContext } from "../mod.ts"; +import { GithubUser } from "../utils/types.ts"; + +interface Props { + username: string; +} + +/** + * @title This name will appear on the admin + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const response = await ctx.api[`GET /users/:username`]({ + username: props.username, + }); + + const result = await response.json(); + + return result; +}; + +export default loader; +``` + +### Action Example + +```typescript +import { AppContext } from "../mod.ts"; +import { GithubUser } from "../utils/types.ts"; + +interface Props { + username: string; +} + +/** + * @title This name will appear on the admin + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const response = await ctx.api[`POST /users/:username`]({ + username: props.username, + }, { body: { filter: "filter" } }); + + const result = await response.json(); + + return result; +}; + +export default action; +``` + +If a method has no props, just don't type the Props. Don't export an empty +interface. + +### deco.ts + +In root `deco.ts`, add a new entry for the newly created app. + +``` +const config = { + apps: [ + app("deno"), + app("figma"), + app("unsplash"), + app("reflect"), + app("grain"), + app("slack"), +``` + +### Manifest + +In every app folder there's also a `manifest.gen.ts` that exports all actions +and loaders from an app. You don't need to worry about this file because it will +be automatically generated when running `deno task start` in the root folder. + +Generate a first version so the app doesn't break: Example + +```typescript +// DO NOT EDIT. This file is generated by deco. +// 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/myAction.ts"; +import * as $$$0 from "./loaders/myLoader.ts"; +import * as $$$$$$0 from "./sections/mySection.tsx"; + +const manifest = { + "loaders": { + "app-template/loaders/myLoader.ts": $$$0, + }, + "sections": { + "app-template/sections/mySection.tsx": $$$$$$0, + }, + "actions": { + "app-template/actions/myAction.ts": $$$$$$$$$0, + }, + "name": "app-template", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; +``` + +## Manifest Gen + +In the end, run `deno task start` to regenerate the manifest. diff --git a/OauthPrompt.md b/OauthPrompt.md new file mode 100644 index 000000000..5a3adef16 --- /dev/null +++ b/OauthPrompt.md @@ -0,0 +1,153 @@ +# How to integrate with an Oauth Service + +## Requisits + +Two env vars which will hold the oAuth app information: + +- {PROVIDER_NAME}_CLIENT_ID +- {PROVIDER_NAME}_CLIENT_SECRET + +- You have to create two functions. A loaders/oauth/start.ts which will redirect + the user to the correct oauth login URL. + +## loaders/oauth/start.ts + + +import { OAUTH_URL_AUTH, SCOPES } from "../../utils/constant.ts"; + +export interface Props { clientId: string; redirectUri: string; state: string; } + +export default function start(props: Props) { const authParams = new +URLSearchParams({ client_id: props.clientId, redirect_uri: props.redirectUri, +response_type: "code", scope: SCOPES.join(" "), access_type: "offline", prompt: +"consent", state: props.state, }); + +const authorizationUrl = `${OAUTH_URL_AUTH}?${authParams.toString()}`; + +return Response.redirect(authorizationUrl); } + + +And a actions/oauth/callback.ts which will handle the flow after the user has +successfully authorized the app + +## actions/oauth/callback.ts + + +Example Code: + +import { AppContext } from "../../mod.ts"; + +interface OAuthCallbackResponse { access_token: string; expires_in: number; +refresh_token: string; scope: string; token_type: string; } + +export interface Props { code: string; installId: string; clientId: string; +clientSecret: string; redirectUri: string; } + +/** + +- @name OAUTH_CALLBACK +- @title OAuth Callback +- @description Exchanges the authorization code for access tokens */ export + default async function callback( { code, installId, clientId, clientSecret, + redirectUri }: Props, req: Request, ctx: AppContext, ): Promise<{ installId: + string }> { const { client } = ctx; + +const finalRedirectUri = redirectUri || new URL("/oauth/callback", +req.url).href; + +const response = await client["POST /token"]({ code, client_id: clientId, +client_secret: clientSecret, redirect_uri: finalRedirectUri, grant_type: +"authorization_code", }); + +const tokenData = await response.json() as OAuthCallbackResponse; const +currentTime = Math.floor(Date.now() / 1000); + +client.oauth.tokens.access_token = tokenData.access_token; +client.oauth.tokens.refresh_token = tokenData.refresh_token; +client.oauth.tokens.expires_in = tokenData.expires_in; client.oauth.tokens.scope += tokenData.scope; client.oauth.tokens.token_type = tokenData.token_type; +client.oauth.tokens.tokenObtainedAt = currentTime; + +const currentCtx = await ctx.getConfiguration(); await ctx.configure({ +...currentCtx, tokens: { access_token: tokenData.access_token, refresh_token: +tokenData.refresh_token, expires_in: tokenData.expires_in, scope: +tokenData.scope, token_type: tokenData.token_type, tokenObtainedAt: currentTime, +}, clientSecret: clientSecret, clientId: clientId, }); + +return { installId }; } + + +After those two functions are created, you must modify the app's mod.ts to +actually create the oAuth client accordingly. + +Here's an example mod.ts for oauth + + +import { createOAuthHttpClient } from "../mcp/utils/httpClient.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import type { FnContext } from "@deco/deco"; +import { McpContext } from "../mcp/context.ts"; +import { + API_URL, + OAUTH_URL, + OAUTH_URL_AUTH, + SCOPES, +} from "./utils/constant.ts"; +import { AuthClient, Client } from "./utils/client.ts"; +import { + DEFAULT_OAUTH_HEADERS, + OAuthClientOptions, + OAuthClients, + OAuthProvider, + OAuthTokens, +} from "../mcp/oauth.ts"; + +export const GoogleProvider: OAuthProvider = { name: "Google", authUrl: +OAUTH_URL_AUTH, tokenUrl: OAUTH_URL, scopes: SCOPES, clientId: "", clientSecret: +"", }; + +export interface Props { tokens?: OAuthTokens; clientSecret?: string; clientId?: +string; } + +export interface State extends Props { client: OAuthClients; +} + +export type AppContext = FnContext, Manifest>; + +/** + +- @title Google Gmail +- @description Integração com Google Gmail usando OAuth 2.0 com refresh + automático de tokens +- @category Produtividade +- @logo + https://upload.wikimedia.org/wikipedia/commons/thumb/7/7e/Gmail_icon_%282020%29.svg/1024px-Gmail_icon_%282020%29.svg.png + */ export default function App( props: Props, _req: Request, ctx?: + McpContext, ) { const { tokens, clientId, clientSecret } = props; + +const googleProvider: OAuthProvider = { ...GoogleProvider, clientId: clientId ?? +"", clientSecret: clientSecret ?? "", }; + +const options: OAuthClientOptions = { headers: DEFAULT_OAUTH_HEADERS, +authClientConfig: { headers: new Headers({ "Accept": "application/json", +"Content-Type": "application/x-www-form-urlencoded", }), }, }; + +const client = createOAuthHttpClient({ provider: +googleProvider, apiBaseUrl: API_URL, tokens, options, onTokenRefresh: async +(newTokens: OAuthTokens) => { if (ctx) { await ctx.configure({ ...ctx, tokens: +newTokens, }); } }, }); + +const state: State = { ...props, tokens, client, }; + +return { state, manifest, }; } + + + +export const SCOPES = [ + "https://www.googleapis.com/auth/gmail.readonly", +]; + +export const API_URL = "https://gmail.googleapis.com"; export const OAUTH_URL = +"https://oauth2.googleapis.com"; export const OAUTH_URL_AUTH = +`https://accounts.google.com/o/oauth2/v2/auth`; + diff --git a/README.md b/README.md index badc6cb49..57eb60737 100644 --- a/README.md +++ b/README.md @@ -1,77 +1,33 @@ -# Deco Standard **Apps** Library +
+ +Discord +  +![Build Status](https://github.com/deco-cx/apps/workflows/ci/badge.svg?event=push&branch=main) -The Deco Framework logo: A capybara in its natural habitat - -Welcome to the `deco-cx/apps` repository! This repository is home to a collection of powerful apps that can be seamlessly integrated into your deco sites. Here, we provide you with a brief overview of the deco framework and introduce the concept of apps. We'll also delve into the repository structure, how to contribute, and more. Read more about apps in the [docs](https://www.deco.cx/docs/en/concepts/app), also if you want to see apps in action check our [storefront](https://github.com/deco-sites/storefront) repository. - -## About the deco Framework - -Deco, formerly known as `live`, is a modern and versatile framework that empowers developers to build dynamic and interactive websites with ease. Apps are a fundamental component of deco, offering a way to bundle sets of blocks together, all configured through an intuitive UI and sharing a common state defined within the app module. - -## Repository Structure +
-The `deco-cx/apps` repository is structured as a monorepo, housing a collection of individual apps, each stored in a dedicated subfolder. These apps can be installed separately, providing you with the flexibility to choose and integrate only the functionalities that suit your project's needs. -The `deco.ts` file serves as a hub where you can specify the apps of this repository. However it is important to notice that whether you choose to create apps within this repository or within your own organization's repository, there are no limitations on where apps should be developed. +# Deco **Apps** Library / MCP Servers -## Overview - -At the core of all websites within this repository is the `website` app, located in the `website` folder. This app lays the foundation for websites, offering a set of common features that are essential regardless of whether your site is an e-commerce platform or not. We've also structured the repository to accommodate specific platforms, such as e-commerce platforms like VTEX, Shopify, VNDA, and more. These platform-specific apps depend on the `website` app, leveraging its shared features while adding platform-specific functionality. - -## Contributing +The Deco Framework logo: A capybara in its natural habitat -Contributions to the `deco-cx/apps` repository are highly encouraged! We maintain an open and collaborative environment where community members are valued and respected. When contributing, please follow our contribution guidelines and treat others with kindness and professionalism. Our review process ensures high-quality contributions that align with the repository's goals. +Welcome to the `deco-cx/apps` repository! Read more about apps in the [docs](https://www.deco.cx/docs/en/concepts/app). -We adhere to **semantic versioning**, and all apps within this repository are versioned collectively using git tags. To release a new version, simply fork the repository, open a pull request, and once approved, request any maintainer to run `deno task release`. There are no strict rules about release frequency, so you can release updates as soon as your changes are merged into the main branch. +Check and test apps in https://mcp.deco.site/. -### Developing a new app +### Create a new app -Just run: +Open this repo in an AI Editor and use [NewAppPrompt.md](NewAppPrompt.md) as prompt to create a new app. You can use OpenAPI, API docs or even code that explains the service you wish to expose as an app. -```sh -deno task new `APP_NAME` && deno task start -``` +--- -The app folder and the `deco.ts` will be changed in order to support your newly created app. +## Debugging HTTP Requests -Then you can run the watcher in a site that you own, +To enable verbose HTTP request debugging logs, set the environment variable `DEBUG_HTTP` to `true` when running this repo: ```sh -deno task watcher $SITE_NAME +DEBUG_HTTP=true deno run ... ``` -## Transition from deco-sites/std to deco-cx/apps - -This repository isn't a deco site as it used to be in `deco-sites/std`. In the past, we used `deco-sites/std` as a central hub for various platform integrations. Now, we've modularized these integrations into smaller, installable, and composable apps. These apps now reside in the `deco-cx/apps` repository. Additionally, the `/compat` folder contains two apps, `$live` and `deco-sites/std`, which serve as drop-in replacements for the older apps that contained all blocks together. As users progressively adopt the new apps, they can take full advantage of app extensibility and enhance their websites' capabilities. - -We're excited to have you as part of the Deco community and look forward to seeing the incredible apps and websites you'll create using the `deco-cx/apps` repository. Happy coding! - -For more information, check out our documentation at [https://deco.cx/docs](https://deco.cx/docs). - -### Apps - -| App Name | Description | Manifest | -| -------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------- | -| WebSite | The base app of any website. Contains `Page.tsx` block and other common loaders like image and fonts. | [manifest](/website/manifest.gen.ts) | -| VTEX | The app for e-commerce that uses VTEX as a platform. | [manifest](/vtex/manifest.gen.ts) | -| Shopify | The app for e-commerce that uses Shopify as a platform. | [manifest](/shopify/manifest.gen.ts) | -| VNDA | The app for e-commerce that uses VNDA as a platform. | [manifest](/vnda/manifest.gen.ts) | -| Workflows | Provides a simple set of loaders and actions to manage workflows | [manifest](/workflows/manifest.gen.ts) | -| Commerce | A simple configurable start for any e-commerce platform, lets you switch between any of those | [manifest](/commerce/manifest.gen.ts) | -| $live | An app for compatibility with $live blocks | [manifest](/compat/$live/manifest.gen.ts) | -| deco-sites/std | An app for compatibility with deco-sites/std app, contains various blocks merged from e-commerce apps. | [manifest](/compat/std/manifest.gen.ts) | -| decohub | The best place to find an app for your business case, here is where apps published by any developer in the deco ecosystem will live. | [manifest](/decohub/manifest.gen.ts) | -| handlebars | An app that allows you to build your own sections using [handlebars](https://handlebarsjs.com/). | [manifest](/handlebars/manifest.gen.ts) | -| Verified Reviews | An app that uses extension block to add Aggregate Rating to products by integrating with the "[Opiniões Verificadas](https://www.opinioes-verificadas.com.br/br/)" provider. | [manifest](/verified-reviews/manifest.gen.ts) | -| Algolia | Algolia search integration. Provides loaders and workflows for searching and indexing on Algolia | [manifest](/algolia/manifest.gen.ts) | -| Typesense | Typesense search integration. Provides loaders and workflows for searching and indexing on Typesense | [manifest](/algolia/manifest.gen.ts) | - -#### Adding a new app to Deco Hub - -In order to make your app available to be installable in any deco site, just import/export your app inside decohub/apps folder. - -## Thanks to all contributors +When enabled, this will print curl-like representations of all HTTP requests made by the internal HTTP client. - - - diff --git a/admin/actions/blocks/delete.ts b/admin/actions/blocks/delete.ts deleted file mode 100644 index caa2d6e89..000000000 --- a/admin/actions/blocks/delete.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AppContext } from "../../mod.ts"; - -export interface Props { - blockId: string; -} - -export default async function NewRevision( - { blockId }: Props, - _req: Request, - ctx: AppContext, -): Promise { - await ctx.storage.update({ [blockId]: null }); -} diff --git a/admin/actions/blocks/newRevision.ts b/admin/actions/blocks/newRevision.ts deleted file mode 100644 index 515889a28..000000000 --- a/admin/actions/blocks/newRevision.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { Resolvable } from "deco/engine/core/resolver.ts"; -import { ANONYMOUS, AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - blockId: string; - block: Resolvable; -} - -export default async function NewRevision( - { blockId, site, block }: Props, - _req: Request, - ctx: AppContext, -): Promise { - await ctx.storage.update({ [blockId]: block }); - - return { - site, - id: blockId, - createdAt: new Date(), - createdBy: ANONYMOUS, - revision: await ctx.storage.revision(), - resolveType: block.__resolveType, - value: block, - }; -} diff --git a/admin/actions/blocks/publish.ts b/admin/actions/blocks/publish.ts deleted file mode 100644 index 4fde3026d..000000000 --- a/admin/actions/blocks/publish.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - blockId: string; -} - -export default async function Publish( - props: Props, - _req: Request, - ctx: AppContext, -): Promise { - return await ctx.invoke["deco-sites/admin"].loaders.blocks.latest(props); -} diff --git a/admin/actions/blocks/restore.ts b/admin/actions/blocks/restore.ts deleted file mode 100644 index 09994a932..000000000 --- a/admin/actions/blocks/restore.ts +++ /dev/null @@ -1,8 +0,0 @@ -export interface Props { - blockId: string; -} - -export default async function Restore( - _props: Props, -): Promise { -} diff --git a/admin/actions/blocks/safeDelete.ts b/admin/actions/blocks/safeDelete.ts deleted file mode 100644 index 0cccec483..000000000 --- a/admin/actions/blocks/safeDelete.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { AppContext } from "../../mod.ts"; - -export interface Props { - blockId: string; -} - -export default async function NewRevision( - props: Props, - _req: Request, - ctx: AppContext, -): Promise { - await ctx.invoke["deco-sites/admin"].actions.blocks.delete(props); -} diff --git a/admin/actions/pages/publish.ts b/admin/actions/pages/publish.ts deleted file mode 100644 index a777c311b..000000000 --- a/admin/actions/pages/publish.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - pageId: string; -} - -export default async function Publish( - { site, pageId: blockId }: Props, - _req: Request, - ctx: AppContext, -): Promise { - return await ctx.invoke["deco-sites/admin"].loaders.blocks.latest({ - site, - blockId, - }); -} diff --git a/admin/fsStorage.ts b/admin/fsStorage.ts deleted file mode 100644 index e9e397811..000000000 --- a/admin/fsStorage.ts +++ /dev/null @@ -1,42 +0,0 @@ -import { Resolvable } from "deco/engine/core/resolver.ts"; -import { newFsProvider } from "deco/engine/releases/fs.ts"; -import { - OnChangeCallback, - ReadOptions, - Release, -} from "deco/engine/releases/provider.ts"; -import { join } from "std/path/mod.ts"; -import { BlockStore } from "./mod.ts"; - -export class FsBlockStorage implements BlockStore { - protected readOnly: Release; - protected path: string; - constructor(path = ".release.json") { - this.readOnly = newFsProvider(path); - this.path = join(Deno.cwd(), path); - } - async update( - resolvables: Record, - ): Promise> { - const state = await this.state(); - const merged = { ...state, ...resolvables }; - await Deno.writeTextFile(this.path, JSON.stringify(merged)); - return merged; - } - state( - options?: ReadOptions | undefined, - ): Promise> { - return this.readOnly.state(options); - } - archived( - options?: ReadOptions | undefined, - ): Promise> { - return this.readOnly.archived(options); - } - revision(): Promise { - return this.readOnly.revision(); - } - onChange(callback: OnChangeCallback): void { - return this.readOnly.onChange(callback); - } -} diff --git a/admin/loaders/blocks/latest.ts b/admin/loaders/blocks/latest.ts deleted file mode 100644 index 72b48f681..000000000 --- a/admin/loaders/blocks/latest.ts +++ /dev/null @@ -1,28 +0,0 @@ -import { ANONYMOUS, AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - blockId: string; -} - -export default async function Latest( - { blockId, site }: Props, - _req: Request, - ctx: AppContext, -): Promise { - const state = await ctx.storage.state(); - const block = state[blockId]; - if (!block) { - return null; - } - - return { - site, - id: blockId, - createdAt: new Date(), - createdBy: ANONYMOUS, - revision: await ctx.storage.revision(), - resolveType: block.__resolveType, - value: block, - }; -} diff --git a/admin/loaders/blocks/listRevisions.ts b/admin/loaders/blocks/listRevisions.ts deleted file mode 100644 index ff128a6d4..000000000 --- a/admin/loaders/blocks/listRevisions.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - blockId: string; -} - -export interface Pagination { - data: T[]; - page: number; - pageSize: number; - total: number; -} -export default async function ListRevisions( - props: Props, - _req: Request, - ctx: AppContext, -): Promise> { - const block = await ctx.invoke["deco-sites/admin"].loaders.blocks.latest( - props, - ); - if (!block) { - return { - data: [], - page: 0, - pageSize: 0, - total: 0, - }; - } - - return { - data: [block], - page: 0, - pageSize: 1, - total: 1, - }; -} diff --git a/admin/loaders/blocks/published.ts b/admin/loaders/blocks/published.ts deleted file mode 100644 index 9a4bd0c17..000000000 --- a/admin/loaders/blocks/published.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - blockId: string; -} - -export default async function Published( - props: Props, - _req: Request, - ctx: AppContext, -): Promise { - return await ctx.invoke["deco-sites/admin"].loaders.blocks.latest(props); -} diff --git a/admin/loaders/blocks/revision.ts b/admin/loaders/blocks/revision.ts deleted file mode 100644 index 35d0abc63..000000000 --- a/admin/loaders/blocks/revision.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { AppContext, BlockState } from "../../mod.ts"; - -export interface Props { - site: string; - blockId: string; -} - -export default async function Revision( - props: Props, - _req: Request, - ctx: AppContext, -): Promise { - return await ctx.invoke["deco-sites/admin"].loaders.blocks.latest(props); -} diff --git a/admin/loaders/releases/blocks.ts b/admin/loaders/releases/blocks.ts deleted file mode 100644 index cf8c9eabc..000000000 --- a/admin/loaders/releases/blocks.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { AppContext } from "../../mod.ts"; - -export interface Props { - site: string; -} - -export default function ListBlocks( - _props: Props, - _req: Request, - _ctx: AppContext, -) { - return { - data: [], - page: 0, - pageSize: 0, - total: 0, - }; -} diff --git a/admin/loaders/state.ts b/admin/loaders/state.ts deleted file mode 100644 index 93b467a8b..000000000 --- a/admin/loaders/state.ts +++ /dev/null @@ -1,17 +0,0 @@ -import { AppContext } from "../mod.ts"; - -export interface Props { - site: string; - blockId: string; -} - -// deno-lint-ignore no-explicit-any -export type State = Record; - -export default async function Latest( - _props: unknown, - _req: Request, - ctx: AppContext, -): Promise { - return await ctx.storage.state(); -} diff --git a/admin/manifest.gen.ts b/admin/manifest.gen.ts deleted file mode 100644 index 2ebcb1c8c..000000000 --- a/admin/manifest.gen.ts +++ /dev/null @@ -1,41 +0,0 @@ -// DO NOT EDIT. This file is generated by deco. -// This file SHOULD be checked into source version control. -// This file is automatically updated during development when running `dev.ts`. - -import * as $$$0 from "./loaders/blocks/revision.ts"; -import * as $$$1 from "./loaders/blocks/published.ts"; -import * as $$$2 from "./loaders/blocks/latest.ts"; -import * as $$$3 from "./loaders/blocks/listRevisions.ts"; -import * as $$$4 from "./loaders/state.ts"; -import * as $$$5 from "./loaders/releases/blocks.ts"; -import * as $$$$$$$$$0 from "./actions/blocks/publish.ts"; -import * as $$$$$$$$$1 from "./actions/blocks/restore.ts"; -import * as $$$$$$$$$2 from "./actions/blocks/safeDelete.ts"; -import * as $$$$$$$$$3 from "./actions/blocks/newRevision.ts"; -import * as $$$$$$$$$4 from "./actions/blocks/delete.ts"; -import * as $$$$$$$$$5 from "./actions/pages/publish.ts"; - -const manifest = { - "loaders": { - "deco-sites/admin/loaders/blocks/latest.ts": $$$2, - "deco-sites/admin/loaders/blocks/listRevisions.ts": $$$3, - "deco-sites/admin/loaders/blocks/published.ts": $$$1, - "deco-sites/admin/loaders/blocks/revision.ts": $$$0, - "deco-sites/admin/loaders/releases/blocks.ts": $$$5, - "deco-sites/admin/loaders/state.ts": $$$4, - }, - "actions": { - "deco-sites/admin/actions/blocks/delete.ts": $$$$$$$$$4, - "deco-sites/admin/actions/blocks/newRevision.ts": $$$$$$$$$3, - "deco-sites/admin/actions/blocks/publish.ts": $$$$$$$$$0, - "deco-sites/admin/actions/blocks/restore.ts": $$$$$$$$$1, - "deco-sites/admin/actions/blocks/safeDelete.ts": $$$$$$$$$2, - "deco-sites/admin/actions/pages/publish.ts": $$$$$$$$$5, - }, - "name": "deco-sites/admin", - "baseUrl": import.meta.url, -}; - -export type Manifest = typeof manifest; - -export default manifest; diff --git a/admin/mod.ts b/admin/mod.ts deleted file mode 100644 index 36cf4f486..000000000 --- a/admin/mod.ts +++ /dev/null @@ -1,41 +0,0 @@ -import { Resolvable } from "deco/engine/core/resolver.ts"; -import { Release } from "deco/engine/releases/provider.ts"; -import type { App, AppContext as AC } from "deco/mod.ts"; -import { FsBlockStorage } from "./fsStorage.ts"; -import { State as Resolvables } from "./loaders/state.ts"; -import manifest, { Manifest } from "./manifest.gen.ts"; - -export const ANONYMOUS = "Anonymous"; -export interface BlockStore extends Release { - update( - resolvables: Record, - ): Promise>; -} -export interface State { - storage: BlockStore; -} - -export interface BlockState { - id: string; - site: string; - createdAt: Date; - resolveType: string; - value: TBlock | null; - createdBy: string; - revision: string; -} - -export interface Props { - resolvables: Resolvables; -} - -/** - * @title Admin - */ -export default function App( - { resolvables }: Props, -): App { - return { manifest, state: { storage: new FsBlockStorage() }, resolvables }; -} - -export type AppContext = AC>; diff --git a/admin/types.ts b/admin/types.ts new file mode 100644 index 000000000..ad617df3b --- /dev/null +++ b/admin/types.ts @@ -0,0 +1,41 @@ +import { type fjp } from "./deps.ts"; +import { type Resolvable } from "@deco/deco"; +export interface Pagination { + data: T[]; + page: number; + pageSize: number; + total: number; +} +export interface PatchState { + type: "patch-state"; + payload: fjp.Operation[]; + revision: string; +} +export interface FetchState { + type: "fetch-state"; +} +export interface StatePatched { + type: "state-patched"; + payload: fjp.Operation[]; + revision: string; + // Maybe add data and user info in here + metadata?: unknown; +} +export interface StateFetched { + type: "state-fetched"; + payload: State; +} +export interface OperationFailed { + type: "operation-failed"; + code: "UNAUTHORIZED" | "INTERNAL_SERVER_ERROR"; + reason: string; +} +export type Acked = T & { + ack: string; +}; +export interface State { + decofile: Record; + revision: string; +} +export type Commands = PatchState | FetchState; +export type Events = StatePatched | StateFetched | OperationFailed; diff --git a/admin/widgets.ts b/admin/widgets.ts index 5c0ab3cc4..86224402d 100644 --- a/admin/widgets.ts +++ b/admin/widgets.ts @@ -12,3 +12,75 @@ export type HTMLWidget = string; * @format video-uri */ export type VideoWidget = string; + +/** + * @format file-uri + */ +export type FileWidget = string; + +/** + * @format dynamic-options + * @options website/loaders/options/routes.ts + */ +export type SiteRoute = string; + +/** + * @format map + */ +export type MapWidget = string; + +/** + * @format date + */ +export type DateWidget = string; + +/** + * @format date-time + */ +export type DateTimeWidget = string; + +/** + * @format textarea + */ +export type TextArea = string; + +/** + * @format rich-text + */ +export type RichText = string; + +/** + * @format color-input + * @default #000000 + */ +export type Color = string; + +/** + * @format code + * @language css + */ +export type CSS = string; + +/** + * @format code + * @language typescript + */ +export type TypeScript = string; + +/** + * @format code + * @language json + */ +export type Json = string; + +/** + * @format file-uri + * @accept text/csv + */ +export type CSVWidget = string; + +/** + * @format file-uri + * @accept application/pdf + */ +export type PDFWidget = string; diff --git a/ai-assistants/actions/awsUploadImage.ts b/ai-assistants/actions/awsUploadImage.ts new file mode 100644 index 000000000..34eb20426 --- /dev/null +++ b/ai-assistants/actions/awsUploadImage.ts @@ -0,0 +1,66 @@ +import base64ToBlob from "../utils/blobConversion.ts"; +import { AssistantIds } from "../types.ts"; +import { AppContext } from "../mod.ts"; +import { logger, meter, ValueType } from "@deco/deco/o11y"; +const stats = { + awsUploadImageError: meter.createCounter("assistant_aws_upload_error", { + unit: "1", + valueType: ValueType.INT, + }), +}; +export interface AWSUploadImageProps { + file: string | ArrayBuffer | null; + assistantIds?: AssistantIds; +} +// TODO(ItamarRocha): Check if possible to upload straight to bucket instead of using presigned url +async function getSignedUrl( + mimetype: string, + ctx: AppContext, +): Promise { + const randomID = crypto.randomUUID(); + const name = `${randomID}.${mimetype.split("/")[1]}`; + // Get signed URL from S3 + const s3Params = { + Bucket: ctx.assistantAwsProps?.assistantBucketName.get?.() ?? "", + Key: name, + ContentType: mimetype, + ACL: "public-read", + }; + const uploadURL = await ctx.s3?.getSignedUrlPromise("putObject", s3Params); + return uploadURL as string; +} +async function uploadFileToS3(presignedUrl: string, data: Blob) { + const response = await fetch(presignedUrl, { method: "PUT", body: data }); + return response; +} +// TODO(ItamarRocha): Rate limit +export default async function awsUploadImage( + awsUploadImageProps: AWSUploadImageProps, + _req: Request, + ctx: AppContext, +) { + const assistantId = awsUploadImageProps.assistantIds?.assistantId; + const threadId = awsUploadImageProps.assistantIds?.threadId; + const blobData = base64ToBlob( + awsUploadImageProps.file, + "image", + awsUploadImageProps.assistantIds, + ); + const uploadURL = await getSignedUrl(blobData.type, ctx); + const uploadResponse = await uploadFileToS3(uploadURL, blobData); + if (!uploadResponse.ok) { + stats.awsUploadImageError.add(1, { + assistantId, + }); + throw new Error(`Failed to upload file: ${uploadResponse.statusText}`); + } + logger.info({ + assistantId: assistantId, + threadId: threadId, + context: "awsUploadImage", + response: JSON.stringify(uploadResponse), + uploadUrl: uploadURL, + }); + const imageUrl = new URL(uploadURL); + return `${imageUrl.origin}${imageUrl.pathname}`; +} diff --git a/ai-assistants/actions/chat.ts b/ai-assistants/actions/chat.ts new file mode 100644 index 000000000..10f777d37 --- /dev/null +++ b/ai-assistants/actions/chat.ts @@ -0,0 +1,178 @@ +import { AppContext } from "../mod.ts"; +import { messageProcessorFor } from "../chat/messages.ts"; +import { Notify, Queue } from "../deps.ts"; +import { badRequest, notFound } from "@deco/deco"; +export interface Props { + thread?: string; + assistant: string; + message?: string; +} +/** + * Processes messages from the message queue. + * @param {Queue} q - The message queue. + * @param {Notify} abort - The notification object for aborting the message processing. + * @param {(c: ChatMessage) => Promise} processor - The function for processing each message. + * @returns {Promise} - A promise representing the completion of the message processing. + */ +const process = async ( + q: Queue, + abort: Notify, + processor: (c: ChatMessage) => Promise, +) => { + while (true) { + const message = await Promise.race([ + abort.notified(), + q.pop(), + ]); + if (typeof message !== "object") { + break; + } + await Promise.race([ + processor(message), + ]); + } +}; +export interface MessageContentText { + type: "text"; + value: string; + options?: string[]; +} +export interface MessageContentFile { + type: "file"; + fileId: string; +} +export interface ReplyMessage { + threadId: string; + messageId: string; + type: "message" | "error"; + content: Array; + role: "user" | "assistant"; +} +export interface FunctionCall { + name: string; + props: unknown; +} +export interface FunctionCallReply extends FunctionCall { + response: T; +} +export interface ReplyStartFunctionCall { + threadId: string; + messageId: string; + type: "start_function_call"; + content: FunctionCall; +} +export interface ReplyFunctionCalls { + threadId: string; + messageId: string; + type: "function_calls"; + content: FunctionCallReply[]; +} +export type Reply = + | ReplyMessage + | ReplyFunctionCalls + | ReplyStartFunctionCall; +export interface ChatMessage { + text: string; + reply: (reply: Reply) => void; +} +/** + * Initializes a WebSocket chat connection and processes incoming messages. + * @param {Props} props - The properties for the chat session. + * @param {Request} req - The HTTP request object containing the WebSocket connection. + * @param {AppContext} ctx - The application context. + * @returns {Response} - The HTTP response object. + */ +export default async function openChat( + props: Props, + req: Request, + ctx: AppContext, +): Promise< + Response | { + replies: Reply[]; + thread: string; + } +> { + if (!props.assistant) { + notFound(); + } + const assistant = ctx.assistants[props.assistant]; + if (!assistant) { + notFound(); + } + const threads = ctx.openAI.beta.threads; + const threadId = props.thread; + const threadPromise = threadId + ? threads.retrieve(threadId) + : threads.create(); + const processorPromise = assistant.then(async (aiAssistant) => + messageProcessorFor(aiAssistant, ctx, await threadPromise) + ); + if (req.headers.get("upgrade") !== "websocket") { + if (!props.message) { + badRequest({ message: "message is required when websocket is not used" }); + } + const processor = await processorPromise; + const replies: Reply[] = []; + await processor({ + text: props.message!, + reply: (reply) => replies.push(reply), + }); + return { replies, thread: (await threadPromise).id }; + } + const { socket, response } = Deno.upgradeWebSocket(req); + const abort = new Notify(); + const messagesQ = new Queue(); + if (props.message) { + messagesQ.push({ + text: props.message, + reply: (replyMsg) => socket.send(JSON.stringify(replyMsg)), + }); + } + /** + * Handles the WebSocket connection on open event. + */ + socket.onopen = async () => { + process( + messagesQ, + abort, + await processorPromise.catch((err) => { + socket.send( + `An error was suddently ocurred when message processor was created. ${err}`, + ); + socket.close(); + abort.notifyAll(); + throw err; + }), + ); + assistant.then((aiAssistant) => { + socket.send(JSON.stringify({ + isWelcomeMessage: true, + threadId: aiAssistant.threadId, + assistantId: aiAssistant.id, + type: "message", + content: [{ + type: "text", + value: aiAssistant.welcomeMessage ?? "Welcome to the chat!", + }], + role: "assistant", + })); + }); + }; + /** + * Handles the WebSocket connection on close event. + */ + socket.onclose = () => { + abort.notifyAll(); + }; + /** + * Handles the WebSocket connection on message event. + * @param {MessageEvent} event - The WebSocket message event. + */ + socket.onmessage = (event) => { + messagesQ.push({ + text: event.data, + reply: (replyMsg) => socket.send(JSON.stringify(replyMsg)), + }); + }; + return response; +} diff --git a/ai-assistants/actions/describeImage.ts b/ai-assistants/actions/describeImage.ts new file mode 100644 index 000000000..c5661f712 --- /dev/null +++ b/ai-assistants/actions/describeImage.ts @@ -0,0 +1,97 @@ +import { AssistantIds } from "../types.ts"; +import { AppContext } from "../mod.ts"; +import { logger, meter, ValueType } from "@deco/deco/o11y"; +import { shortcircuit } from "@deco/deco"; + +const stats = { + promptTokens: meter.createHistogram("assistant_image_prompt_tokens", { + description: "Tokens used in Sales Assistant Describe Image Input - OpenAI", + valueType: ValueType.INT, + }), + completionTokens: meter.createHistogram("assistant_image_completion_tokens", { + description: + "Tokens used in Sales Assistant Describe Image Output - OpenAI", + valueType: ValueType.INT, + }), + describeImageError: meter.createCounter("assistant_describe_image_error", { + unit: "1", + valueType: ValueType.INT, + }), +}; +export interface DescribeImageProps { + uploadURL: string; + userPrompt: string; + assistantIds?: AssistantIds; +} +// TODO(ItamarRocha): Rate limit +// TODO(@ItamarRocha): Refactor to use https://github.com/deco-cx/apps/blob/main/openai/loaders/vision.ts +export default async function describeImage( + describeImageProps: DescribeImageProps, + _req: Request, + ctx: AppContext, +) { + const assistantId = describeImageProps.assistantIds?.assistantId; + const threadId = describeImageProps.assistantIds?.threadId; + try { + const response = await ctx.openAI.chat.completions.create({ + model: "gpt-4-vision-preview", + messages: [ + { + role: "user", + content: [ + { + type: "text", + text: + `Describe this image in few words focus on it's main characteristics. + This description will be used to search similar items in an e-commerce store, + so describe name of the product and other relevant information. Use NO MORE than 3 words to describe the product. + Avoid using colors. Also, take into consideration the user prompt and describe the object it + focuses on if there is one. Output should be 1-2 sentences and should be a request summarizing + the user's need/request to a sales assistant that will search the product in an e-commerce store. + + * Use the same language as the user prompt in your answer * + + User prompt: + ${describeImageProps.userPrompt}`, + }, + { + type: "image_url", + image_url: { + "url": describeImageProps.uploadURL, + }, + }, + ], + }, + ], + }); + logger.info({ + assistantId: assistantId, + threadId: threadId, + context: "describeImage", + response: JSON.stringify(response), + props: describeImageProps, + }); + stats.promptTokens.record(response.usage?.prompt_tokens ?? 0, { + assistant_id: assistantId, + }); + stats.completionTokens.record(response.usage?.completion_tokens ?? 0, { + assistant_id: assistantId, + }); + return response; + } catch (error) { + const errorObj = error as { + error: { message: string }; + status: number; + headers: Headers; + }; + stats.describeImageError.add(1, { + assistantId, + }); + shortcircuit( + new Response(JSON.stringify({ error: errorObj.error.message }), { + status: errorObj.status, + headers: errorObj.headers, + }), + ); + } +} diff --git a/ai-assistants/actions/transcribeAudio.ts b/ai-assistants/actions/transcribeAudio.ts new file mode 100644 index 000000000..453417b22 --- /dev/null +++ b/ai-assistants/actions/transcribeAudio.ts @@ -0,0 +1,60 @@ +import base64ToBlob from "../utils/blobConversion.ts"; +import { AssistantIds } from "../types.ts"; +import { AppContext } from "../mod.ts"; +import { logger, meter, ValueType } from "@deco/deco/o11y"; +const stats = { + audioSize: meter.createHistogram("assistant_transcribe_audio_size", { + description: + "Audio size used in Sales Assistant Transcribe Image Input - OpenAI", + unit: "s", + valueType: ValueType.DOUBLE, + }), + transcribeAudioError: meter.createCounter( + "assistant_transcribe_audio_error", + { + unit: "1", + valueType: ValueType.INT, + }, + ), +}; +export interface TranscribeAudioProps { + file: string | ArrayBuffer | null; + assistantIds?: AssistantIds; + audioDuration: number; +} +// TODO(ItamarRocha): Rate limit +export default async function transcribeAudio( + transcribeAudioProps: TranscribeAudioProps, + _req: Request, + ctx: AppContext, +) { + const assistantId = transcribeAudioProps.assistantIds?.assistantId; + const threadId = transcribeAudioProps.assistantIds?.threadId; + if (!transcribeAudioProps.file) { + stats.transcribeAudioError.add(1, { + assistantId, + }); + throw new Error("Audio file is empty"); + } + const blobData = base64ToBlob( + transcribeAudioProps.file, + "audio", + transcribeAudioProps.assistantIds, + ); + const file = new File([blobData], "input.wav", { type: "audio/wav" }); + stats.audioSize.record(transcribeAudioProps.audioDuration, { + assistant_id: assistantId, + }); + const response = await ctx.openAI.audio.transcriptions.create({ + model: "whisper-1", + file: file, + }); + logger.info({ + assistantId: assistantId, + threadId: threadId, + context: "transcribeAudio", + subcontext: "response", + response: JSON.stringify(response), + }); + return response; +} diff --git a/ai-assistants/chat/messages.ts b/ai-assistants/chat/messages.ts new file mode 100644 index 000000000..169eab460 --- /dev/null +++ b/ai-assistants/chat/messages.ts @@ -0,0 +1,319 @@ +import { Context, type JSONSchema7, lazySchemaFor } from "@deco/deco"; +import { meter, ValueType } from "@deco/deco/o11y"; +import { weakcache } from "../../utils/weakcache.ts"; +import { + ChatMessage, + FunctionCallReply, + Reply, + ReplyMessage, +} from "../actions/chat.ts"; +import { + AssistantCreateParams, + RequiredActionFunctionToolCall, + Thread, +} from "../deps.ts"; +import { threadMessageToReply, Tokens } from "../loaders/messages.ts"; +import { AIAssistant, AppContext } from "../mod.ts"; +import { dereferenceJsonSchema } from "../schema.ts"; +const stats = { + latency: meter.createHistogram("assistant_latency", { + description: + "assistant latency (time it takes from the moment the server receives the request to the moment it sends the response)", + unit: "ms", + valueType: ValueType.DOUBLE, + }), +}; +// Max length of instructions. The maximum context of the assistant is 32K chars. We use 25K for instructions to be safe. +const MAX_INSTRUCTIONS_LENGTH = 25000; +const notUndefined = (v: T | undefined): v is T => v !== undefined; +const toolsCache = new weakcache.WeakLRUCache({ + cacheSize: 16, // up to 16 different schemas stored here. +}); +/** + * Builds assistant tools that can be used by OpenAI assistant to execute actions based on users requests. + * @param assistant the assistant that will handle the request + * @returns an array of available functions that can be used. + */ +const appTools = async ( + assistant: AIAssistant, +): Promise => { + const ctx = Context.active(); + const assistantsKey = assistant.availableFunctions?.join(",") ?? "all"; + const revision = await ctx.release!.revision(); + const cacheKey = `${assistantsKey}@${revision}`; + if (toolsCache.has(cacheKey)) { + return toolsCache.get(cacheKey)!; + } + const toolsPromise = ctx.runtime!.then(async (runtime) => { + const schemas = await lazySchemaFor(ctx).value; + const functionKeys = assistant.availableFunctions ?? Object.keys({ + ...runtime.manifest.loaders, + ...runtime.manifest.actions, + }); + const tools = functionKeys.map((functionKey) => { + const functionDefinition = btoa(functionKey); + const schema = schemas.definitions[functionDefinition]; + if ( + (schema as { + ignoreAI?: boolean; + })?.ignoreAI + ) { + return undefined; + } + const propsRef = (schema?.allOf?.[0] as JSONSchema7)?.$ref; + if (!propsRef) { + return undefined; + } + const dereferenced = dereferenceJsonSchema({ + $ref: propsRef, + ...schemas, + }); + if ( + dereferenced.type !== "object" || + (dereferenced.oneOf || dereferenced.anyOf || + dereferenced?.allOf || dereferenced?.enum || dereferenced?.not) + ) { + return undefined; + } + return { + type: "function" as const, + function: { + name: functionKey, + description: + `Usage for: ${schema?.description}. Example: ${schema?.examples}`, + parameters: { + ...dereferenced, + definitions: undefined, + root: undefined, + }, + }, + }; + }).filter(notUndefined); + toolsCache.set(ctx, tools); + return tools; + }); + toolsCache.set(cacheKey, toolsPromise); + return toolsPromise; +}; +export interface ProcessorOpts { + assistantId: string; + instructions: string; +} +const sleep = (ns: number) => new Promise((resolve) => setTimeout(resolve, ns)); +const cache: Record = {}; +const invokeFor = ( + ctx: AppContext, + assistant: AIAssistant, + onFunctionCallStart: ( + tool: RequiredActionFunctionToolCall, + props: unknown, + ) => void, + onFunctionCallEnd: ( + tool: RequiredActionFunctionToolCall, + props: unknown, + response: unknown, + ) => void, +) => { + return async (call: RequiredActionFunctionToolCall) => { + try { + const props = JSON.parse(call.function.arguments || "{}"); + const cacheKey = `${call.function.arguments}${call.function.name}`; + const assistantProps = assistant?.useProps?.(props) ?? props; + cache[cacheKey] ??= ctx.invoke( + // deno-lint-ignore no-explicit-any + call.function.name as any, + assistantProps, + ); + onFunctionCallStart(call, assistantProps); + const invokeResponse = await cache[cacheKey]; + onFunctionCallEnd(call, assistantProps, invokeResponse); + return { + tool_call_id: call.id, + output: JSON.stringify(invokeResponse), + }; + } catch (err) { + console.error("invoke error", err); + return { + tool_call_id: call.id, + output: "[]", + }; + } + }; +}; +/** + * Creates a message processor function for the given AI assistant and context. + * @param {AIAssistant} assistant - The AI assistant for processing messages. + * @param {AppContext} ctx - The application context. + * @returns {Promise<(message: ChatMessage) => void>} - A function that processes incoming chat messages. + */ +export const messageProcessorFor = async ( + assistant: AIAssistant, + ctx: AppContext, + thread: Thread, +) => { + const openAI = ctx.openAI; + const threads = openAI.beta.threads; + const instructions = + `${ctx.instructions}. Introduce yourself as ${assistant.name}. ${assistant.instructions}. The files uploaded to the assistant should + give you a good context of how the products you are dealing with are formatted. ${ + assistant.prompts + ? "Below are arbitrary prompt that gives you information about the current context, it can be empty." + : "" + }\n${ + (assistant.prompts ?? []).map((prompt) => + `this is the ${prompt.context}: ${prompt.content}` + ) + }. DO NOT CHANGE FUNCTIONS NAMES, do not remove .ts at the end of function name. do not remove / at the end of function name. + If you are positive that your response contains the information that the user requests (like product descriptions, product names, prices, colors, and sizes), add an ${Tokens.POSITIVE} symbol at the end of the phrase. Otherwise, add a ${Tokens.NEGATIVE} symbol. + For example, if the user asks about product availability and you have the information, respond with "The product is in stock. @". If you don't have the information, respond with "I'm sorry, the product is currently unavailable. ${Tokens.NEGATIVE}". + `; + const assistantId = await ctx.assistant.then((assistant) => assistant.id); + const tools = await appTools(assistant); + // Update the assistant object with the thread and assistant id + assistant.threadId = thread.id; + assistant.id = assistantId; + /** + * Processes an incoming chat message. + * @param {ChatMessage} message - The incoming chat message. + * @returns {Promise} - A promise representing the completion of message processing. + */ + return async ({ text: content, reply: _reply }: ChatMessage) => { + // send message + const start = performance.now(); + await threads.messages.create(thread.id, { + content, + role: "user", + }); + // create run + const run = await threads.runs.create(thread.id, { + model: typeof assistant.model === "object" + ? assistant.model.custom + : assistant.model, + assistant_id: assistantId, + instructions: instructions.slice(0, MAX_INSTRUCTIONS_LENGTH), + tools, + }); + const messageId = run.id; + // Wait for the assistant answer + const functionCallReplies: FunctionCallReply[] = []; + // Reply to the user + const reply = (message: Reply) => { + assistant.onMessageSent?.({ + assistantId: run.assistant_id, + threadId: thread.id, + runId: run.id, + model: run.model, + message, + }); + return _reply(message); + }; + assistant.onMessageReceived?.({ + assistantId: run.assistant_id, + threadId: thread.id, + runId: run.id, + model: run.model, + message: { type: "text", value: content }, + }); + const invoke = invokeFor(ctx, assistant, (call, props) => { + reply({ + threadId: thread.id, + messageId, + type: "start_function_call", + content: { + name: call.function.name, + props, + }, + }); + stats.latency.record(performance.now() - start, { + type: "start_function_call", + assistant_id: run.assistant_id, + }); + }, (call, props, response) => { + functionCallReplies.push({ + name: call.function.name, + props, + response, + }); + }); + let runStatus; + do { + runStatus = await threads.runs.retrieve(thread.id, run.id); + if (runStatus.status === "requires_action") { + const actions = runStatus.required_action!; + const outputs = actions.submit_tool_outputs; + const tool_outputs = await Promise.all(outputs.tool_calls.map(invoke)); + if (tool_outputs.length === 0) { + const message: ReplyMessage = { + messageId: Date.now().toString(), + threadId: thread.id, + type: "error", + content: [], + role: "assistant", + }; + reply(message); + return; + } + await threads.runs.submitToolOutputs(thread.id, run.id, { + tool_outputs, + }); + runStatus = await threads.runs.retrieve(thread.id, run.id); + } + await sleep(500); + } while (["in_progress", "queued"].includes(runStatus.status)); + const messages = await threads.messages.list(thread.id); + const threadMessages = messages.data; + const lastMsg = threadMessages + .findLast((message) => + message.run_id == run.id && message.role === "assistant" + ); + if (!lastMsg) { + // TODO(@mcandeia) in some cases the bot didn't respond anything. + const message: ReplyMessage = { + messageId: Date.now().toString(), + threadId: thread.id, + type: "error", + content: [], + role: "assistant", + }; + reply(message); + return; + } + const replyMessage = threadMessageToReply(lastMsg); + // multi tool use parallel seems to be some sort of openai bug, and it seems to have no solution yet. + // https://community.openai.com/t/model-tries-to-call-unknown-function-multi-tool-use-parallel/490653 + // It's an error that only happens every now and then. Open ai tries to call "multi_tool_use.parallel" function that doesn't even exist and isn't even in the OpenAI documentation + // If functionCallReplies is not an array it should also be considered an error + if ( + (functionCallReplies.length === 1 && + functionCallReplies[0].name === "multi_tool_use.parallel") || + !Array.isArray(functionCallReplies) + ) { + const message: ReplyMessage = { + messageId: Date.now().toString(), + threadId: thread.id, + type: "error", + content: [], + role: "assistant", + }; + reply(message); + } else { + reply(replyMessage); + stats.latency.record(performance.now() - start, { + type: "text", + assistant_id: run.assistant_id, + }); + } + if (functionCallReplies.length > 0) { + reply({ + threadId: thread.id, + messageId, + type: "function_calls" as const, + content: functionCallReplies, + }); + stats.latency.record(performance.now() - start, { + type: "function_calls", + assistant_id: run.assistant_id, + }); + } + }; +}; diff --git a/ai-assistants/deps.ts b/ai-assistants/deps.ts new file mode 100644 index 000000000..8f283a6dc --- /dev/null +++ b/ai-assistants/deps.ts @@ -0,0 +1,18 @@ +export type { + Assistant, + AssistantCreateParams, +} from "https://deno.land/x/openai@v4.19.1/resources/beta/assistants/assistants.ts"; + +export { Notify } from "https://deno.land/x/async@v2.0.2/notify.ts"; +export { Queue } from "https://deno.land/x/async@v2.0.2/queue.ts"; +export type { + MessageContentImageFile, + MessageContentText, + ThreadMessage, +} from "https://deno.land/x/openai@v4.19.1/resources/beta/threads/messages/messages.ts"; +export type { + RequiredActionFunctionToolCall, +} from "https://deno.land/x/openai@v4.19.1/resources/beta/threads/runs/runs.ts"; +export type { + Thread, +} from "https://deno.land/x/openai@v4.19.1/resources/beta/threads/threads.ts"; diff --git a/ai-assistants/hooks/useFileUpload.ts b/ai-assistants/hooks/useFileUpload.ts new file mode 100644 index 000000000..7ce05dd7a --- /dev/null +++ b/ai-assistants/hooks/useFileUpload.ts @@ -0,0 +1,9 @@ +import { invoke } from "../runtime.ts"; + +const state = { + describeImage: invoke["ai-assistants"].actions.describeImage, + awsUploadImage: invoke["ai-assistants"].actions.awsUploadImage, + transcribeAudio: invoke["ai-assistants"].actions.transcribeAudio, +}; + +export const useFileUpload = () => state; diff --git a/ai-assistants/loaders/messages.ts b/ai-assistants/loaders/messages.ts new file mode 100644 index 000000000..51c26dca5 --- /dev/null +++ b/ai-assistants/loaders/messages.ts @@ -0,0 +1,90 @@ +import { ReplyMessage } from "../actions/chat.ts"; +import { + MessageContentImageFile, + MessageContentText, + ThreadMessage, +} from "../deps.ts"; +import { AppContext } from "../mod.ts"; +export interface Props { + thread: string; + after?: string; + before?: string; +} + +export const Tokens = { + POSITIVE: "@", + NEGATIVE: "#", + OPTIONS: "&&&", +}; + +const normalize = (strContent: string) => { + const hasOptions = strContent.includes(Tokens.OPTIONS); + + if (!hasOptions) { + return strContent.endsWith(Tokens.POSITIVE) || + strContent.endsWith(Tokens.NEGATIVE) + ? strContent.slice(0, strContent.length - 2) + : strContent; + } + + return strContent.split(Tokens.OPTIONS)[0]; +}; + +export const getToken = (message: ThreadMessage): string => { + const text = (message.content[0] as MessageContentText).text?.value; + if (!text) { + return Tokens.NEGATIVE; + } + return text.endsWith(Tokens.POSITIVE) ? Tokens.POSITIVE : Tokens.NEGATIVE; +}; + +export const threadMessageToReply = (message: ThreadMessage): ReplyMessage => { + return { + threadId: message.thread_id!, + messageId: message.run_id!, + type: "message", + content: message.content.map((cnt) => + isFileContent(cnt) ? { type: "file", fileId: cnt.image_file.file_id! } : { + type: "text", + value: normalize(cnt.text!.value), + options: getOptions(cnt), + } + ), + role: message.role, + }; +}; + +// Function to for the token OPTIONS in the message content and get everything after it to get the options. +// If your response contains options for the user to choose from, make sure to include the ${Tokens.OPTIONS} symbol in your response, followed by the options separated by commas, followed by another ${Tokens.OPTIONS} symbol. +const getOptions = (content: MessageContentText): string[] => { + const text = content.text?.value; + + if (!text) { + return []; + } + const options = text.split(Tokens.OPTIONS)[1]; + + if (!options) { + return []; + } + + return options.split(",").map((option) => option.trim()); +}; + +const isFileContent = ( + v: MessageContentImageFile | MessageContentText, +): v is MessageContentImageFile => { + return (v as MessageContentImageFile)?.image_file?.file_id !== undefined; +}; + +export default async function messages( + { thread, after, before }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const messages = await ctx.openAI.beta.threads.messages.list(thread, { + after, + before, + }); + return messages.data.map(threadMessageToReply); +} diff --git a/ai-assistants/logo.png b/ai-assistants/logo.png new file mode 100644 index 000000000..be41da6b9 Binary files /dev/null and b/ai-assistants/logo.png differ diff --git a/ai-assistants/manifest.gen.ts b/ai-assistants/manifest.gen.ts new file mode 100644 index 000000000..84b6b47d7 --- /dev/null +++ b/ai-assistants/manifest.gen.ts @@ -0,0 +1,27 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/awsUploadImage.ts"; +import * as $$$$$$$$$1 from "./actions/chat.ts"; +import * as $$$$$$$$$2 from "./actions/describeImage.ts"; +import * as $$$$$$$$$3 from "./actions/transcribeAudio.ts"; +import * as $$$0 from "./loaders/messages.ts"; + +const manifest = { + "loaders": { + "ai-assistants/loaders/messages.ts": $$$0, + }, + "actions": { + "ai-assistants/actions/awsUploadImage.ts": $$$$$$$$$0, + "ai-assistants/actions/chat.ts": $$$$$$$$$1, + "ai-assistants/actions/describeImage.ts": $$$$$$$$$2, + "ai-assistants/actions/transcribeAudio.ts": $$$$$$$$$3, + }, + "name": "ai-assistants", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/ai-assistants/mod.ts b/ai-assistants/mod.ts new file mode 100644 index 000000000..585b4d471 --- /dev/null +++ b/ai-assistants/mod.ts @@ -0,0 +1,209 @@ +import AWS from "npm:aws-sdk@2.1585.0"; +import { deferred } from "std/async/deferred.ts"; +import openai, { + Props as OpenAIProps, + State as OpenAIState, +} from "../openai/mod.ts"; +import { Assistant } from "./deps.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { Secret } from "../website/loaders/secret.ts"; +import { PreviewContainer } from "../utils/preview.tsx"; +import { + type App, + type AppContext as AC, + type AppManifest, + asResolved, + type AvailableActions, + type AvailableLoaders, + isDeferred, +} from "@deco/deco"; +import { isAwaitable } from "@deco/deco/utils"; +export type GPTModel = + | "gpt-4-0613" + | "gpt-4-0314" + | "gpt-4-1106-preview" + | "gpt-4" + | "gpt-3.5-turbo-1106" + | "gpt-3.5-turbo-16k" + | "gpt-3.5-turbo-16k-0613" + | "gpt-3.5-turbo" + | "gpt-3.5-turbo-0613"; +/** + * Represents an AI Assistant with specific capabilities and configurations. + * @template TManifest - The type of the AppManifest associated with the AI Assistant. + */ +export interface AIAssistant { + /** + * The name of the AI Assistant. + */ + name: string; + /** + * Optional instructions or guidelines for the AI Assistant. + */ + instructions?: string; + /** + * Optional array of prompts to provide context for the AI Assistant. + */ + prompts?: Prompt[]; + /** + * Optional welcome message to be displayed when the chat session starts. + */ + welcomeMessage?: string; + /** + * Optional list of available functions (actions or loaders) that the AI Assistant can perform. + */ + availableFunctions?: Array< + AvailableActions | AvailableLoaders + >; + /** + * Optional function to customize the handling of properties (props) passed to the AI Assistant. + * It takes a set of properties and returns a modified set of properties. + * @param {unknown} props - The properties passed to the AI Assistant. + * @returns {unknown} - The modified properties. + */ + useProps?: (props: unknown) => unknown; + /** + * Optional function to log the received messages from the user. + * @param {Log} logInfo - User message / information. + * @returns {void} - The modified properties. + */ + onMessageReceived?: (logInfo: Log) => void; + /** + * Optional function to log the received messages sent by the assistant. + * @param {Log} logInfo - Assistant message / information. + * @returns {void} - The modified properties. + */ + onMessageSent?: (logInfo: Log) => void; + /** + * The GPT model that will be used, if not specified the assistant model will be used. + */ + model?: GPTModel | { + custom: string; + }; + /** + * The Id of the assistant + */ + id?: string; + /** + * The Id of the assistant thread + */ + threadId?: string; +} +export interface Log { + assistantId: string; + threadId: string; + runId: string; + model: string; + message: object; +} +export interface Prompt { + content: string; + context: string; +} +export interface AssistantAwsProps { + assistantBucketRegion: Secret; + accessKeyId: Secret; + secretAccessKey: Secret; + assistantBucketName: Secret; +} +export interface Props extends OpenAIProps { + /** + * @description the assistant Id + */ + assistantId: string; + /** + * @description Instructions + */ + instructions?: string; + assistants?: AIAssistant[]; + assistantAwsProps?: AssistantAwsProps; + s3?: AWS.S3; +} +export interface State extends OpenAIState { + instructions?: string; + assistant: Promise; + assistants: Record>; + assistantAwsProps?: AssistantAwsProps; + s3?: AWS.S3; +} +/** + * @title Deco AI Assistant + * @description Create AI assistants on deco.cx. + * @category Tool + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/ai-assistants/logo.png + */ +export default function App(state: Props): App, +]> { + const openAIApp = openai(state); + const assistantsAPI = openAIApp.state.openAI?.beta?.assistants; + // Sets assistantId only if state.assistants exists + const assistantId = (state.assistants?.[0] ?? null) !== null + ? state.assistantId + : ""; + return { + manifest, + state: { + ...openAIApp.state, + assistants: (state.assistants ?? []).filter(Boolean).reduce( + (acc, assistant) => { + const assistantDeferred = deferred(); + if (isDeferred(assistant)) { + const aiAssistant = assistant(); + if (isAwaitable(aiAssistant)) { + aiAssistant.then(assistantDeferred.resolve).catch( + assistantDeferred.reject, + ); + } else { + assistantDeferred.resolve(aiAssistant); + } + } else if (assistant) { + assistantDeferred.resolve(assistant); + } + return { [assistant.name]: assistantDeferred, ...acc }; + }, + {}, + ), + instructions: `${state.instructions ?? ""}`, + assistant: typeof assistantsAPI?.retrieve === "function" + ? assistantsAPI.retrieve(assistantId) + : Promise.resolve({} as Assistant), + s3: new AWS.S3({ + region: state.assistantAwsProps?.assistantBucketRegion.get?.() ?? + Deno.env.get("ASSISTANT_BUCKET_REGION"), + accessKeyId: state.assistantAwsProps?.accessKeyId.get?.() ?? + Deno.env.get("AWS_ACCESS_KEY_ID"), + secretAccessKey: state.assistantAwsProps?.secretAccessKey.get?.() ?? + Deno.env.get("AWS_SECRET_ACCESS_KEY"), + }), + assistantAwsProps: state.assistantAwsProps, + }, + dependencies: [openAIApp], + }; +} +export const onBeforeResolveProps = (props: Props) => { + if (Array.isArray(props?.assistants)) { + return { + ...props, + assistants: props.assistants.map((assistant) => + asResolved(assistant, true) + ), + }; + } + return props; +}; +export type AppContext = AC>; +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Deco AI Assistant", + owner: "deco.cx", + description: "Create AI assistants on deco.cx.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/ai-assistants/logo.png", + images: [], + tabs: [], + }, + }; +}; diff --git a/ai-assistants/runtime.ts b/ai-assistants/runtime.ts new file mode 100644 index 000000000..da42a2435 --- /dev/null +++ b/ai-assistants/runtime.ts @@ -0,0 +1,3 @@ +import { Manifest } from "./manifest.gen.ts"; +import { proxy } from "@deco/deco/web"; +export const invoke = proxy(); diff --git a/ai-assistants/schema.ts b/ai-assistants/schema.ts new file mode 100644 index 000000000..493aff815 --- /dev/null +++ b/ai-assistants/schema.ts @@ -0,0 +1,32 @@ +import { type JSONSchema7 } from "@deco/deco"; +const isJSONSchema = (v: unknown | JSONSchema7): v is JSONSchema7 & { + $ref: string; +} => { + return (typeof v === "object" && ((v as JSONSchema7)?.$ref !== undefined)); +}; +export function dereferenceJsonSchema( + schema: JSONSchema7 & { + definitions?: Record; + }, +) { + const resolveReference = ( + obj: unknown, + visited: Record, + ): JSONSchema7 => { + if (isJSONSchema(obj)) { + if (visited[obj["$ref"]]) { + return {}; + } + visited[obj["$ref"]] = true; + const [_, __, ref] = obj["$ref"].split("/"); + return resolveReference(schema?.definitions?.[ref], visited); + } else if (obj && typeof obj === "object") { + const recordObj = obj as Record; + for (const key in recordObj) { + recordObj[key] = resolveReference(recordObj[key], visited); + } + } + return obj as JSONSchema7; + }; + return resolveReference(schema, {}); +} diff --git a/ai-assistants/types.ts b/ai-assistants/types.ts new file mode 100644 index 000000000..eb8ff617e --- /dev/null +++ b/ai-assistants/types.ts @@ -0,0 +1,38 @@ +/** + * A personalized assistant configuration + */ +export interface AssistantPersonalization { + /** + * @title The assistant's name + */ + nickname?: string; + + /** + * @title The assistant's personality + */ + mood?: + | "Friendly" + | "Straight to the Point" + | "Humorous" + | "Professional" + | "Enthusiastic" + | "Informative" + | "Sarcastic" + | "Formal" + | "Energetic" + | "Curious" + | "Confident" + | "Helpful"; +} + +export interface AssistantIds { + /** + * @title The assistant's id + */ + assistantId?: string; + + /** + * @title The current thread id + */ + threadId?: string; +} diff --git a/ai-assistants/utils/blobConversion.ts b/ai-assistants/utils/blobConversion.ts new file mode 100644 index 000000000..826cba88c --- /dev/null +++ b/ai-assistants/utils/blobConversion.ts @@ -0,0 +1,51 @@ +import { AssistantIds } from "../types.ts"; +import { logger } from "@deco/deco/o11y"; +export default function base64ToBlob( + base64: string | ArrayBuffer | null, + context: string, + assistantIds?: AssistantIds, +): Blob { + let regex = + /^data:(audio\/[a-z0-9\-\+\.]+|video\/[a-z0-9\-\+\.]+);base64,(.*)$/; + if (context === "image") { + regex = /^data:(image\/[a-z]+);base64,(.*)$/; + } + // Split the base64 string into the MIME type and the base64 encoded data + if (!base64 || typeof base64 !== "string") { + logger.error(`${ + JSON.stringify({ + assistantId: assistantIds?.assistantId, + threadId: assistantIds?.threadId, + context: context, + error: "Expected a base64 string, typeof base64 is not string", + }) + }`); + throw new Error("Expected a base64 string"); + } + const parts = base64.match(regex); + if (!parts || parts.length !== 3) { + logger.error(`${ + JSON.stringify({ + assistantId: assistantIds?.assistantId, + threadId: assistantIds?.threadId, + context: context, + error: `${context} Base64 string is not properly formatted: ${base64}`, + }) + }`); + throw new Error( + `${context} Base64 string is not properly formatted: ${parts}`, + ); + } + const mimeType = parts[1]; // e.g., 'audio/png' or 'video/mp4' or 'audio/mp3' or 'image/png' + const mediaData = parts[2]; + // Convert the base64 encoded data to a binary string + const binaryStr = atob(mediaData); + // Convert the binary string to an array of bytes (Uint8Array) + const length = binaryStr.length; + const arrayBuffer = new Uint8Array(new ArrayBuffer(length)); + for (let i = 0; i < length; i++) { + arrayBuffer[i] = binaryStr.charCodeAt(i); + } + // Create and return the Blob object + return new Blob([arrayBuffer], { type: mimeType }); +} diff --git a/airtable/actions/createField.ts b/airtable/actions/createField.ts new file mode 100644 index 000000000..80bd4d73f --- /dev/null +++ b/airtable/actions/createField.ts @@ -0,0 +1,102 @@ +import type { AppContext } from "../mod.ts"; +import type { CreateFieldBody, Field } from "../utils/types.ts"; + +// Props will be CreateFieldBody plus baseId and tableId +interface Props extends CreateFieldBody { + /** + * @title Base ID + */ + baseId: string; + + /** + * @title Table ID + * @description The ID of the table to add the field to. + */ + tableId: string; +} + +/** + * @name Create_New_Field + * @title Create Airtable Field + * @description Creates multiple records. See Field types for supported field types, the recording format for field options, and other specifications for specific field types. Supported field types have a recording format displayed. + * @see https://airtable.com/developers/web/api/create-field + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { baseId, tableId, name, type, description, options } = props; + + const body: CreateFieldBody = { + name, + type, + }; + if (description) { + body.description = description; + } + if (options) { + body.options = options; + } + + const response = await ctx.client + ["POST /v0/meta/bases/:baseId/tables/:tableId/fields"]( + { baseId, tableId }, + { body }, + ); + + if (!response.ok) { + const errorData = await response.json().catch(() => ({})) as { + error?: { type?: string }; + }; + + if ( + response.status === 422 && + errorData.error?.type === "DUPLICATE_OR_EMPTY_FIELD_NAME" + ) { + return new Response( + JSON.stringify({ + error: + `Field name "${name}" already exists in this table or is empty. Please choose a different name.`, + type: "DUPLICATE_OR_EMPTY_FIELD_NAME", + }), + { + status: 422, + headers: { "Content-Type": "application/json" }, + }, + ); + } + + return new Response( + JSON.stringify({ + error: `Error creating field: ${response.statusText}`, + status: response.status, + }), + { + status: response.status, + headers: { "Content-Type": "application/json" }, + }, + ); + } + + return response.json(); +}; + +export default action; diff --git a/airtable/actions/createRecords.ts b/airtable/actions/createRecords.ts new file mode 100644 index 000000000..5ed374eb6 --- /dev/null +++ b/airtable/actions/createRecords.ts @@ -0,0 +1,155 @@ +import type { AppContext } from "../mod.ts"; +import type { + AirtableRecord, + CreateRecordsBody, + FieldSet, +} from "../utils/types.ts"; + +interface RecordToCreate { + fields: FieldSet; + typecast?: boolean; +} + +interface Props { + /** + * @title Base ID + * @description The ID of the Airtable base + */ + baseId: string; + + /** + * @title Table ID + * @description The ID of the table within the base + */ + tableId: string; + + /** + * @title Records to Create + * @description An array of records to create. Each record must have a fields object. + */ + records: RecordToCreate[]; + + /** + * @title Typecast + * @description Optional. If true, Airtable will attempt to convert cell values to the appropriate type. + */ + typecast?: boolean; +} + +interface ErrorObject { + message: string; + code?: string; +} + +interface ResponsePayload { + data: AirtableRecord[]; + error?: ErrorObject | null; +} + +/** + * @title Create Airtable Records + * @description Creates one or more records in a specified table using OAuth. + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + try { + if (!ctx.client) { + return { + data: [], + error: { message: "OAuth authentication is required" }, + }; + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ( + "hasPermission" in validationResult && !validationResult.hasPermission + ) { + return { + data: [], + error: { + message: validationResult.message || "Access denied", + }, + }; + } + + const { baseId, tableId, records, typecast } = props; + + if (!records || records.length === 0) { + return { + data: [], + error: { message: "At least one record is required" }, + }; + } + + if (records.length > 10) { + return { + data: [], + error: { message: "Maximum 10 records can be created at once" }, + }; + } + + const invalidRecords = records.filter((record) => !record.fields); + if (invalidRecords.length > 0) { + return { + data: [], + error: { message: "All records must have a 'fields' property" }, + }; + } + + // Transform records to the format expected by Airtable API + const requestBody: CreateRecordsBody = { + records: records.map((record) => ({ + fields: record.fields, + ...(record.typecast !== undefined && { typecast: record.typecast }), + })), + }; + + // Apply global typecast if provided + if ( + typecast !== undefined && !records.some((r) => r.typecast !== undefined) + ) { + requestBody.typecast = typecast; + } + + // deno-lint-ignore no-explicit-any + const response = await (ctx.client as any)["POST /v0/:baseId/:tableId"]( + { baseId, tableId }, + { body: requestBody }, + ); + + if (!response.ok) { + const errorText = await response.text(); + return { + data: [], + error: { message: `Error creating records: ${errorText}` }, + }; + } + + const result = await response.json(); + const createdRecords = result.records || []; + + return { + data: createdRecords, + }; + } catch (error) { + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + + return { + data: [], + error: { message: errorMessage }, + }; + } +}; + +export default action; diff --git a/airtable/actions/createTable.ts b/airtable/actions/createTable.ts new file mode 100644 index 000000000..4b381b4b2 --- /dev/null +++ b/airtable/actions/createTable.ts @@ -0,0 +1,165 @@ +import type { AppContext } from "../mod.ts"; +import type { CreateTableBody, Table } from "../utils/types.ts"; +import { mapTableFields } from "../utils/helpers.ts"; + +// Tipos específicos de campo que o Airtable aceita +type AirtableFieldType = + | "singleLineText" + | "email" + | "url" + | "multilineText" + | "number" + | "percent" + | "currency" + | "singleSelect" + | "multipleSelects" + | "singleCollaborator" + | "multipleCollaborators" + | "multipleRecordLinks" + | "date" + | "dateTime" + | "phoneNumber" + | "multipleAttachments" + | "checkbox" + | "formula" + | "createdTime" + | "rollup" + | "count" + | "lookup" + | "createdBy" + | "lastModifiedTime" + | "lastModifiedBy" + | "button"; + +interface TableField { + /** + * @title Field Name + * @description Name of the field (required) + */ + name: string; + + /** + * @title Field Type + * @description Type of the field + * @default "singleLineText" + */ + type: AirtableFieldType; + + /** + * @title Description + * @description Optional description for the field + */ + description?: string; + + /** + * @title Options + * @description Field-specific options (for select fields, etc.) + */ + options?: { + choices?: Array<{ + name: string; + color?: string; + }>; + }; +} + +interface Props { + /** + * @title Base ID + * @description The ID of the base where the table will be created + */ + baseId: string; + + /** + * @title Table Name + * @description Name of the new table + */ + name: string; + + /** + * @title Table Description + * @description Optional description for the new table + */ + description?: string; + + /** + * @title Table Fields + * @description Array of field definitions for the new table. At least one field is required. + * @minItems 1 + */ + fields: TableField[]; +} + +/** + * @name Create_New_Table + * @title Create Airtable Table + * @description Creates a new table within a specified base using OAuth (Metadata API). + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { baseId, name, description, fields } = props; + + if (!name || name.trim() === "") { + throw new Error("Table name is required"); + } + + if (!fields || fields.length === 0) { + throw new Error("At least one field is required"); + } + + const mappedFields = mapTableFields(fields); + + const body: CreateTableBody = { + name: name.trim(), + fields: mappedFields, + }; + + if (description && description.trim() !== "") { + body.description = description.trim(); + } + + const response = await ctx.client["POST /v0/meta/bases/:baseId/tables"]( + { baseId }, + { body }, + ); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`Error creating table: ${errorText}`); + } + + const table = await response.json(); + + await ctx.invoke["airtable"].actions.permissioning.addNewPermitions({ + tables: [ + { + id: table.id, + name: table.name, + baseId: baseId, + }, + ], + }); + + return table; +}; + +export default action; diff --git a/airtable/actions/deleteRecords.ts b/airtable/actions/deleteRecords.ts new file mode 100644 index 000000000..ee80ab83d --- /dev/null +++ b/airtable/actions/deleteRecords.ts @@ -0,0 +1,81 @@ +import type { AppContext } from "../mod.ts"; + +interface Props { + /** + * @title Base ID + * @description The base containing the table with records to delete + */ + baseId: string; + + /** + * @title Table ID + * @description The table containing the records to delete + */ + tableId: string; + + /** + * @title Record IDs to Delete + * @description An array of record IDs to be deleted. Record IDs must start with 'rec'. + */ + recordIds: string[]; +} + +/** + * @title Delete Airtable Records + * @description Deletes one or more records from a specified table using OAuth. + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise<{ records: { id: string; deleted: boolean }[] } | Response> => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { baseId, tableId, recordIds } = props; + + if (!recordIds || recordIds.length === 0) { + return new Response("At least one record ID is required", { status: 400 }); + } + + if (recordIds.length > 10) { + return new Response("Maximum 10 records can be deleted at once", { + status: 400, + }); + } + + const invalidIds = recordIds.filter((id) => !id.startsWith("rec")); + if (invalidIds.length > 0) { + return new Response( + `Invalid record IDs (must start with 'rec'): ${invalidIds.join(", ")}`, + { status: 400 }, + ); + } + + const response = await ctx.client["DELETE /v0/:baseId/:tableId"]( + { baseId, tableId, "records[]": recordIds }, + ); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`Error deleting records: ${errorText}`); + } + + return response.json(); +}; + +export default action; diff --git a/airtable/actions/oauth/callback.ts b/airtable/actions/oauth/callback.ts new file mode 100644 index 000000000..9cefbed5d --- /dev/null +++ b/airtable/actions/oauth/callback.ts @@ -0,0 +1,277 @@ +import type { AppContext } from "../../mod.ts"; +import { OAUTH_URL_TOKEN } from "../../utils/constants.ts"; +import { AirtableBase, PermissionParams } from "../../utils/types.ts"; +import { fetchBasesAndTables } from "../../utils/ui-templates/airtable-client.ts"; +import { generateSelectionPage } from "../../utils/ui-templates/page-generator.ts"; + +function decodePermission(permission: string): PermissionParams { + const permissionData = JSON.parse(atob(permission)); + return permissionData as PermissionParams; +} + +interface OAuthTokenResponse { + access_token: string; + token_type: string; + expires_in?: number; + refresh_token?: string; + scope: string; +} + +export interface Props { + /** + * @title Authorization Code + * @description The authorization code received from Airtable + */ + code: string; + + /** + * @title State + * @description The state parameter returned from authorization (contains code_verifier) + */ + state: string; + + /** + * @title Install ID + * @description Unique identifier for this installation + */ + installId: string; + + /** + * @title Client ID + * @description The OAuth client ID from your Airtable app + */ + clientId: string; + + /** + * @title Client Secret + * @description The OAuth client secret from your Airtable app + * @format password + */ + clientSecret: string; + + /** + * @title Redirect URI + * @description The same redirect URI used in the authorization request + */ + redirectUri: string; + + /** + * @title Query Params + * @description The query parameters from the request + */ + queryParams: Record; +} + +function extractCodeVerifier(state: string): string | null { + try { + const stateData = JSON.parse(atob(state)); + const codeVerifier = stateData.code_verifier || null; + return codeVerifier; + } catch (_error) { + return null; + } +} + +interface StateProvider { + original_state?: string; + code_verifier?: string; +} + +interface State { + appName: string; + installId: string; + invokeApp: string; + returnUrl?: string | null; + redirectUri?: string | null; +} + +function decodeState(state: string): State & StateProvider { + try { + const decoded = atob(decodeURIComponent(state)); + const parsed = JSON.parse(decoded) as State & StateProvider; + + if (parsed.original_state) { + return decodeState(parsed.original_state); + } + + return parsed; + } catch (error) { + console.error("Erro ao decodificar state:", error); + return {} as State & StateProvider; + } +} + +function hasExistingPermissions(permission: unknown): boolean { + if (!permission || typeof permission !== "object" || permission === null) { + return false; + } + return Object.keys(permission as Record).length > 0; +} + +function createPermissionExistsError( + installId: string, + accountName: string | undefined, +) { + return { + installId, + account: accountName, + error: + "Permissions already configured. Cannot overwrite existing permissions.", + }; +} + +/** + * @internal true + * @title OAuth Callback + * @description Exchanges the authorization code for access tokens with PKCE support + */ +export default async function callback( + { + code, + state, + installId, + clientId, + clientSecret, + redirectUri, + queryParams, + }: Props, + req: Request, + ctx: AppContext, +): Promise> { + const { savePermission, continue: continueQueryParam } = queryParams; + + if (!!savePermission || !!continueQueryParam) { + const { permissions } = queryParams; + + const stateData = decodeState(state); + const currentCtx = await ctx.getConfiguration(); + const account = await ctx.invoke.airtable.loaders.whoami({ + accessToken: currentCtx.tokens?.access_token || ctx.tokens?.access_token, + }) + .then((user) => user.email) + .catch((error) => { + console.error("Error getting user:", error); + return undefined; + }) || undefined; + + let accountName = account; + + if (continueQueryParam) { + if (hasExistingPermissions(currentCtx.permission)) { + return createPermissionExistsError(stateData.installId, accountName); + } + + await ctx.configure({ + ...currentCtx, + permission: { + allCurrentAndFutureTableBases: true, + }, + }); + + return { + installId: stateData.installId, + account: accountName, + }; + } + + if (permissions && typeof permissions === "string") { + if (hasExistingPermissions(currentCtx.permission)) { + return createPermissionExistsError(stateData.installId, accountName); + } + const { bases, tables } = decodePermission(permissions); + + await ctx.configure({ + ...currentCtx, + permission: { + bases, + tables, + }, + }); + + accountName = account || + bases.map((base: AirtableBase) => base.name).join(", "); + + return { + installId: stateData.installId, + account: accountName, + }; + } + } + + try { + const uri = redirectUri || new URL("/oauth/callback", req.url).href; + + const codeVerifier = extractCodeVerifier(state); + if (!codeVerifier) { + throw new Error( + "code_verifier not found in state parameter. PKCE is required for Airtable OAuth.", + ); + } + + const credentials = btoa(`${clientId}:${clientSecret}`); + + const tokenRequestBody = new URLSearchParams({ + grant_type: "authorization_code", + code, + redirect_uri: uri, + code_verifier: codeVerifier, + }); + + const response = await fetch(OAUTH_URL_TOKEN, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "application/json", + "Authorization": `Basic ${credentials}`, + }, + body: tokenRequestBody, + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`Token exchange failed: ${response.status} ${errorText}`); + } + + const tokenData = await response.json() as OAuthTokenResponse; + const currentTime = Math.floor(Date.now() / 1000); + + const currentCtx = await ctx.getConfiguration(); + await ctx.configure({ + ...currentCtx, + tokens: { + access_token: tokenData.access_token, + refresh_token: tokenData.refresh_token, + expires_in: tokenData.expires_in, + scope: tokenData.scope, + token_type: tokenData.token_type, + tokenObtainedAt: currentTime, + }, + clientSecret: clientSecret, + clientId: clientId, + }); + + const newURL = req.url; + const data = await fetchBasesAndTables(tokenData); + + const selectionHtml = generateSelectionPage({ + bases: data.bases, + tables: data.tables, + callbackUrl: newURL, + }); + + return new Response(selectionHtml, { + headers: { + "Content-Type": "text/html", + "Content-Security-Policy": + "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline';", + "X-Content-Type-Options": "nosniff", + "X-Frame-Options": "DENY", + }, + }); + } catch (error) { + return { + installId, + error: error instanceof Error ? error.message : "Unknown error", + }; + } +} diff --git a/airtable/actions/permissioning/addNewPermitions.ts b/airtable/actions/permissioning/addNewPermitions.ts new file mode 100644 index 000000000..ade43c0ab --- /dev/null +++ b/airtable/actions/permissioning/addNewPermitions.ts @@ -0,0 +1,103 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { Permission } from "../../utils/types.ts"; + +export interface AddPermissionsRequest { + bases?: Array<{ + id: string; + name: string; + }>; + tables?: Array<{ + id: string; + name: string; + baseId?: string; + }>; +} + +export interface AddPermissionsResponse { + success: boolean; + permission: Permission; + message?: string; +} + +/** + * @internal + * @title Add New Permissions + * @description Adds new bases and tables permissions to the current user context. + */ +const action = ( + props: AddPermissionsRequest, + _req: Request, + ctx: AppContext, +): AddPermissionsResponse => { + try { + const body: AddPermissionsRequest = props; + + if (!body.bases?.length && !body.tables?.length) { + return { + success: false, + permission: ctx.permission || {}, + message: "At least one base or table must be provided", + }; + } + + const currentPermission: Permission = ctx.permission || { + bases: [], + tables: [], + }; + + if (currentPermission.allCurrentAndFutureTableBases) { + return { + success: true, + permission: currentPermission, + message: + "User already has access to all current and future bases and tables", + }; + } + + const existingBaseIds = new Set( + currentPermission.bases?.map((base) => base.id) || [], + ); + const existingTableIds = new Set( + currentPermission.tables?.map((table) => table.id) || [], + ); + + const newBases = (body.bases || []).filter((base) => { + if (!base.id || !base.name) return false; + return !existingBaseIds.has(base.id); + }); + + const newTables = (body.tables || []).filter((table) => { + if (!table.id || !table.name) return false; + return !existingTableIds.has(table.id); + }); + + const updatedPermission: Permission = { + ...currentPermission, + bases: [ + ...(currentPermission.bases || []), + ...newBases, + ], + tables: [ + ...(currentPermission.tables || []), + ...newTables, + ], + }; + + ctx.permission = updatedPermission; + + return { + success: true, + permission: updatedPermission, + message: `Added ${newBases.length} bases and ${newTables.length} tables`, + }; + } catch (error) { + const errorMessage = error instanceof Error + ? error.message + : "Internal server error"; + const errorStatus = error instanceof HttpError ? error.status : 500; + throw new HttpError(errorStatus, errorMessage); + } +}; + +export default action; diff --git a/airtable/actions/updateField.ts b/airtable/actions/updateField.ts new file mode 100644 index 000000000..679bc8b26 --- /dev/null +++ b/airtable/actions/updateField.ts @@ -0,0 +1,109 @@ +import type { AppContext } from "../mod.ts"; +import type { Field, UpdateFieldBody } from "../utils/types.ts"; + +// Props will be UpdateFieldBody plus baseId, tableId, and fieldId +interface Props extends UpdateFieldBody { + /** + * @title Base ID + */ + baseId: string; + + /** + * @title Table ID + */ + tableId: string; + + /** + * @title Field ID + * @description The ID of the field to update. + */ + fieldId: string; +} + +/** + * @title Update Airtable Field + * @description Updates an existing field's properties like name or description using OAuth (Metadata API). + * @see https://airtable.com/developers/web/api/update-field + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { baseId, tableId, fieldId, name, description } = props; + + const body: UpdateFieldBody = {}; + if (name) { + body.name = name; + } + if (description) { + body.description = description; + } + + if (Object.keys(body).length === 0) { + throw new Error( + "No updates provided for the field. Please specify name or description.", + ); + } + + const response = await ctx.client + ["PATCH /v0/meta/bases/:baseId/tables/:tableId/fields/:fieldId"]( + { baseId, tableId, fieldId }, + { body }, + ); + + if (!response.ok) { + const errorData = await response.json().catch(() => ({})) as { + error?: { type?: string }; + }; + + if ( + response.status === 422 && + errorData.error?.type === "DUPLICATE_OR_EMPTY_FIELD_NAME" + ) { + return new Response( + JSON.stringify({ + error: + `Field name "${name}" already exists in this table or is empty. Please choose a different name.`, + type: "DUPLICATE_OR_EMPTY_FIELD_NAME", + }), + { + status: 422, + headers: { "Content-Type": "application/json" }, + }, + ); + } + + return new Response( + JSON.stringify({ + error: `Error updating field: ${response.statusText}`, + status: response.status, + }), + { + status: response.status, + headers: { "Content-Type": "application/json" }, + }, + ); + } + + return response.json(); +}; + +export default action; diff --git a/airtable/actions/updateRecords.ts b/airtable/actions/updateRecords.ts new file mode 100644 index 000000000..6aad2ba43 --- /dev/null +++ b/airtable/actions/updateRecords.ts @@ -0,0 +1,117 @@ +import type { AppContext } from "../mod.ts"; +import type { + AirtableRecord, + FieldSet, + UpdateRecordsBody, +} from "../utils/types.ts"; + +interface RecordToUpdate { + id: string; + fields: FieldSet; +} + +interface Props { + /** + * @title Base ID + * @description The base containing the table with records to update + */ + baseId: string; + + /** + * @title Table ID + * @description The table containing the records to update + */ + tableId: string; + + /** + * @title Records to Update + * @description An array of records to update. Each record must have an ID and a fields object. + */ + records: RecordToUpdate[]; + + /** + * @title Typecast + * @description Optional. If true, Airtable will attempt to convert cell values to the appropriate type. + */ + typecast?: boolean; + + /** + * @title Perform Upsert + * @description Optional. Specifies fields to merge on for an upsert operation. + */ + performUpsert?: { + fieldsToMergeOn: string[]; + }; +} + +/** + * @title Update Airtable Records + * @description Updates one or more records in a specified table using OAuth. + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise<{ records: AirtableRecord[] } | Response> => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { baseId, tableId, records, typecast, performUpsert } = props; + + if (!records || records.length === 0) { + return new Response("At least one record is required", { status: 400 }); + } + + if (records.length > 10) { + return new Response("Maximum 10 records can be updated at once", { + status: 400, + }); + } + + const invalidRecords = records.filter((record) => + !record.id || !record.fields + ); + if (invalidRecords.length > 0) { + return new Response("All records must have 'id' and 'fields' properties", { + status: 400, + }); + } + + const body: UpdateRecordsBody = { + records, + }; + if (typecast !== undefined) { + body.typecast = typecast; + } + if (performUpsert) { + body.performUpsert = performUpsert; + } + + const response = await ctx.client["PATCH /v0/:baseId/:tableId"]( + { baseId, tableId }, + { body }, + ); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`Error updating records: ${errorText}`); + } + + return response.json(); +}; + +export default action; diff --git a/airtable/actions/updateTable.ts b/airtable/actions/updateTable.ts new file mode 100644 index 000000000..0de75553d --- /dev/null +++ b/airtable/actions/updateTable.ts @@ -0,0 +1,87 @@ +import type { AppContext } from "../mod.ts"; +import type { Table, UpdateTableBody } from "../utils/types.ts"; + +interface Props { + /** + * @title Base ID + */ + baseId: string; + + /** + * @title Table ID + * @description The ID of the table to update. + */ + tableId: string; + + /** + * @title New Table Name + * @description Optional. New name for the table. + */ + name?: string; + + /** + * @title New Table Description + * @description Optional. New description for the table. + */ + description?: string; + + /** + * @title New Primary Field ID + * @description Optional. ID of an existing field to be set as the new primary field. + */ + primaryFieldId?: string; +} + +/** + * @title Update Airtable Table + * @description Updates an existing table's name, description, or primary field using OAuth (Metadata API). + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise
=> { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { baseId, tableId, name, description, primaryFieldId } = props; + + const body: UpdateTableBody = {}; + if (name) body.name = name; + if (description) body.description = description; + if (primaryFieldId) body.primaryFieldId = primaryFieldId; + + if (Object.keys(body).length === 0) { + throw new Error( + "No updates provided for the table. Please specify name, description, or primaryFieldId.", + ); + } + + const response = await ctx.client + ["PATCH /v0/meta/bases/:baseId/tables/:tableId"]( + { baseId, tableId }, + { body }, + ); + + if (!response.ok) { + throw new Error(`Error updating table: ${response.statusText}`); + } + + return response.json(); +}; + +export default action; diff --git a/airtable/loaders/getBaseSchema.ts b/airtable/loaders/getBaseSchema.ts new file mode 100644 index 000000000..5e5c7d081 --- /dev/null +++ b/airtable/loaders/getBaseSchema.ts @@ -0,0 +1,80 @@ +import type { AppContext } from "../mod.ts"; +import type { + BaseSchemaResponse, + ValidationFilterResult, + ValidationResult, +} from "../utils/types.ts"; + +interface Props extends Record { + /** + * @title Base ID + * @description The ID of the Airtable base (e.g., appXXXXXXXXXXXXXX). + */ + baseId: string; + + /** + * @title Offset + * @description Pagination offset for listing tables + */ + offset?: string; +} + +/** + * @name Get_Base_Schema + * @title Get Airtable Base Schema + * @description Fetches the schema (tables, fields, etc.) for a specific Airtable base using OAuth. + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const propsValidationResult: ValidationResult = await ctx.invoke["airtable"] + .loaders.permissioning.validatePermissions({ + mode: "filter", + props: props, + }); + + if ("error" in propsValidationResult && propsValidationResult.error) { + return new Response(propsValidationResult.error, { status: 403 }); + } + + const propsFilterResult = propsValidationResult as ValidationFilterResult; + const { baseId, offset } = + (propsFilterResult.filteredProps || props) as Props; + + const params: { baseId: string; offset?: string } = { baseId }; + if (offset) { + params.offset = offset; + } + + const response = await ctx.client["GET /v0/meta/bases/:baseId/tables"]( + params, + ); + + if (!response.ok) { + throw new Error(`Error getting base schema: ${response.statusText}`); + } + + const data = await response.json(); + + const responseValidationResult: ValidationResult = await ctx + .invoke["airtable"].loaders.permissioning.validatePermissions({ + mode: "filter", + response: data, + }); + + if ("error" in responseValidationResult && responseValidationResult.error) { + return new Response(responseValidationResult.error, { status: 403 }); + } + + const responseFilterResult = + responseValidationResult as ValidationFilterResult; + return (responseFilterResult.filteredResponse || data) as BaseSchemaResponse; +}; + +export default loader; diff --git a/airtable/loaders/getRecord.ts b/airtable/loaders/getRecord.ts new file mode 100644 index 000000000..f41868c87 --- /dev/null +++ b/airtable/loaders/getRecord.ts @@ -0,0 +1,62 @@ +import type { AppContext } from "../mod.ts"; +import type { AirtableRecord } from "../utils/types.ts"; + +interface Props extends Record { + /** + * @title Base ID + * @description The ID of the Airtable base (e.g., appXXXXXXXXXXXXXX). + */ + baseId: string; + + /** + * @title Table ID + * @description The ID of the table within the base. + */ + tableId: string; + + /** + * @title Record ID + * @description The ID of the record to retrieve. + */ + recordId: string; +} + +/** + * @name Get_Table_Record + * @title Get Airtable Record + * @description Fetches a specific record from an Airtable table using OAuth. + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const response = await ctx.client["GET /v0/:baseId/:tableId/:recordId"]( + props, + ); + + if (!response.ok) { + throw new Error(`Error getting record: ${response.statusText}`); + } + + return await response.json(); +}; + +export default loader; diff --git a/airtable/loaders/listBases.ts b/airtable/loaders/listBases.ts new file mode 100644 index 000000000..90ea439c6 --- /dev/null +++ b/airtable/loaders/listBases.ts @@ -0,0 +1,56 @@ +import type { AppContext } from "../mod.ts"; +import type { + ListBasesResponse, + ValidationFilterResult, + ValidationResult, +} from "../utils/types.ts"; + +interface Props { + /** + * @title Offset + * @description Pagination offset for listing bases + */ + offset?: string; +} + +/** + * @name List_Bases + * @title List Airtable Bases + * @description Fetches a list of bases accessible with OAuth token. + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { offset } = props; + + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const response = await ctx.client["GET /v0/meta/bases"]( + offset ? { offset: offset } : {}, + ); + + if (!response.ok) { + throw new Error(`Error listing bases: ${response.statusText}`); + } + + const data = await response.json(); + + const validationResult: ValidationResult = await ctx.invoke["airtable"] + .loaders.permissioning.validatePermissions({ + mode: "filter", + response: data, + }); + + if ("error" in validationResult && validationResult.error) { + return new Response(validationResult.error, { status: 403 }); + } + + const filterResult = validationResult as ValidationFilterResult; + return (filterResult.filteredResponse || data) as ListBasesResponse; +}; + +export default loader; diff --git a/airtable/loaders/listRecords.ts b/airtable/loaders/listRecords.ts new file mode 100644 index 000000000..521e9f9b9 --- /dev/null +++ b/airtable/loaders/listRecords.ts @@ -0,0 +1,107 @@ +import type { AppContext } from "../mod.ts"; +import type { + ListRecordsResponse, + ValidationFilterResult, + ValidationResult, +} from "../utils/types.ts"; + +interface Props extends Record { + /** + * @title Base ID + * @description The ID of the Airtable base (e.g., appXXXXXXXXXXXXXX). + */ + baseId: string; + + /** + * @title Table ID + * @description The ID of the table within the base. + * @title Table ID + * @description The ID of the table within the base. + */ + tableId: string; + + /** + * @title Max Records + * @description Maximum number of records to return. + */ + maxRecords?: number; + + /** + * @title Page Size + * @description Number of records per page. + */ + pageSize?: number; + + /** + * @title Offset + * @description Pagination offset for listing records. + */ + offset?: string; + + /** + * @title View + * @description The name or ID of the view to use. + */ + view?: string; + + /** + * @title Filter By Formula + * @description Airtable formula to filter records. + */ + filterByFormula?: string; + + /** + * @title Sort + * @description Array of sort objects to order the records. + */ + sort?: Array<{ + field: string; + direction: "asc" | "desc"; + }>; + + /** + * @title Fields + * @description Array of field names to include in the response. + */ + fields?: string[]; +} + +/** + * @name List_Table_Records + * @title List Airtable Records + * @description Fetches records from a specific table using OAuth with optional filtering and sorting. + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const propsValidationResult: ValidationResult = await ctx.invoke["airtable"] + .loaders.permissioning.validatePermissions({ + mode: "filter", + props: { ...props, tableIdOrName: props.tableId }, + }); + + if ("error" in propsValidationResult && propsValidationResult.error) { + return new Response(propsValidationResult.error, { status: 403 }); + } + + const filterResult = propsValidationResult as ValidationFilterResult; + const validatedProps = (filterResult.filteredProps || props) as Props; + + const response = await ctx.client["GET /v0/:baseId/:tableId"]( + validatedProps, + ); + + if (!response.ok) { + throw new Error(`Error listing records: ${response.statusText}`); + } + + return await response.json(); +}; + +export default loader; diff --git a/airtable/loaders/oauth/start.ts b/airtable/loaders/oauth/start.ts new file mode 100644 index 000000000..6231bbb07 --- /dev/null +++ b/airtable/loaders/oauth/start.ts @@ -0,0 +1,96 @@ +import { OAUTH_SCOPES, OAUTH_URL_AUTH } from "../../utils/constants.ts"; + +export interface Props { + /** + * @title Client ID + * @description The OAuth client ID from your Airtable app + */ + clientId: string; + + /** + * @title Redirect URI + * @description The URI to redirect to after authorization + */ + redirectUri: string; + + /** + * @title State + * @description A random string to prevent CSRF attacks + */ + state: string; + + /** + * @title Code Challenge (optional) + * @description PKCE code challenge for enhanced security. If not provided, one will be generated automatically. + */ + codeChallenge?: string; + + /** + * @title Code Verifier (optional) + * @description PKCE code verifier. If not provided, one will be generated automatically. + */ + codeVerifier?: string; +} + +function generateCodeVerifier(): string { + const array = new Uint8Array(32); + crypto.getRandomValues(array); + return btoa(String.fromCharCode(...array)) + .replace(/\+/g, "-") + .replace(/\//g, "_") + .replace(/=/g, ""); +} + +async function generateCodeChallenge(verifier: string): Promise { + const encoder = new TextEncoder(); + const data = encoder.encode(verifier); + const digest = await crypto.subtle.digest("SHA-256", data); + return btoa(String.fromCharCode(...new Uint8Array(digest))) + .replace(/\+/g, "-") + .replace(/\//g, "_") + .replace(/=/g, ""); +} + +/** + * @name START_OAUTH_FLOW + * @title Start OAuth Flow + * @description Redirects to Airtable's OAuth authorization page with PKCE support + */ +export default async function start(props: Props) { + let codeVerifier = props.codeVerifier; + let codeChallenge = props.codeChallenge; + + if (!codeVerifier) { + codeVerifier = generateCodeVerifier(); + } + + if (!codeChallenge) { + codeChallenge = await generateCodeChallenge(codeVerifier); + } + + let enhancedState: string; + try { + const stateData = JSON.parse(atob(props.state)); + stateData.code_verifier = codeVerifier; + enhancedState = btoa(JSON.stringify(stateData)); + } catch { + enhancedState = btoa(JSON.stringify({ + original_state: props.state, + code_verifier: codeVerifier, + })); + } + + const authParams = new URLSearchParams({ + client_id: props.clientId, + redirect_uri: props.redirectUri, + response_type: "code", + scope: OAUTH_SCOPES.join(" "), + state: enhancedState, + code_challenge: codeChallenge, + code_challenge_method: "S256", + }); + + const authorizationUrl = `${OAUTH_URL_AUTH}?${authParams.toString()}`; + + return Response.redirect(authorizationUrl); +} diff --git a/airtable/loaders/permissioning/listAllowedTablesBases.ts b/airtable/loaders/permissioning/listAllowedTablesBases.ts new file mode 100644 index 000000000..d88467738 --- /dev/null +++ b/airtable/loaders/permissioning/listAllowedTablesBases.ts @@ -0,0 +1,90 @@ +import { AppContext } from "../../mod.ts"; +import { AirtableTable } from "../../utils/types.ts"; + +type BaseWithTables = { + id: string; + name: string; + type: "base"; + tables: Record; +}; + +type LegacyTable = { + id: string; + name: string; + type: "table"; +}; + +type PermissionResult = BaseWithTables | LegacyTable; + +/** + * @name LIST_ALLOWED_TABLES_BASES + * @title Get Allowed Tables and Bases + * @description Fetches the allowed tables and bases for the current user. + */ +const loader = ( + _: unknown, + _req: Request, + ctx: AppContext, +) => { + const { permission } = ctx; + + if (permission?.allCurrentAndFutureTableBases) { + return { + allCurrentAndFutureTableBases: true, + description: "AI can access all current and future table bases", + }; + } + + if (!permission?.bases || !permission?.tables) { + return { permission: {} }; + } + + const basesMap = permission.bases.reduce( + (acc, base) => { + if (base.id) { + acc[base.id] = { + id: base.id, + name: base.name || base.id, + type: "base", + tables: {}, + }; + } + return acc; + }, + {} as Record, + ); + + const permissionWithBases = permission.tables.reduce( + (acc, table) => { + if (table.baseId && basesMap[table.baseId]) { + if (!acc[table.baseId]) { + acc[table.baseId] = { + id: table.baseId, + name: basesMap[table.baseId].name, + type: "base", + tables: {}, + }; + } + (acc[table.baseId] as BaseWithTables).tables[table.id] = { + id: table.id, + name: table.name || table.id, + type: "table", + }; + } else if (!table.baseId) { + acc[table.id] = { + id: table.id, + name: table.name || table.id, + type: "table", + } as LegacyTable; + } + return acc; + }, + {} as Record, + ); + + return { + permission: permissionWithBases, + }; +}; + +export default loader; diff --git a/airtable/loaders/permissioning/validatePermissions.ts b/airtable/loaders/permissioning/validatePermissions.ts new file mode 100644 index 000000000..959764d1f --- /dev/null +++ b/airtable/loaders/permissioning/validatePermissions.ts @@ -0,0 +1,295 @@ +import { AppContext } from "../../mod.ts"; +import { + AllowedTablesBasesResponse, + BaseSchemaResponse, + BaseWithTables, + FilteredOperationResult, + ListBasesResponse, + ListRecordsResponse, + OperationItem, + PermissionCheck, + PermissionResult, + ValidationErrorResult, + ValidationFilterResult, +} from "../../utils/types.ts"; + +type ExtendedValidationResult = + | PermissionCheck + | ValidationFilterResult + | ValidationErrorResult + | FilteredOperationResult + | { error: string }; + +interface ValidatePermissionsProps { + mode: "check" | "filter" | "filter-operations"; + baseId?: string; + tableIdOrName?: string; + props?: Record; + response?: ListBasesResponse | ListRecordsResponse | BaseSchemaResponse; + operations?: OperationItem[]; +} + +/** + * @name VALIDATE_PERMISSIONS + * @internal + * @title Validate User Permissions + * @description Validates if user has permission to access bases/tables or filters data based on permissions. + */ +const loader = async ( + props: ValidatePermissionsProps, + _req: Request, + ctx: AppContext, +): Promise => { + const allowedTablesBases: AllowedTablesBasesResponse = await ctx + .invoke["airtable"].loaders.permissioning.listAllowedTablesBases(); + + if (allowedTablesBases.allCurrentAndFutureTableBases) { + if (props.mode === "check") { + return { + hasPermission: true, + message: "User has access to all current and future bases and tables", + } as PermissionCheck; + } else if (props.mode === "filter") { + return { + filteredProps: props.props, + filteredResponse: props.response, + } as ValidationFilterResult; + } else if (props.mode === "filter-operations") { + return { + allowedOperations: props.operations || [], + deniedOperations: [], + totalRequested: props.operations?.length || 0, + totalAllowed: props.operations?.length || 0, + totalDenied: 0, + } as FilteredOperationResult; + } + } + + if ( + !allowedTablesBases.permission || + Object.keys(allowedTablesBases.permission).length === 0 + ) { + if (props.mode === "check") { + return { hasPermission: true } as PermissionCheck; + } else if (props.mode === "filter") { + return { + filteredProps: props.props, + filteredResponse: props.response, + } as ValidationFilterResult; + } else if (props.mode === "filter-operations") { + return { + allowedOperations: props.operations || [], + deniedOperations: [], + totalRequested: props.operations?.length || 0, + totalAllowed: props.operations?.length || 0, + totalDenied: 0, + } as FilteredOperationResult; + } + } + + if (props.mode === "check") { + return validateSpecificPermission( + allowedTablesBases.permission || {}, + props.baseId, + props.tableIdOrName, + ); + } + + if (props.mode === "filter-operations") { + return filterOperations( + props.operations || [], + allowedTablesBases.permission || {}, + ); + } + + if (props.mode === "filter") { + let filteredProps = props.props; + let filteredResponse = props.response; + + if (props.props) { + const propsResult = filterPropsBasedOnPermissions( + props.props, + allowedTablesBases.permission || {}, + ); + + if (propsResult.error) { + return { + error: propsResult.error, + filteredProps: null, + filteredResponse: null, + } as ValidationErrorResult; + } + + filteredProps = propsResult.props; + } + + if (props.response) { + filteredResponse = filterResponseByPermission( + props.response, + allowedTablesBases.permission || {}, + ); + } + + return { + filteredProps, + filteredResponse, + } as ValidationFilterResult; + } + + return { + error: "Invalid mode. Use 'check', 'filter', or 'filter-operations'", + }; +}; + +function validateSpecificPermission( + permission: Record, + baseId?: string, + tableIdOrName?: string, +): PermissionCheck { + if (baseId) { + const hasBasePermission = permission[baseId]; + + if (!hasBasePermission) { + return { + hasPermission: false, + message: `You don't have permission to access the base ${baseId}`, + }; + } + + if (tableIdOrName && hasBasePermission.type === "base") { + const baseWithTables = hasBasePermission as BaseWithTables; + const hasTablePermission = baseWithTables.tables[tableIdOrName]; + + if (!hasTablePermission) { + return { + hasPermission: false, + message: + `You don't have permission to access the table ${tableIdOrName}`, + }; + } + } + } + + if (tableIdOrName && !baseId) { + const hasTablePermission = permission[tableIdOrName]; + + if (!hasTablePermission) { + return { + hasPermission: false, + message: + `You don't have permission to access the table ${tableIdOrName}`, + }; + } + } + + return { hasPermission: true }; +} + +function filterPropsBasedOnPermissions( + props: Record, + permission: Record, +): { props?: Record; error?: string } { + if (props.baseId) { + const hasBasePermission = permission[props.baseId as string]; + + if (!hasBasePermission) { + return { + error: `You don't have permission to access the base ${props.baseId}`, + }; + } + + if (props.tableIdOrName && hasBasePermission.type === "base") { + const baseWithTables = hasBasePermission as BaseWithTables; + const hasTablePermission = + baseWithTables.tables[props.tableIdOrName as string]; + + if (!hasTablePermission) { + return { + error: + `You don't have permission to access the table ${props.tableIdOrName}`, + }; + } + } + } + + if (props.tableIdOrName && !props.baseId) { + const hasTablePermission = permission[props.tableIdOrName as string]; + + if (!hasTablePermission) { + return { + error: + `You don't have permission to access the table ${props.tableIdOrName}`, + }; + } + } + + return { props }; +} + +function filterResponseByPermission( + response: ListBasesResponse | ListRecordsResponse | BaseSchemaResponse, + permission: Record, +): ListBasesResponse | ListRecordsResponse | BaseSchemaResponse { + const isBase = "bases" in response; + const isRecord = "records" in response; + const isTable = "tables" in response; + + if (isBase) { + const filteredBases = response.bases.filter((base) => permission[base.id]); + return { ...response, bases: filteredBases }; + } else if (isRecord) { + return response; + } else if (isTable) { + const filteredTables = response.tables.filter((table) => + permission[table.id] + ); + return { ...response, tables: filteredTables }; + } + + return response; +} + +function filterOperations( + operations: OperationItem[], + permission: Record, +): FilteredOperationResult { + const allowedOperations: OperationItem[] = []; + const deniedOperations: OperationItem[] = []; + + for (const operation of operations) { + let hasPermission = false; + + const basePermission = permission[operation.baseId]; + if (basePermission) { + if (!operation.tableId && !operation.tableIdOrName) { + hasPermission = true; + } else { + const tableIdentifier = operation.tableId || operation.tableIdOrName; + if (tableIdentifier) { + if (basePermission.type === "base") { + const baseWithTables = basePermission as BaseWithTables; + hasPermission = !!baseWithTables.tables[tableIdentifier]; + } else { + hasPermission = permission[tableIdentifier] !== undefined; + } + } + } + } + + if (hasPermission) { + allowedOperations.push(operation); + } else { + deniedOperations.push(operation); + } + } + + return { + allowedOperations, + deniedOperations, + totalRequested: operations.length, + totalAllowed: allowedOperations.length, + totalDenied: deniedOperations.length, + }; +} + +export default loader; diff --git a/airtable/loaders/searchRecords.ts b/airtable/loaders/searchRecords.ts new file mode 100644 index 000000000..2dea3e46c --- /dev/null +++ b/airtable/loaders/searchRecords.ts @@ -0,0 +1,121 @@ +import type { AppContext } from "../mod.ts"; +import type { ListRecordsResponse } from "../utils/types.ts"; + +interface Props extends Record { + /** + * @title Base ID + * @description The ID of the Airtable base (e.g., appXXXXXXXXXXXXXX). + */ + baseId: string; + + /** + * @title Table ID + * @description The ID of the table within the base. + */ + tableId: string; + + /** + * @title Search Term + * @description The term to search for in the specified fields. + */ + searchTerm: string; + + /** + * @title Search Fields + * @description Array of field names to search in. If not provided, searches in all fields. + */ + searchFields?: string[]; + + /** + * @title Max Records + * @description Maximum number of records to return. + */ + maxRecords?: number; + + /** + * @title Page Size + * @description Number of records per page. + */ + pageSize?: number; + + /** + * @title Offset + * @description Pagination offset for listing records. + */ + offset?: string; + + /** + * @title View + * @description The name or ID of the view to use. + */ + view?: string; + + /** + * @title Sort + * @description Array of sort objects to order the records. + */ + sort?: Array<{ + field: string; + direction: "asc" | "desc"; + }>; + + // TODO: Add fields to the response + // /** + // * @title Fields + // * @description Array of field names to include in the response. + // */ + // fields?: string[]; +} + +/** + * @name Search_Table_Records + * @title Search Airtable Records + * @description Searches for records in a specific table using OAuth with optional field filtering. + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + return new Response("OAuth authentication is required", { status: 401 }); + } + + const validationResult = await ctx.invoke["airtable"].loaders.permissioning + .validatePermissions({ + mode: "check", + baseId: props.baseId, + tableIdOrName: props.tableId, + }); + + if ("hasPermission" in validationResult && !validationResult.hasPermission) { + return new Response(validationResult.message || "Access denied", { + status: 403, + }); + } + + const { searchTerm, searchFields, ...otherProps } = props; + + let filterByFormula = ""; + if (searchFields && searchFields.length > 0) { + const fieldFormulas = searchFields.map( + (field) => `SEARCH("${searchTerm}", {${field}})`, + ); + filterByFormula = `OR(${fieldFormulas.join(",")})`; + } else { + filterByFormula = `SEARCH("${searchTerm}", {*})`; + } + + const response = await ctx.client["GET /v0/:baseId/:tableId"]({ + ...otherProps, + filterByFormula, + }); + + if (!response.ok) { + throw new Error(`Error searching records: ${response.statusText}`); + } + + return await response.json(); +}; + +export default loader; diff --git a/airtable/loaders/whoami.ts b/airtable/loaders/whoami.ts new file mode 100644 index 000000000..444c8a84d --- /dev/null +++ b/airtable/loaders/whoami.ts @@ -0,0 +1,37 @@ +import { unauthorized } from "@deco/deco"; +import type { AppContext } from "../mod.ts"; +import type { WhoamiResponse } from "../utils/types.ts"; +import { OverrideAuthHeaderProps } from "../../mcp/oauth.ts"; +import { OAUTH_CLIENT_OVERRIDE_AUTH_HEADER_NAME } from "../../mcp/utils/httpClient.ts"; + +/** + * @title Get Current User + * @description Fetches the current user's information. + */ +const loader = async ( + props: OverrideAuthHeaderProps, + _req: Request, + ctx: AppContext, +): Promise => { + if (!ctx.client) { + throw unauthorized({ + message: "OAuth authentication is required", + }); + } + + const opts: RequestInit = {}; + if (props.accessToken) { + opts.headers = new Headers({ + [OAUTH_CLIENT_OVERRIDE_AUTH_HEADER_NAME]: `Bearer ${props.accessToken}`, + }); + } + const response = await ctx.client["GET /v0/meta/whoami"]({}, opts); + + if (!response.ok) { + throw new Error(`Error getting user: ${response.statusText}`); + } + + return response.json(); +}; + +export default loader; diff --git a/airtable/manifest.gen.ts b/airtable/manifest.gen.ts new file mode 100644 index 000000000..06fa652f5 --- /dev/null +++ b/airtable/manifest.gen.ts @@ -0,0 +1,53 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/createField.ts"; +import * as $$$$$$$$$1 from "./actions/createRecords.ts"; +import * as $$$$$$$$$2 from "./actions/createTable.ts"; +import * as $$$$$$$$$3 from "./actions/deleteRecords.ts"; +import * as $$$$$$$$$4 from "./actions/oauth/callback.ts"; +import * as $$$$$$$$$5 from "./actions/permissioning/addNewPermitions.ts"; +import * as $$$$$$$$$6 from "./actions/updateField.ts"; +import * as $$$$$$$$$7 from "./actions/updateRecords.ts"; +import * as $$$$$$$$$8 from "./actions/updateTable.ts"; +import * as $$$0 from "./loaders/getBaseSchema.ts"; +import * as $$$1 from "./loaders/getRecord.ts"; +import * as $$$2 from "./loaders/listBases.ts"; +import * as $$$3 from "./loaders/listRecords.ts"; +import * as $$$4 from "./loaders/oauth/start.ts"; +import * as $$$5 from "./loaders/permissioning/listAllowedTablesBases.ts"; +import * as $$$6 from "./loaders/permissioning/validatePermissions.ts"; +import * as $$$7 from "./loaders/searchRecords.ts"; +import * as $$$8 from "./loaders/whoami.ts"; + +const manifest = { + "loaders": { + "airtable/loaders/getBaseSchema.ts": $$$0, + "airtable/loaders/getRecord.ts": $$$1, + "airtable/loaders/listBases.ts": $$$2, + "airtable/loaders/listRecords.ts": $$$3, + "airtable/loaders/oauth/start.ts": $$$4, + "airtable/loaders/permissioning/listAllowedTablesBases.ts": $$$5, + "airtable/loaders/permissioning/validatePermissions.ts": $$$6, + "airtable/loaders/searchRecords.ts": $$$7, + "airtable/loaders/whoami.ts": $$$8, + }, + "actions": { + "airtable/actions/createField.ts": $$$$$$$$$0, + "airtable/actions/createRecords.ts": $$$$$$$$$1, + "airtable/actions/createTable.ts": $$$$$$$$$2, + "airtable/actions/deleteRecords.ts": $$$$$$$$$3, + "airtable/actions/oauth/callback.ts": $$$$$$$$$4, + "airtable/actions/permissioning/addNewPermitions.ts": $$$$$$$$$5, + "airtable/actions/updateField.ts": $$$$$$$$$6, + "airtable/actions/updateRecords.ts": $$$$$$$$$7, + "airtable/actions/updateTable.ts": $$$$$$$$$8, + }, + "name": "airtable", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/airtable/mod.ts b/airtable/mod.ts new file mode 100644 index 000000000..0059dc263 --- /dev/null +++ b/airtable/mod.ts @@ -0,0 +1,139 @@ +import { createOAuthHttpClient } from "../mcp/utils/httpClient.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import type { FnContext } from "@deco/deco"; +import { McpContext } from "../mcp/context.ts"; +import { + AIRTABLE_API_BASE_URL, + OAUTH_SCOPES, + OAUTH_URL_AUTH, + OAUTH_URL_TOKEN, +} from "./utils/constants.ts"; +import { AirtableClient } from "./utils/client.ts"; +import { + DEFAULT_OAUTH_HEADERS, + OAuthClientOptions, + OAuthClients, + OAuthProvider, + OAuthTokens, +} from "../mcp/oauth.ts"; +import type { Permission } from "./utils/types.ts"; + +export const AirtableProvider: OAuthProvider = { + name: "Airtable", + authUrl: OAUTH_URL_AUTH, + tokenUrl: OAUTH_URL_TOKEN, + scopes: OAUTH_SCOPES, + clientId: "", + clientSecret: "", +}; + +export interface Props { + /** + * @title OAuth Tokens + * @description OAuth tokens for authenticated requests + */ + tokens?: OAuthTokens; + + /** + * @title OAuth Client Secret + * @description OAuth client secret for authentication + */ + clientSecret?: string; + + /** + * @title OAuth Client ID + * @description OAuth client ID for authentication + */ + clientId?: string; + + /** + * @title Permission + * @description Permission to access the Airtable API and selected bases and tables + */ + permission: Permission; +} + +export interface State extends Props { + client: OAuthClients; +} + +export type AppContext = FnContext, Manifest>; + +/** + * @title Airtable + * @appName airtable + * @description Access and manage data from Airtable bases, tables, and records. + * @category Productivity + * @logo https://assets.decocache.com/mcp/e724f447-3b98-46c4-9194-6b79841305a2/Airtable.svg + */ +export default function App( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { tokens, clientId, clientSecret } = props; + + const airtableProvider: OAuthProvider = { + ...AirtableProvider, + clientId: clientId ?? "", + clientSecret: clientSecret ?? "", + }; + const options: OAuthClientOptions = { + headers: DEFAULT_OAUTH_HEADERS, + authClientConfig: { + headers: new Headers({ + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }), + }, + }; + + const client = createOAuthHttpClient({ + provider: airtableProvider, + apiBaseUrl: AIRTABLE_API_BASE_URL, + tokens, + options, + onTokenRefresh: async (newTokens: OAuthTokens) => { + if (ctx) { + await ctx.configure({ + ...ctx, + tokens: newTokens, + }); + } + }, + customRefreshFunction: async (params: { + refresh_token: string; + client_id: string; + client_secret: string; + }) => { + const response = await fetch(OAUTH_URL_TOKEN, { + method: "POST", + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "application/json", + "Authorization": `Basic ${ + btoa(`${params.client_id}:${params.client_secret}`) + }`, + }, + body: new URLSearchParams({ + grant_type: "refresh_token", + refresh_token: params.refresh_token, + client_id: params.client_id, + client_secret: params.client_secret, + }), + }); + + return response.json(); + }, + }); + + const state: State = { + ...props, + client, + }; + + return { + state, + manifest, + }; +} diff --git a/airtable/utils/airtableUtils.ts b/airtable/utils/airtableUtils.ts new file mode 100644 index 000000000..40309d193 --- /dev/null +++ b/airtable/utils/airtableUtils.ts @@ -0,0 +1,94 @@ +import type { FieldSet, ListRecordsOptions } from "./types.ts"; + +/** + * Utility functions for Airtable operations + */ + +/** + * Validates if a record ID follows Airtable's format + */ +export function isValidRecordId(recordId: string): boolean { + return /^rec[a-zA-Z0-9]{14}$/.test(recordId); +} + +/** + * Validates if a base ID follows Airtable's format + */ +export function isValidBaseId(baseId: string): boolean { + return /^app[a-zA-Z0-9]{14}$/.test(baseId); +} + +/** + * Validates if a table ID follows Airtable's format + */ +export function isValidTableId(tableId: string): boolean { + return /^tbl[a-zA-Z0-9]{14}$/.test(tableId); +} + +/** + * Validates if a field ID follows Airtable's format + */ +export function isValidFieldId(fieldId: string): boolean { + return /^fld[a-zA-Z0-9]{14}$/.test(fieldId); +} + +/** + * Builds a filter formula for Airtable API + */ +export function buildFilterFormula(filters: Record): string { + const conditions = Object.entries(filters).map(([field, value]) => { + if (typeof value === "string") { + return `{${field}} = "${value}"`; + } else if (typeof value === "number") { + return `{${field}} = ${value}`; + } else if (typeof value === "boolean") { + return `{${field}} = ${value ? "TRUE" : "FALSE"}`; + } + return `{${field}} = "${String(value)}"`; + }); + + return conditions.length > 1 + ? `AND(${conditions.join(", ")})` + : conditions[0] || ""; +} + +/** + * Sanitizes field names for Airtable API + */ +export function sanitizeFieldName(fieldName: string): string { + return fieldName.trim().replace(/[^\w\s-]/g, ""); +} + +/** + * Validates field set data + */ +export function validateFieldSet(fields: FieldSet): boolean { + return typeof fields === "object" && fields !== null && + !Array.isArray(fields); +} + +/** + * Builds sort parameters for list records options + */ +export function buildSortParams( + sortField: string, + direction: "asc" | "desc" = "asc", +): ListRecordsOptions["sort"] { + return [{ field: sortField, direction }]; +} + +/** + * Extracts record ID from Airtable URL + */ +export function extractRecordIdFromUrl(url: string): string | null { + const match = url.match(/rec[a-zA-Z0-9]{14}/); + return match ? match[0] : null; +} + +/** + * Extracts base ID from Airtable URL + */ +export function extractBaseIdFromUrl(url: string): string | null { + const match = url.match(/app[a-zA-Z0-9]{14}/); + return match ? match[0] : null; +} diff --git a/airtable/utils/client.ts b/airtable/utils/client.ts new file mode 100644 index 000000000..c8c202f3d --- /dev/null +++ b/airtable/utils/client.ts @@ -0,0 +1,159 @@ +import type { + AirtableRecord, + BaseSchemaResponse, + CreateFieldBody, + CreateRecordBody, + CreateRecordsBody, + CreateTableBody, + Field, + ListBasesResponse, + ListRecordsOptions, + ListRecordsResponse, + Table, + UpdateFieldBody, + UpdateRecordsBody, + UpdateTableBody, + WhoamiResponse, +} from "./types.ts"; + +// Type helper to allow both single and batch record creation +type CreateRecordPayload = CreateRecordBody | CreateRecordsBody; +type CreateRecordResponse = AirtableRecord | { records: AirtableRecord[] }; + +export interface AirtableClient { + /** + * Get current user + * @see https://airtable.com/developers/web/api/get-user-id-scopes + */ + "GET /v0/meta/whoami": { + response: WhoamiResponse; + }; + + /** + * List bases + * @see https://airtable.com/developers/web/api/list-bases + */ + "GET /v0/meta/bases": { + response: ListBasesResponse; + searchParams?: { offset?: string }; + }; + + /** + * Get base schema + * @see https://airtable.com/developers/web/api/get-base-schema + */ + "GET /v0/meta/bases/:baseId/tables": { + response: BaseSchemaResponse; + searchParams?: { offset?: string }; + }; + + /** + * List records + * @see https://airtable.com/developers/web/api/list-records + */ + "GET /v0/:baseId/:tableId": { + response: ListRecordsResponse; + searchParams?: ListRecordsOptions; + }; + + /** + * Retrieve a record + * @see https://airtable.com/developers/web/api/get-record + */ + "GET /v0/:baseId/:tableId/:recordId": { + response: AirtableRecord; + }; + + /** + * Create records + * NOTE: Airtable API allows creating multiple records (up to 10). This can accept both single and batch creation. + * @see https://airtable.com/developers/web/api/create-records + */ + "POST /v0/:baseId/:tableId": { + body: CreateRecordPayload; // Single or multiple records + response: CreateRecordResponse; + }; + + /** + * Update records + * @see https://airtable.com/developers/web/api/update-records + */ + "PATCH /v0/:baseId/:tableId": { + body: UpdateRecordsBody; // { records: Array<{ id: string; fields: FieldSet }>, typecast?: boolean, performUpsert?: ... } + response: { records: AirtableRecord[] }; // API returns the updated records + }; + + /** + * Delete records + * @see https://airtable.com/developers/web/api/delete-records + */ + "DELETE /v0/:baseId/:tableId": { + searchParams: { "records[]": string[] }; // records[]=recXXXXX&records[]=recYYYYY + response: { records: Array<{ id: string; deleted: boolean }> }; + }; + + /** + * Create table + * @see https://airtable.com/developers/web/api/create-table (Metadata API) + */ + "POST /v0/meta/bases/:baseId/tables": { + body: CreateTableBody; // { name: string, description?: string, fields: Field[], primaryFieldId?: string } + response: Table; + }; + + /** + * Update table + * @see https://airtable.com/developers/web/api/update-table (Metadata API) + */ + "PATCH /v0/meta/bases/:baseId/tables/:tableId": { + body: UpdateTableBody; // { name?: string, description?: string, primaryFieldId?: string } + response: Table; + }; + + /** + * Create field + * Part of Airtable Metadata API. + */ + "POST /v0/meta/bases/:baseId/tables/:tableId/fields": { + body: CreateFieldBody; // Omit + response: Field; // Returns the full Field object with id + }; + + /** + * Update field + * Part of Airtable Metadata API. + */ + "PATCH /v0/meta/bases/:baseId/tables/:tableId/fields/:fieldId": { + body: UpdateFieldBody; // { name?: string, description?: string } + response: Field; // Returns the full Field object + }; + + /** + * Create base + * @see https://airtable.com/developers/web/api/create-base + */ + "POST /v0/meta/bases": { + body: { + name: string; + workspaceId: string; + tables: Array<{ + name: string; + description?: string; + fields: Array<{ + name: string; + type: string; + description?: string; + options?: { + choices?: Array<{ + name: string; + color?: string; + }>; + color?: string; + icon?: string; + }; + }>; + }>; + }; + response: { id: string; tables: Table[] }; + }; +} diff --git a/airtable/utils/constants.ts b/airtable/utils/constants.ts new file mode 100644 index 000000000..56e5a990e --- /dev/null +++ b/airtable/utils/constants.ts @@ -0,0 +1,54 @@ +/** + * Airtable API Constants + */ + +export const AIRTABLE_API_BASE_URL = "https://api.airtable.com"; +export const AIRTABLE_API_VERSION = "v0"; + +/** + * API Endpoints + */ +export const ENDPOINTS = { + BASES: "/v0/meta/bases", + BASE_SCHEMA: "/v0/meta/bases/:baseId/tables", + RECORDS: "/v0/:baseId/:tableIdOrName", + RECORD: "/v0/:baseId/:tableIdOrName/:recordId", + TABLES: "/v0/meta/bases/:baseId/tables", + TABLE: "/v0/meta/bases/:baseId/tables/:tableId", + FIELDS: "/v0/meta/bases/:baseId/tables/:tableId/fields", + FIELD: "/v0/meta/bases/:baseId/tables/:tableId/fields/:fieldId", +} as const; + +/** + * Default headers for Airtable API requests + */ +export const DEFAULT_HEADERS = { + "Content-Type": "application/json", +} as const; + +/** + * Maximum records per request + */ +export const MAX_RECORDS_PER_REQUEST = 100; + +/** + * Maximum records for batch operations + */ +export const MAX_BATCH_RECORDS = 10; + +/** + * OAuth Configuration + */ +export const OAUTH_SCOPES = [ + "data.records:read", + "data.records:write", + "schema.bases:read", + "schema.bases:write", + "user.email:read", + "data.recordComments:read", + "data.recordComments:write", +]; + +export const OAUTH_URL = "https://airtable.com/oauth2/v1"; +export const OAUTH_URL_AUTH = "https://airtable.com/oauth2/v1/authorize"; +export const OAUTH_URL_TOKEN = "https://airtable.com/oauth2/v1/token"; diff --git a/airtable/utils/helpers.ts b/airtable/utils/helpers.ts new file mode 100644 index 000000000..278cf7879 --- /dev/null +++ b/airtable/utils/helpers.ts @@ -0,0 +1,157 @@ +import type { + FieldSet, + ListRecordsOptions, + PermissionParams, +} from "./types.ts"; + +/** + * Utility functions for Airtable operations + */ + +/** + * Validates if a record ID follows Airtable's format + */ +export function isValidRecordId(recordId: string): boolean { + return /^rec[a-zA-Z0-9]{14}$/.test(recordId); +} + +/** + * Validates if a base ID follows Airtable's format + */ +export function isValidBaseId(baseId: string): boolean { + return /^app[a-zA-Z0-9]{14}$/.test(baseId); +} + +/** + * Validates if a table ID follows Airtable's format + */ +export function isValidTableId(tableId: string): boolean { + return /^tbl[a-zA-Z0-9]{14}$/.test(tableId); +} + +/** + * Validates if a field ID follows Airtable's format + */ +export function isValidFieldId(fieldId: string): boolean { + return /^fld[a-zA-Z0-9]{14}$/.test(fieldId); +} + +/** + * Builds a filter formula for Airtable API + */ +export function buildFilterFormula(filters: Record): string { + const conditions = Object.entries(filters).map(([field, value]) => { + if (typeof value === "string") { + return `{${field}} = "${value}"`; + } else if (typeof value === "number") { + return `{${field}} = ${value}`; + } else if (typeof value === "boolean") { + return `{${field}} = ${value ? "TRUE" : "FALSE"}`; + } + return `{${field}} = "${String(value)}"`; + }); + + return conditions.length > 1 + ? `AND(${conditions.join(", ")})` + : conditions[0] || ""; +} + +/** + * Sanitizes field names for Airtable API + */ +export function sanitizeFieldName(fieldName: string): string { + return fieldName.trim().replace(/[^\w\s-]/g, ""); +} + +/** + * Validates field set data + */ +export function validateFieldSet(fields: FieldSet): boolean { + return typeof fields === "object" && fields !== null && + !Array.isArray(fields); +} + +/** + * Builds sort parameters for list records options + */ +export function buildSortParams( + sortField: string, + direction: "asc" | "desc" = "asc", +): ListRecordsOptions["sort"] { + return [{ field: sortField, direction }]; +} + +/** + * Extracts record ID from Airtable URL + */ +export function extractRecordIdFromUrl(url: string): string | null { + const match = url.match(/rec[a-zA-Z0-9]{14}/); + return match ? match[0] : null; +} + +/** + * Extracts base ID from Airtable URL + */ +export function extractBaseIdFromUrl(url: string): string | null { + const match = url.match(/app[a-zA-Z0-9]{14}/); + return match ? match[0] : null; +} + +/** + * Maps table fields to the format expected by Airtable API + */ +export function mapTableFields( + fields: Array<{ + name: string; + type: string; + description?: string; + options?: { + choices?: Array<{ + name: string; + color?: string; + }>; + }; + }>, +): Array<{ + name: string; + type: string; + description?: string; + options?: { + choices?: Array<{ + name: string; + color?: string; + }>; + }; +}> { + return fields.map((field) => { + const mappedField: { + name: string; + type: string; + description?: string; + options?: { + choices?: Array<{ + name: string; + color?: string; + }>; + }; + } = { + name: field.name, + type: field.type, + }; + + if (field.description) { + mappedField.description = field.description; + } + + if (field.options) { + mappedField.options = field.options; + } + + return mappedField; + }); +} + +export const decodePermission = (permission: string): PermissionParams => { + const permissionData = JSON.parse(atob(permission)); + return permissionData as PermissionParams; +}; diff --git a/airtable/utils/types.ts b/airtable/utils/types.ts new file mode 100644 index 000000000..7b246ace8 --- /dev/null +++ b/airtable/utils/types.ts @@ -0,0 +1,235 @@ +export interface FieldSet { + [key: string]: unknown; // Fields can be of various types +} + +export interface AirtableRecord { + id: string; + createdTime?: string; // Optional, as it's not in all responses like listRecords minimal + fields: FieldSet; +} + +// Based on IAirtableService and common Airtable field structure +export interface Field { + id?: string; // Present when returned, optional or omitted when creating + name: string; + type: string; // e.g., 'singleLineText', 'multipleSelects', 'number', 'formula' + description?: string; + options?: unknown; // For specific field types like 'select' or 'multipleSelects' +} + +// Based on IAirtableService and common Airtable table structure +export interface Table { + id: string; + name: string; + fields: Field[]; + primaryFieldId?: string; + description?: string; + views?: Array<{ + id: string; + name: string; + type: string; // e.g., 'grid', 'calendar', 'kanban' + }>; +} + +// Based on IAirtableService for listBases +export interface ListBasesResponse { + bases: Array<{ + id: string; + name: string; + permissionLevel: string; + }>; + offset?: string; +} + +// Based on IAirtableService for getBaseSchema +export interface BaseSchemaResponse { + tables: Table[]; + offset?: string; +} + +// Based on IAirtableService and AirtableService ListRecordsOptions +export interface ListRecordsOptions { + fields?: string[]; + filterByFormula?: string; + maxRecords?: number; + pageSize?: number; + sort?: Array<{ + field: string; + direction?: "asc" | "desc"; + }>; + view?: string; + cellFormat?: "json" | "string"; + timeZone?: string; + userLocale?: string; + offset?: string; + returnFieldsByFieldId?: boolean; +} + +export interface ListRecordsResponse { + records: AirtableRecord[]; + offset?: string; +} + +export interface CreateRecordBody { + fields: FieldSet; + typecast?: boolean; +} + +export interface CreateRecordsBody { + records: Array<{ fields: FieldSet; typecast?: boolean }>; + typecast?: boolean; +} + +export interface UpdateRecordsBody { + records: Array<{ id: string; fields: FieldSet }>; + typecast?: boolean; + performUpsert?: { + fieldsToMergeOn: string[]; + }; +} + +// For creating a table +export interface CreateTableBody { + name: string; + description?: string; + fields: Field[]; + primaryFieldId?: string; +} + +export interface UpdateTableBody { + name?: string; + description?: string; + primaryFieldId?: string; +} + +export type CreateFieldBody = Omit; + +export interface UpdateFieldBody { + name?: string; + description?: string; +} + +export interface Permission { + /** + * @title All Bases + * @description Whether AI can access all bases + */ + allCurrentAndFutureTableBases?: boolean; + + /** + * @title Bases + * @description Array of selected base IDs that AI can access + */ + bases?: AirtableBase[]; + + /** + * @title Tables + * @description Array of selected table IDs that AI can access + */ + tables?: AirtableTable[]; +} + +export interface PermissionParams { + bases: AirtableBase[]; + tables: AirtableTable[]; + timestamp: string; +} + +export interface AirtableBase { + id: string; + name?: string; +} + +export interface AirtableTable { + id: string; + name?: string; + baseId?: string; + records?: AirtableRecordPermission[]; +} + +export interface AirtableRecordPermission { + id: string; + name?: string; +} + +export interface WhoamiResponse { + id: string; + email?: string; + scopes?: string[]; +} + +export interface PermissionCheck { + hasPermission: boolean; + message?: string; +} + +export interface ValidationFilterResult { + filteredProps?: Record; + filteredResponse?: + | ListBasesResponse + | ListRecordsResponse + | BaseSchemaResponse; + error?: string; +} + +export interface ValidationErrorResult { + error: string; + filteredProps: null; + filteredResponse: null; +} + +export type ValidationResult = + | PermissionCheck + | ValidationFilterResult + | ValidationErrorResult + | FilteredOperationResult + | { error: string }; + +export interface BaseWithTables { + id: string; + name: string; + type: "base"; + tables: Record; +} + +export interface TablePermission { + id: string; + name: string; + type: "table"; +} + +export interface LegacyTablePermission { + id: string; + name: string; + type: "table"; +} + +export type PermissionResult = BaseWithTables | LegacyTablePermission; + +export interface AllowedTablesBasesResponse { + allCurrentAndFutureTableBases?: boolean; + description?: string; + permission?: Record; +} + +export interface OperationItem { + baseId: string; + tableId?: string; + tableIdOrName?: string; + [key: string]: unknown; +} + +export interface FilteredOperationResult { + allowedOperations: OperationItem[]; + deniedOperations: OperationItem[]; + totalRequested: number; + totalAllowed: number; + totalDenied: number; +} + +export interface PartialOperationResult { + success: boolean; + results: T[]; + filtered: FilteredOperationResult; + message: string; +} diff --git a/airtable/utils/ui-templates/airtable-client.ts b/airtable/utils/ui-templates/airtable-client.ts new file mode 100644 index 000000000..6da37952c --- /dev/null +++ b/airtable/utils/ui-templates/airtable-client.ts @@ -0,0 +1,131 @@ +import { OAuthTokens } from "../../../mcp/oauth.ts"; +import { AIRTABLE_API_BASE_URL } from "../constants.ts"; +import { AirtableBase, AirtableTable } from "./page-generator.ts"; + +export interface AirtableMetaResponse { + bases: Array<{ + id: string; + name: string; + permissionLevel: string; + }>; +} + +export interface AirtableBaseSchema { + tables: Array<{ + id: string; + name: string; + primaryFieldId: string; + fields: Array<{ + id: string; + name: string; + type: string; + }>; + }>; +} + +export async function fetchUserBases( + tokens: OAuthTokens, +): Promise { + try { + if (!tokens || !tokens.access_token) { + throw new Error("Token de acesso inválido"); + } + + const response = await fetch(`${AIRTABLE_API_BASE_URL}/v0/meta/bases`, { + headers: { + "Authorization": `Bearer ${tokens.access_token}`, + "Accept": "application/json", + }, + }); + + if (!response.ok) { + throw new Error( + `Error fetching bases: ${response.status} ${response.statusText}`, + ); + } + + const data: AirtableMetaResponse = await response.json(); + + return data.bases.map((base) => ({ + id: base.id, + name: base.name, + })); + } catch (error) { + console.error("Error fetching bases from Airtable:", error); + return []; + } +} + +export async function fetchBaseTables( + baseId: string, + tokens: OAuthTokens, +): Promise { + try { + if (!baseId || !tokens || !tokens.access_token) { + throw new Error("ID da base ou token de acesso inválido"); + } + + const response = await fetch( + `${AIRTABLE_API_BASE_URL}/v0/meta/bases/${baseId}/tables`, + { + headers: { + "Authorization": `Bearer ${tokens.access_token}`, + "Accept": "application/json", + }, + }, + ); + + if (!response.ok) { + throw new Error( + `Error fetching tables for base ${baseId}: ${response.status} ${response.statusText}`, + ); + } + + const data: AirtableBaseSchema = await response.json(); + + return data.tables.map((table) => ({ + id: table.id, + name: table.name, + baseId: baseId, + })); + } catch (error) { + console.error(`Error fetching tables for base ${baseId}:`, error); + return []; + } +} + +export async function fetchBasesAndTables(tokens: OAuthTokens): Promise<{ + bases: AirtableBase[]; + tables: AirtableTable[]; +}> { + try { + if (!tokens || !tokens.access_token) { + throw new Error("Token de acesso inválido"); + } + + const bases = await fetchUserBases(tokens); + const allTables: AirtableTable[] = []; + + if (bases.length === 0) { + return { bases: [], tables: [] }; + } + + const tablePromises = bases.map((base) => fetchBaseTables(base.id, tokens)); + const tablesResults = await Promise.all(tablePromises); + + tablesResults.forEach((tables) => { + allTables.push(...tables); + }); + + return { + bases, + tables: allTables, + }; + } catch (error) { + console.error("Error fetching Airtable data:", error); + return { + bases: [], + tables: [], + }; + } +} diff --git a/airtable/utils/ui-templates/page-generator.ts b/airtable/utils/ui-templates/page-generator.ts new file mode 100644 index 000000000..65b70a476 --- /dev/null +++ b/airtable/utils/ui-templates/page-generator.ts @@ -0,0 +1,1472 @@ +export interface AirtableBase { + id: string; + name: string; + recordCount?: number; +} + +export interface AirtableTable { + id: string; + name: string; + recordCount?: number; + baseId?: string; +} + +export interface SelectionPageOptions { + bases: AirtableBase[]; + tables: AirtableTable[]; + callbackUrl: string; +} + +export function generateSelectionPage( + { bases, tables, callbackUrl }: SelectionPageOptions, +): string { + let htmlTemplate: string; + + try { + htmlTemplate = ` + + + + + + + MCP Connector - Airtable Access + + + + + + + + +`; + } catch (error) { + console.error("Falha ao ler o template HTML:", error); + return generateFallbackPage({ bases, tables, callbackUrl }); + } + + const processedHtml = htmlTemplate + .replace('"{{BASES_DATA}}"', JSON.stringify(bases)) + .replace('"{{TABLES_DATA}}"', JSON.stringify(tables)) + .replace('"{{CALLBACK_URL}}"', JSON.stringify(callbackUrl)); + + return processedHtml; +} + +function generateFallbackPage( + { bases, tables, callbackUrl }: SelectionPageOptions, +): string { + return ` + + + + + MCP Connector - Airtable Access + + + +
+

MCP Connector - Airtable Access

+

Template file not found. Using fallback interface.

+

Found ${bases.length} bases and ${tables.length} tables.

+
+ + +
+
+ +`; +} diff --git a/airtable/utils/ui-templates/selection-page.template.html b/airtable/utils/ui-templates/selection-page.template.html new file mode 100644 index 000000000..7dab66b8d --- /dev/null +++ b/airtable/utils/ui-templates/selection-page.template.html @@ -0,0 +1,1365 @@ + + + + + + + MCP Connector - Airtable Access + + + + + + + + diff --git a/algolia/README.md b/algolia/README.md index c45995ccc..b20a965d8 100644 --- a/algolia/README.md +++ b/algolia/README.md @@ -1,23 +1,7 @@ -

-

- - Algolia - -

-

- -

- - AI Search & Discovery platform - -

-

- Loaders, actions and workflows for adding Agolia search, the leader in globally scalable, secure, digital search and discovery experiences that are ultrafast and reliable, to your deco.cx website. -

- -

+ +Loaders, actions and workflows for adding Agolia search, the leader in globally scalable, secure, digital search and discovery experiences that are ultrafast and reliable, to your deco.cx website. + Algolia is a general purpose indexer. This means you can save any Json document and later retrieve it using the Search API. Although being a simpler solution than competing alternatives like Elastic Search or Solar, setting up an index on Algolia still requires some software engineering, like setting up searchable fields, facet fields and sorting indices. Hopefully, deco.cx introduces canonical types, like Product, ProductGroup, etc. These schemas allow this app to built solutions for common use-cases, like indexing Products for a Product Listing Page. -

# Installation 1. Install via decohub diff --git a/algolia/actions/index/product.ts b/algolia/actions/index/product.ts index ab815f0cc..cb266d05c 100644 --- a/algolia/actions/index/product.ts +++ b/algolia/actions/index/product.ts @@ -1,11 +1,13 @@ import { ApiError } from "npm:@algolia/transporter@4.20.0"; import { Product } from "../../../commerce/types.ts"; import { AppContext } from "../../mod.ts"; -import { Indices, toIndex } from "../../utils/product.ts"; +import { toIndex } from "../../utils/product.ts"; +import { INDEX_NAME } from "../../loaders/product/list.ts"; interface Props { product: Product; action: "DELETE" | "UPSERT"; + indexName?: string; } // deno-lint-ignore no-explicit-any @@ -13,10 +15,8 @@ const isAPIError = (x: any): x is ApiError => typeof x?.status === "number" && x.name === "ApiError"; -const indexName: Indices = "products"; - const action = async (props: Props, _req: Request, ctx: AppContext) => { - const { product, action } = props; + const { indexName = INDEX_NAME, product, action } = props; const { client } = ctx; try { diff --git a/algolia/actions/index/wait.ts b/algolia/actions/index/wait.ts index f1b137a35..31d4a2336 100644 --- a/algolia/actions/index/wait.ts +++ b/algolia/actions/index/wait.ts @@ -1,14 +1,14 @@ +import { INDEX_NAME } from "../../loaders/product/list.ts"; import { AppContext } from "../../mod.ts"; -import { Indices } from "../../utils/product.ts"; interface Props { taskID: number; + indexName?: string; } -const indexName: Indices = "products"; - const action = async (props: Props, _req: Request, ctx: AppContext) => { const { client } = ctx; + const { indexName = INDEX_NAME } = props; await client.initIndex(indexName).waitTask(props.taskID); }; diff --git a/algolia/loaders/client.ts b/algolia/loaders/client.ts new file mode 100644 index 000000000..65cef149b --- /dev/null +++ b/algolia/loaders/client.ts @@ -0,0 +1,14 @@ +import type { AppContext } from "../mod.ts"; +import type { SearchClient } from "https://esm.sh/algoliasearch@4.20.0"; + +export type AlgoliaClient = SearchClient; + +export default function loader( + _props: unknown, + _req: Request, + ctx: AppContext, +): AlgoliaClient { + const { client } = ctx; + + return client; +} diff --git a/algolia/loaders/product/list.ts b/algolia/loaders/product/list.ts index ab081c650..52d6006a1 100644 --- a/algolia/loaders/product/list.ts +++ b/algolia/loaders/product/list.ts @@ -1,4 +1,4 @@ -import { SearchResponse } from "npm:@algolia/client-search"; +import { SearchResponse } from "npm:@algolia/client-search@5.0.0"; import { Product } from "../../../commerce/types.ts"; import { AppContext } from "../../mod.ts"; @@ -23,9 +23,10 @@ interface Props { /** @description Full text search query */ term?: string; + indexName?: string; } -const indexName: Indices = "products"; +export const INDEX_NAME: Indices = "products"; /** * @title Algolia Integration @@ -36,6 +37,7 @@ const loader = async ( ctx: AppContext, ): Promise => { const { client } = ctx; + const { indexName = INDEX_NAME } = props; const { results } = await client.search([{ indexName, @@ -43,14 +45,17 @@ const loader = async ( params: { hitsPerPage: props.hitsPerPage ?? 12, facetFilters: JSON.parse(props.facetFilters ?? "[]"), + clickAnalytics: true, }, }]); - const { hits: products } = results[0] as SearchResponse; + const { hits: products, queryID } = results[0] as SearchResponse< + IndexedProduct + >; return resolveProducts(products, client, { url: req.url, - queryID: undefined, + queryID, indexName, }); }; diff --git a/algolia/loaders/product/listingPage.ts b/algolia/loaders/product/listingPage.ts index 8d28ce5df..23d87f6a9 100644 --- a/algolia/loaders/product/listingPage.ts +++ b/algolia/loaders/product/listingPage.ts @@ -1,4 +1,4 @@ -import { SearchResponse } from "npm:@algolia/client-search"; +import { SearchResponse } from "npm:@algolia/client-search@5.0.0"; import { Filter, ProductListingPage } from "../../../commerce/types.ts"; import { AppContext } from "../../mod.ts"; import { replaceHighlight } from "../../utils/highlight.ts"; @@ -8,11 +8,15 @@ import { resolveProducts, } from "../../utils/product.ts"; -/** @titleBy name */ +/** @titleBy label */ interface Facet { + /** + * @title Facet Name + * @description These are the facet names available at Algolia dashboard > search > index */ name: string; - /** @description Select if the facet is a ProductGroup facet */ - groupFacet?: boolean; + + /** @description Facet label to be rendered on the site UI */ + label: string; } interface Props { @@ -38,6 +42,20 @@ interface Props { /** @description Enable to highlight matched terms */ highlight?: boolean; + + /** @description Hide Unavailable Items */ + hideUnavailable?: boolean; + + /** + * @description ?page search params for the first page + * @default 0 + */ + startingPage?: 0 | 1; + + /** + * @description Index Name + */ + indexName?: string; } const getPageInfo = ( @@ -46,6 +64,7 @@ const getPageInfo = ( nbHits: number, hitsPerPage: number, url: URL, + startingPage: number, ) => { const next = page + 1; const prev = page - 1; @@ -55,11 +74,11 @@ const getPageInfo = ( const previousPage = new URLSearchParams(url.searchParams); if (hasNextPage) { - nextPage.set("page", `${next}`); + nextPage.set("page", `${next + startingPage}`); } if (hasPreviousPage) { - previousPage.set("page", `${prev}`); + previousPage.set("page", `${prev + startingPage}`); } return { @@ -67,32 +86,42 @@ const getPageInfo = ( previousPage: hasPreviousPage ? `?${previousPage}` : undefined, records: nbHits, recordPerPage: hitsPerPage, - currentPage: page, + currentPage: page + startingPage, }; }; -const facet = { - scope: ({ name, groupFacet }: Facet) => - `${groupFacet ? "groupFacets." : "facets."}${name}`, - unscope: (facet: string) => - facet.replace("groupFacets.", "").replace("facets.", ""), -}; - +// Transforms facets and re-orders so they match what's configured on deco admin const transformFacets = ( - facets: Record> = {}, - options: { facetFilters: [string, string[]][]; url: URL }, + facets: Record>, + options: { order: Facet[]; facetFilters: [string, string[]][]; url: URL }, ): Filter[] => { - const { facetFilters, url } = options; + const { facetFilters, url, order } = options; const params = new URLSearchParams(url.searchParams); const filters = Object.fromEntries(facetFilters); + const orderByKey = new Map( + order.map(({ name, label }, index) => [name, { label, index }]), + ); + const entries = Object.entries(facets); - return Object.entries(facets).map(([key, values]) => { + const transformed: Filter[] = new Array(entries.length); + for (let it = 0; it < entries.length; it++) { + const [key, values] = entries[it]; const filter = filters[key] ?? []; + let index: number | undefined = it; + let label: string | undefined = key; + + // Apply sort only when user set facets on deco admin + if (orderByKey.size > 0) { + index = orderByKey.get(key)?.index; + label = orderByKey.get(key)?.label; + } + + if (index === undefined || label === undefined) continue; - return { + transformed[index] = { "@type": "FilterToggle", quantity: 0, - label: facet.unscope(key), + label, key, values: Object.entries(values).map(([value, quantity]) => { const index = filter.findIndex((f) => f === value); @@ -122,17 +151,9 @@ const transformFacets = ( }; }), }; - }); -}; - -const sortFacets = (filters: Filter[], order?: Facet[]) => { - if (!order || order.length === 0) { - return filters; } - return order - .map((o) => filters.find((f) => f.key === facet.scope(o))) - .filter((f): f is Filter => Boolean(f)); + return transformed.filter(Boolean); }; const getIndex = (options: string | null): Indices => { @@ -158,20 +179,28 @@ const loader = async ( ): Promise => { const url = new URL(req.url); const { client } = ctx; - const indexName = getIndex(url.searchParams.get("sort")); + const indexName = props?.indexName ?? getIndex(url.searchParams.get("sort")); + const startingPage = props.startingPage ?? 0; + const pageIndex = Number(url.searchParams.get("page")) || startingPage; const facetFilters: [string, string[]][] = JSON.parse( url.searchParams.get("facetFilters") ?? "[]", ); + if (props.hideUnavailable) { + facetFilters.push(["available", ["true"]]); + } + // Creates a canonical facet representation format // Facets on the same category are grouped by OR and facets on // different categories are split by an AND. e.g.: // // (department:"man" OR department:"woman") AND (brand:"deco") AND (available:"true") - const fFilters = facetFilters.map(([key, values]) => - `(${values.map((value) => `${key}:"${value}"`).join(" OR ")})` - ).join(" AND "); + const fFilters = facetFilters + .map(([key, values]) => + `(${values.map((value) => `${key}:"${value}"`).join(" OR ")})` + ) + .join(" AND "); const { results } = await client.search([ { @@ -182,7 +211,7 @@ const loader = async ( filters: fFilters, facets: [], hitsPerPage: props.hitsPerPage ?? 12, - page: Number(url.searchParams.get("page")) || 0, + page: pageIndex - startingPage, clickAnalytics: true, }, }, @@ -193,7 +222,7 @@ const loader = async ( params: { facetingAfterDistinct: true, facets: (props.facets?.length || 0) > 0 - ? props.facets?.map(facet.scope) + ? props.facets?.map((f) => f.name) : ["*"], hitsPerPage: 0, sortFacetValuesBy: props.sortFacetValuesBy, @@ -202,7 +231,7 @@ const loader = async ( ]); const [ - { hits, page, nbPages, queryID, nbHits, hitsPerPage }, + { hits, page = 0, nbPages = 1, queryID, nbHits = 12, hitsPerPage = 12 }, { facets }, ] = results as SearchResponse[]; @@ -213,8 +242,19 @@ const loader = async ( client, { url, queryID, indexName }, ); - const pageInfo = getPageInfo(page, nbPages, nbHits, hitsPerPage, url); - const filters = transformFacets(facets, { facetFilters, url }); + const pageInfo = getPageInfo( + page, + nbPages, + nbHits, + hitsPerPage, + url, + startingPage, + ); + const filters = transformFacets(facets ?? {}, { + order: props.facets ?? [], + facetFilters, + url, + }); return { "@type": "ProductListingPage", @@ -224,7 +264,7 @@ const loader = async ( itemListElement: [], numberOfItems: 0, }, - filters: sortFacets(filters, props.facets), + filters, products, pageInfo, sortOptions: [ diff --git a/algolia/loaders/product/suggestions.ts b/algolia/loaders/product/suggestions.ts index 4076d7bf1..4d0608c3d 100644 --- a/algolia/loaders/product/suggestions.ts +++ b/algolia/loaders/product/suggestions.ts @@ -1,4 +1,4 @@ -import type { SearchResponse } from "npm:@algolia/client-search"; +import type { SearchResponse } from "npm:@algolia/client-search@5.0.0"; import { Suggestion } from "../../../commerce/types.ts"; import type { AppContext } from "../../mod.ts"; import { replaceHighlight } from "../../utils/highlight.ts"; @@ -16,6 +16,9 @@ interface Props { /** @description Enable to highlight matched terms */ highlight?: boolean; + + /** @description Hide Unavailable Items */ + hideUnavailable?: boolean; } interface IndexedSuggestion { @@ -45,7 +48,7 @@ const productsIndex = "products" satisfies Indices; * @title Algolia Integration */ const loader = async ( - { query, count, highlight }: Props, + { query, count, highlight, hideUnavailable }: Props, req: Request, ctx: AppContext, ): Promise => { @@ -59,7 +62,12 @@ const loader = async ( }, { indexName: productsIndex, - params: { hitsPerPage: count ?? 0, facets: [], clickAnalytics: true }, + params: { + hitsPerPage: count ?? 0, + filters: hideUnavailable ? `available:true` : "", + facets: [], + clickAnalytics: true, + }, query, }, ]); diff --git a/algolia/logo.png b/algolia/logo.png index 0953f6c3c..25734ef10 100644 Binary files a/algolia/logo.png and b/algolia/logo.png differ diff --git a/algolia/manifest.gen.ts b/algolia/manifest.gen.ts index 2d1fc2636..10575358f 100644 --- a/algolia/manifest.gen.ts +++ b/algolia/manifest.gen.ts @@ -2,28 +2,30 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$0 from "./loaders/product/listingPage.ts"; +import * as $$$$$$$$$0 from "./actions/index/product.ts"; +import * as $$$$$$$$$1 from "./actions/index/wait.ts"; +import * as $$$$$$$$$2 from "./actions/setup.ts"; +import * as $$$0 from "./loaders/client.ts"; import * as $$$1 from "./loaders/product/list.ts"; -import * as $$$2 from "./loaders/product/suggestions.ts"; +import * as $$$2 from "./loaders/product/listingPage.ts"; +import * as $$$3 from "./loaders/product/suggestions.ts"; import * as $$$$$$0 from "./sections/Analytics/Algolia.tsx"; -import * as $$$$$$$$$0 from "./actions/setup.ts"; -import * as $$$$$$$$$1 from "./actions/index/product.ts"; -import * as $$$$$$$$$2 from "./actions/index/wait.ts"; import * as $$$$$$$$$$0 from "./workflows/index/product.ts"; const manifest = { "loaders": { + "algolia/loaders/client.ts": $$$0, "algolia/loaders/product/list.ts": $$$1, - "algolia/loaders/product/listingPage.ts": $$$0, - "algolia/loaders/product/suggestions.ts": $$$2, + "algolia/loaders/product/listingPage.ts": $$$2, + "algolia/loaders/product/suggestions.ts": $$$3, }, "sections": { "algolia/sections/Analytics/Algolia.tsx": $$$$$$0, }, "actions": { - "algolia/actions/index/product.ts": $$$$$$$$$1, - "algolia/actions/index/wait.ts": $$$$$$$$$2, - "algolia/actions/setup.ts": $$$$$$$$$0, + "algolia/actions/index/product.ts": $$$$$$$$$0, + "algolia/actions/index/wait.ts": $$$$$$$$$1, + "algolia/actions/setup.ts": $$$$$$$$$2, }, "workflows": { "algolia/workflows/index/product.ts": $$$$$$$$$$0, diff --git a/algolia/mod.ts b/algolia/mod.ts index 70144c646..e607bcef2 100644 --- a/algolia/mod.ts +++ b/algolia/mod.ts @@ -1,45 +1,48 @@ -import type { App, AppContext as AC } from "deco/mod.ts"; +import algolia from "https://esm.sh/algoliasearch@4.20.0"; import { createFetchRequester } from "npm:@algolia/requester-fetch@4.20.0"; -import algolia from "npm:algoliasearch@4.20.0"; +import { Markdown } from "../decohub/components/Markdown.tsx"; +import { PreviewContainer } from "../utils/preview.tsx"; +import type { Secret } from "../website/loaders/secret.ts"; import manifest, { Manifest } from "./manifest.gen.ts"; - +import { type App, type AppContext as AC } from "@deco/deco"; export type AppContext = AC>; - export interface State { /** * @title Your Algolia App ID * @description https://dashboard.algolia.com/account/api-keys/all */ applicationId: string; - /** - * @title Admin API Key + * @title Search API Key * @description https://dashboard.algolia.com/account/api-keys/all * @format password */ - adminApiKey: string; - + searchApiKey: string; /** - * @title Search API Key + * @title Admin API Key * @description https://dashboard.algolia.com/account/api-keys/all * @format password */ - searchApiKey: string; + adminApiKey: Secret; } - /** - * @title algolia + * @title Algolia + * @description Product search & discovery that increases conversions at scale. + * @category Search + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/algolia/logo.png */ -export default function App( - props: State, -) { +export default function App(props: State) { const { applicationId, adminApiKey, searchApiKey } = props; - const client = algolia.default(applicationId, adminApiKey, { + if (!adminApiKey) { + throw new Error("Missing admin API key"); + } + const stringAdminApiKey = typeof adminApiKey === "string" + ? adminApiKey + : adminApiKey?.get?.() ?? ""; + const client = algolia(applicationId, stringAdminApiKey, { requester: createFetchRequester(), // Fetch makes it perform mutch better }); - const state = { client, applicationId, searchApiKey }; - const app: App = { manifest: { ...manifest, @@ -49,7 +52,7 @@ export default function App( ...manifest.actions["algolia/actions/setup.ts"], default: (p, req, ctx) => manifest.actions["algolia/actions/setup.ts"].default( - { ...props, ...p }, + { applicationId, adminApiKey: stringAdminApiKey, ...p }, req, ctx, ), @@ -58,6 +61,28 @@ export default function App( }, state, }; - return app; } +export const preview = async () => { + const markdownContent = await Markdown( + new URL("./README.md", import.meta.url).href, + ); + return { + Component: PreviewContainer, + props: { + name: "Algolia", + owner: "deco.cx", + description: + "Product search & discovery that increases conversions at scale.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/algolia/logo.png", + images: [], + tabs: [ + { + title: "About", + content: markdownContent(), + }, + ], + }, + }; +}; diff --git a/algolia/sections/Analytics/Algolia.tsx b/algolia/sections/Analytics/Algolia.tsx index 78f409fc6..d752c3038 100644 --- a/algolia/sections/Analytics/Algolia.tsx +++ b/algolia/sections/Analytics/Algolia.tsx @@ -1,4 +1,3 @@ -import { SectionProps } from "deco/blocks/section.ts"; import insights from "npm:search-insights@2.9.0"; import { AddToCartEvent, @@ -6,24 +5,25 @@ import { ViewItemEvent, ViewItemListEvent, } from "../../../commerce/types.ts"; -import { scriptAsDataURI } from "../../../utils/dataURI.ts"; import { AppContext } from "../../mod.ts"; - +import { type SectionProps } from "@deco/deco"; +import { useScriptAsDataURI } from "@deco/deco/hooks"; declare global { interface Window { aa: typeof insights.default; } } - const setupAndListen = (appId: string, apiKey: string, version: string) => { function setupScriptTag() { - window.AlgoliaAnalyticsObject = "aa"; - window.aa = window.aa || function () { - // @ts-expect-error monkey patch before initialization - (window.aa.queue = window.aa.queue || []).push(arguments); - }; - window.aa.version = version; - + globalThis.window.AlgoliaAnalyticsObject = "aa"; + globalThis.window.aa = globalThis.window.aa || + function () { + // @ts-expect-error monkey patch before initialization + (globalThis.window.aa.queue = globalThis.window.aa.queue || []).push( + arguments, + ); + }; + globalThis.window.aa.version = version; const script = document.createElement("script"); script.setAttribute("async", ""); script.setAttribute( @@ -32,66 +32,65 @@ const setupAndListen = (appId: string, apiKey: string, version: string) => { ); document.head.appendChild(script); } - + function createUserToken() { + if ( + typeof crypto !== "undefined" && + typeof crypto.randomUUID === "function" + ) { + return crypto.randomUUID(); + } + return (Math.random() * 1e9).toFixed(); + } function setupSession() { - window.aa("init", { appId, apiKey }); - - const userToken = localStorage.getItem("ALGOLIA_TOKEN") || - (Math.random() * 1e6).toFixed(); - localStorage.setItem("ALGOLIA_TOKEN", userToken); - window.aa("setUserToken", userToken); + globalThis.window.aa("init", { appId, apiKey }); + const userToken = localStorage.getItem("ALGOLIA_USER_TOKEN") || + createUserToken(); + localStorage.setItem("ALGOLIA_USER_TOKEN", userToken); + globalThis.window.aa("setUserToken", userToken); } - function setupEventListeners() { function attributesFromURL(href: string) { const url = new URL(href); const queryID = url.searchParams.get("algoliaQueryID"); const indexName = url.searchParams.get("algoliaIndex"); - // Not comming from an algolia search page if (!queryID || !indexName) { return null; } - return { queryID, indexName }; } - // deno-lint-ignore no-explicit-any function isSelectItemEvent(event: any): event is SelectItemEvent { return event.name === "select_item"; } - // deno-lint-ignore no-explicit-any function isAddToCartEvent(event: any): event is AddToCartEvent { return event.name === "add_to_cart"; } - function isViewItem( // deno-lint-ignore no-explicit-any event: any, ): event is ViewItemEvent | ViewItemListEvent { return event.name === "view_item" || event.name === "view_item_list"; } - - type WithID = T & { item_id: string }; - + type WithID = T & { + item_id: string; + }; const hasItemId = (item: T): item is WithID => // deno-lint-ignore no-explicit-any typeof (item as any).item_id === "string"; - - const UNKNOWN = "not-from-algolia"; + const PRODUCTS = "products"; const MAX_BATCH_SIZE = 20; - - window.DECO.events.subscribe((event) => { - if (!event) return; - + globalThis.window.DECO.events.subscribe((event) => { + if (!event) { + return; + } const eventName = event.name; - if (isSelectItemEvent(event)) { const [item] = event.params.items; - if ( - !item || !hasItemId(item) || + !item || + !hasItemId(item) || typeof item.index !== "number" || typeof item.item_url !== "string" ) { @@ -100,11 +99,9 @@ const setupAndListen = (appId: string, apiKey: string, version: string) => { JSON.stringify(event, null, 2), ); } - const attr = attributesFromURL(item.item_url); - if (attr) { - window.aa("clickedObjectIDsAfterSearch", { + globalThis.window.aa("clickedObjectIDsAfterSearch", { eventName, index: attr.indexName, queryID: attr.queryID, @@ -112,67 +109,60 @@ const setupAndListen = (appId: string, apiKey: string, version: string) => { positions: [item.index + 1], }); } else { - window.aa("clickedObjectIDs", { + globalThis.window.aa("clickedObjectIDs", { eventName, + index: PRODUCTS, objectIDs: [item.item_id], - index: UNKNOWN, }); } } - if (isAddToCartEvent(event)) { const [item] = event.params.items; - - const attr = attributesFromURL(window.location.href) || + const attr = attributesFromURL(globalThis.window.location.href) || attributesFromURL(item.item_url || ""); const objectIDs = event.params.items .filter(hasItemId) .map((i) => i.item_id); - if (attr) { - window.aa("convertedObjectIDsAfterSearch", { + globalThis.window.aa("convertedObjectIDsAfterSearch", { eventName, objectIDs, index: attr.indexName, queryID: attr.queryID, }); } else { - window.aa("convertedObjectIDs", { + globalThis.window.aa("convertedObjectIDs", { eventName, + index: PRODUCTS, objectIDs, - index: UNKNOWN, }); } } - if (isViewItem(event)) { const objectIDs = event.params.items .filter(hasItemId) .map((i) => i.item_id); - for (let it = 0; it < objectIDs.length; it += MAX_BATCH_SIZE) { - window.aa("viewedObjectIDs", { + globalThis.window.aa("viewedObjectIDs", { eventName, - index: UNKNOWN, + index: PRODUCTS, objectIDs: objectIDs.slice(it, (it + 1) * MAX_BATCH_SIZE), }); } } }); } - setupScriptTag(); setupSession(); setupEventListeners(); }; - function Analytics( { applicationId, searchApiKey }: SectionProps, ) { return ( `; + const flagsScript = ``; + return dnsPrefetchLink + preconnectLink + plausibleScript + flagsScript; + }; + return ({ src: transformReq }); +}; +export default loader; diff --git a/analytics/loaders/OneDollarScript.ts b/analytics/loaders/OneDollarScript.ts new file mode 100644 index 000000000..52c361f50 --- /dev/null +++ b/analytics/loaders/OneDollarScript.ts @@ -0,0 +1,93 @@ +import { useScriptAsDataURI } from "@deco/deco/hooks"; +import { + DEFAULT_COLLECTOR_ADDRESS, +} from "../../website/components/OneDollarStats.tsx"; +import { Script } from "../../website/types.ts"; +import { type Flag } from "@deco/deco"; +import { DEFAULT_ANALYTICS_SCRIPT_URL } from "../../website/loaders/analyticsScript.ts"; + +export interface Props { + /** + * @description collector address to use + */ + collectorAddress?: string; + /** + * @description static script to use + */ + staticScriptUrl?: string; +} + +const snippet = () => { + const parseCookies = (cookieString: string) => { + const cookies: Record = {}; + cookieString.split(";").forEach((cookie) => { + const [key, value] = cookie.split("=").map((c) => c.trim()); + cookies[key] = value; + }); + return cookies; + }; + const tryOrDefault = (fn: () => R, defaultValue: R) => { + try { + return fn(); + } catch { + return defaultValue; + } + }; + const getFlagsFromCookies = (cookies: Record) => { + const flags: Flag[] = []; + const segment = cookies["deco_segment"] + ? tryOrDefault( + () => JSON.parse(decodeURIComponent(atob(cookies["deco_segment"]))), + {}, + ) + : {}; + segment.active?.forEach((flag: string) => + flags.push({ name: flag, value: true }) + ); + segment.inactiveDrawn?.forEach((flag: string) => + flags.push({ name: flag, value: false }) + ); + return flags; + }; + const _flags = getFlagsFromCookies(parseCookies(document.cookie)); + const flags: Record = {}; + _flags.forEach((flag) => flags[flag.name] = flag.value); + const trackPageview = () => globalThis.window.stonks?.view?.(flags); + // First load + trackPageview(); + // Attach pushState and popState listeners + const originalPushState = history.pushState; + if (originalPushState) { + history.pushState = function () { + // @ts-ignore monkey patch + originalPushState.apply(this, arguments); + trackPageview(); + }; + addEventListener("popstate", trackPageview); + } +}; + +const loader = (props: Props): Script => { + const transformReq = () => { + const collector = props.collectorAddress ?? DEFAULT_COLLECTOR_ADDRESS; + const staticScriptUrl = props.staticScriptUrl ?? + DEFAULT_ANALYTICS_SCRIPT_URL; + const dnsPrefetchLink = ``; + const preconnectLink = + ``; + const trackerScript = ``; + + const script = ``; + return dnsPrefetchLink + preconnectLink + trackerScript + script; + }; + return ({ src: transformReq }); +}; +export default loader; diff --git a/analytics/logo.png b/analytics/logo.png new file mode 100644 index 000000000..a617992e1 Binary files /dev/null and b/analytics/logo.png differ diff --git a/analytics/manifest.gen.ts b/analytics/manifest.gen.ts index f7994288b..a8fd41c25 100644 --- a/analytics/manifest.gen.ts +++ b/analytics/manifest.gen.ts @@ -2,11 +2,17 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$$$$0 from "./sections/Analytics/Plausible.tsx"; +import * as $$$0 from "./loaders/DecoAnalyticsScript.ts"; +import * as $$$1 from "./loaders/OneDollarScript.ts"; +import * as $$$$$$0 from "./sections/Analytics/DecoAnalytics.tsx"; const manifest = { + "loaders": { + "analytics/loaders/DecoAnalyticsScript.ts": $$$0, + "analytics/loaders/OneDollarScript.ts": $$$1, + }, "sections": { - "analytics/sections/Analytics/Plausible.tsx": $$$$$$0, + "analytics/sections/Analytics/DecoAnalytics.tsx": $$$$$$0, }, "name": "analytics", "baseUrl": import.meta.url, diff --git a/analytics/mod.ts b/analytics/mod.ts index d092ed830..24b6df52c 100644 --- a/analytics/mod.ts +++ b/analytics/mod.ts @@ -1,13 +1,30 @@ -import type { App, AppContext as AC } from "deco/mod.ts"; import manifest, { Manifest } from "./manifest.gen.ts"; - +import { PreviewContainer } from "../utils/preview.tsx"; +import { type App, type AppContext as AC } from "@deco/deco"; export type AppContext = AC>; - // deno-lint-ignore no-explicit-any export type State = any; - -export default function App( - state: State, -): App { +/** + * @title Deco Analytics + * @description Measure your site traffic at a glance in a simple and modern web analytics dashboard. + * @category Analytics + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/analytics/logo.png + */ +export default function App(state: State): App { return { manifest, state }; } +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Deco Analytics", + owner: "deco.cx", + description: + "Measure your site traffic at a glance in a simple and modern web analytics dashboard.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/analytics/logo.png", + images: [], + tabs: [], + }, + }; +}; diff --git a/utils/plausible_scripts.ts b/analytics/scripts/plausible_scripts.ts similarity index 55% rename from utils/plausible_scripts.ts rename to analytics/scripts/plausible_scripts.ts index facec462a..c96269fab 100644 --- a/utils/plausible_scripts.ts +++ b/analytics/scripts/plausible_scripts.ts @@ -16,5 +16,9 @@ export const localAndExclusionAndHashScript = '!function(){"use strict";var c=window.location,o=window.document,u=o.currentScript,s=u.getAttribute("data-api")||new URL(u.src).origin+"/api/event";function p(e,t){e&&console.warn("Ignoring Event: "+e),t&&t.callback&&t.callback()}function e(e,t){try{if("true"===window.localStorage.plausible_ignore)return p("localStorage flag",t)}catch(e){}var i=u&&u.getAttribute("data-include"),n=u&&u.getAttribute("data-exclude");if("pageview"===e){i=!i||i.split(",").some(a),n=n&&n.split(",").some(a);if(!i||n)return p("exclusion rule",t)}function a(e){var t=c.pathname;return(t+=c.hash).match(new RegExp("^"+e.trim().replace(/\\*\\*/g,".*").replace(/([^\\.])\\*/g,"$1[^\\\\s/]*")+"/?$"))}var i={},n=(i.n=e,i.u=c.href,i.d=((w,d)=>{const h=w.location.hostname;return h.replace(/^www./,"")})(window,document),i.r=o.referrer||null,t&&t.meta&&(i.m=JSON.stringify(t.meta)),t&&t.props&&(i.p=t.props),u.getAttributeNames().filter(function(e){return"event-"===e.substring(0,6)})),r=i.p||{},l=(n.forEach(function(e){var t=e.replace("event-",""),e=u.getAttribute(e);r[t]=r[t]||e}),i.p=r,i.h=1,new XMLHttpRequest);l.open("POST",s,!0),l.setRequestHeader("Content-Type","text/plain"),l.send(JSON.stringify(i)),l.onreadystatechange=function(){4===l.readyState&&t&&t.callback&&t.callback()}}var t=window.plausible&&window.plausible.q||[];window.plausible=e;for(var i,n=0;n{const h=w.location.hostname;return h.replace(/^www\./,"")})(window,document),n.r=c.referrer||null,t&&t.meta&&(n.m=JSON.stringify(t.meta)),t&&t.props&&(n.p=t.props),s.getAttributeNames().filter(function(e){return"event-"===e.substring(0,6)})),r=n.p||{},o=(i.forEach(function(e){var t=e.replace("event-",""),e=s.getAttribute(e);r[t]=r[t]||e}),n.p=r,n.h=1,new XMLHttpRequest);o.open("POST",u,!0),o.setRequestHeader("Content-Type","text/plain"),o.send(JSON.stringify(n)),o.onreadystatechange=function(){4===o.readyState&&t&&t.callback&&t.callback()}}var t=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n,i=0;i{const h=w.location.hostname;return h.replace(/^www./,"")})(window,document),n.r=c.referrer||null,t&&t.meta&&(n.m=JSON.stringify(t.meta)),t&&t.props&&(n.p=t.props),s.getAttributeNames().filter(function(e){return"event-"===e.substring(0,6)})),r=n.p||{},o=(i.forEach(function(e){var t=e.replace("event-",""),e=s.getAttribute(e);r[t]=r[t]||e}),n.p=r,n.h=1,new XMLHttpRequest);o.open("POST",u,!0),o.setRequestHeader("Content-Type","text/plain"),o.send(JSON.stringify(n)),o.onreadystatechange=function(){4===o.readyState&&t&&t.callback&&t.callback()}}var t=window.plausible&&window.plausible.q||[];window.plausible=e;for(var n,i=0;i; diff --git a/anthropic/actions/code.ts b/anthropic/actions/code.ts new file mode 100644 index 000000000..5c0e88550 --- /dev/null +++ b/anthropic/actions/code.ts @@ -0,0 +1,62 @@ +import { shortcircuit } from "@deco/deco"; +import { AppContext } from "../mod.ts"; +import { Anthropic } from "../deps.ts"; + +export const allowedModels = [ + "claude-3-5-sonnet-20240620", + "claude-3-opus-20240229", + "claude-3-sonnet-20240229", + "claude-3-haiku-20240307", + "claude-2.1", + "claude-2.0", + "claude-instant-1.2", +] as const; + +export interface Props { + /** + * @description The system prompt to be used for the AI Assistant. + */ + system?: string; + /** + * @description The messages to be processed by the AI Assistant. + */ + messages: Anthropic.MessageParam[]; + /** + * @description The model that will complete your prompt. + */ + model?: typeof allowedModels[number]; + /** + * @description The maximum number of tokens to generate. + * + * Different models have different maximum values for this parameter. See + * [models](https://docs.anthropic.com/en/docs/models-overview) for details. + */ + max_tokens?: number; + temperature?: number; +} + +export default async function chat( + { + system, + messages, + model = "claude-3-opus-20240229", + max_tokens = 4096, + temperature = 0.0, + }: Props, + _req: Request, + ctx: AppContext, +) { + if (!messages) { + return shortcircuit(new Response("No messages provided", { status: 400 })); + } + + const msg = await ctx.anthropic.messages.create({ + system, + model, + max_tokens, + messages, + temperature, + }); + + return msg; +} diff --git a/anthropic/actions/invoke.ts b/anthropic/actions/invoke.ts new file mode 100644 index 000000000..57744dade --- /dev/null +++ b/anthropic/actions/invoke.ts @@ -0,0 +1,77 @@ +import { shortcircuit } from "@deco/deco"; +import { AppContext } from "../mod.ts"; +import { Anthropic } from "../deps.ts"; +import { getAppTools } from "../utils.ts"; + +export interface Props { + /** + * @description The system prompt to be used for the AI Assistant. + */ + system?: string; + /** + * @description The messages to be processed by the AI Assistant. + */ + messages: Anthropic.MessageParam[]; + /** + * @description The model that will complete your prompt. + */ + model?: Anthropic.Model; + /** + * @description The maximum number of tokens to generate. + */ + max_tokens?: number; + /** + * @description Optional list of available functions (actions or loaders) that the AI Assistant can perform. + */ + availableFunctions?: string[]; + /** + * @description The tool choice to be used for the AI Assistant. + */ + tool_choice?: Anthropic.MessageCreateParams["tool_choice"]; + temperature: number; +} + +export default async function invoke( + { + system, + messages, + model = "claude-3-5-sonnet-20240620", + max_tokens = 4096, + availableFunctions = [], + tool_choice = { type: "auto" }, + temperature = 0.0, + }: Props, + _req: Request, + ctx: AppContext, +) { + if (!messages) { + return shortcircuit(new Response("No messages provided", { status: 400 })); + } + + const tools = await getAppTools(availableFunctions ?? []); + + const params: Anthropic.MessageCreateParams = { + system, + model, + max_tokens, + messages, + temperature, + }; + + if (tools?.length) { + params.tools = tools; + params.tool_choice = tool_choice; + } + + console.log(tools); + + try { + const msg = await ctx.anthropic.messages.create(params); + return msg; + } catch (error) { + console.error("Error calling Anthropic API:", error); + return shortcircuit( + new Response("Error processing request", { status: 500 }), + ); + } +} diff --git a/anthropic/actions/stream.ts b/anthropic/actions/stream.ts new file mode 100644 index 000000000..d9a1d2f33 --- /dev/null +++ b/anthropic/actions/stream.ts @@ -0,0 +1,89 @@ +import { shortcircuit } from "@deco/deco"; +import { readFromStream } from "@deco/deco/utils"; +import { Anthropic } from "../deps.ts"; +import { AppContext } from "../mod.ts"; +import { getAppTools } from "../utils.ts"; + +export interface Props { + /** + * @description The system prompt to be used for the AI Assistant. + */ + system?: string; + /** + * @description The mode of the AI Assistant. + */ + mode: string; + /** + * @description The messages to be processed by the AI Assistant. + */ + messages: Anthropic.MessageParam[]; + /** + * Optional list of available functions (actions or loaders) that the AI Assistant can perform. + */ + availableFunctions?: string[]; + /** + * @description The model that will complete your prompt. + */ + model?: Anthropic.Model; + /** + * @description The maximum number of tokens to generate. + * + * Different models have different maximum values for this parameter. See + * [models](https://docs.anthropic.com/en/docs/models-overview) for details. + */ + max_tokens?: number; +} + +/** + * @title Anthropic chat streaming + * @description Sends messages to the Anthropic API for processing. + */ +export default async function chat( + { + system, + messages, + availableFunctions, + model = "claude-3-5-sonnet-20240620", + max_tokens = 1024, + }: Props, + _req: Request, + ctx: AppContext, +) { + if (!messages) { + return shortcircuit(new Response("No messages provided", { status: 400 })); + } + + const tools = await getAppTools(availableFunctions ?? []); + + const headers = { + "anthropic-version": "2023-06-01", + "content-type": "application/json", + "x-api-key": ctx.token ?? "", + }; + + const payload: Anthropic.MessageCreateParamsStreaming = { + system, + messages, + model, + max_tokens, + temperature: 0.5, + stream: true, + tools, + tool_choice: { type: "auto" }, + }; + + const response = await fetch("https://api.anthropic.com/v1/messages", { + method: "POST", + headers, + body: JSON.stringify(payload), + }); + + if (!response.ok) { + console.error("Failed to send messages to Anthropic API:", response.text); + return shortcircuit( + new Response(await response.text(), { status: response.status }), + ); + } + + return readFromStream(response); +} diff --git a/anthropic/deps.ts b/anthropic/deps.ts new file mode 100644 index 000000000..c5abca0ca --- /dev/null +++ b/anthropic/deps.ts @@ -0,0 +1 @@ +export { default as Anthropic } from "https://esm.sh/@anthropic-ai/sdk@0.28.0"; diff --git a/anthropic/manifest.gen.ts b/anthropic/manifest.gen.ts new file mode 100644 index 000000000..00473ae22 --- /dev/null +++ b/anthropic/manifest.gen.ts @@ -0,0 +1,21 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/code.ts"; +import * as $$$$$$$$$1 from "./actions/invoke.ts"; +import * as $$$$$$$$$2 from "./actions/stream.ts"; + +const manifest = { + "actions": { + "anthropic/actions/code.ts": $$$$$$$$$0, + "anthropic/actions/invoke.ts": $$$$$$$$$1, + "anthropic/actions/stream.ts": $$$$$$$$$2, + }, + "name": "anthropic", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/anthropic/mod.ts b/anthropic/mod.ts new file mode 100644 index 000000000..aba45f11a --- /dev/null +++ b/anthropic/mod.ts @@ -0,0 +1,35 @@ +import { Secret } from "../website/loaders/secret.ts"; +import { Anthropic } from "./deps.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { type App, type AppContext as AC } from "@deco/deco"; +export interface Props { + /** + * @title Anthropic API Key + */ + apiKey?: Secret; +} +export interface State { + anthropic: Anthropic; + token?: string; +} +/** + * @title Anthropic + * @description Interact with the Anthropic API. + */ +export default function App(state: Props): App { + const getToken = state?.apiKey?.get; + const token = typeof getToken === "function" + ? getToken() ?? undefined + : undefined; + return { + manifest, + state: { + token, + anthropic: new Anthropic({ + apiKey: token, + }), + }, + }; +} +export type AnthropicApp = ReturnType; +export type AppContext = AC; diff --git a/anthropic/utils.ts b/anthropic/utils.ts new file mode 100644 index 000000000..9adb16eb0 --- /dev/null +++ b/anthropic/utils.ts @@ -0,0 +1,92 @@ +import { Context, type JSONSchema7, lazySchemaFor } from "@deco/deco"; + +import { dereferenceJsonSchema } from "../ai-assistants/schema.ts"; +import { Anthropic } from "./deps.ts"; + +const notUndefined = (v: T | undefined): v is T => v !== undefined; + +/** + * Utility object for encoding and decoding file paths. + */ +const pathFormatter = { + /** + * Encodes a file path by removing ".ts" and replacing slashes with "__". + * @param path - The file path to encode. + * @returns The encoded file path. + */ + encode: (path: string): string => + path.replace(/\.ts/g, "").replace(/\//g, "__"), + + /** + * Decodes an encoded file path by replacing "__" with slashes and adding ".ts". + * @param encodedPath - The encoded file path to decode. + * @returns The decoded file path. + */ + decode: (encodedPath: string): string => + encodedPath.replace(/__/g, "/") + ".ts", +}; + +/** + * Retrieves the available tools for the AI Assistant. + * @param availableFunctions List of functions available for the AI Assistant. + * @returns Promise resolving to a list of tools. + */ +export const getAppTools = async ( + availableFunctions: string[], +): Promise => { + const ctx = Context.active(); + const runtime = await ctx.runtime!; + const schemas = await lazySchemaFor(ctx).value; + + const functionKeys = availableFunctions ?? + Object.keys({ + ...runtime.manifest.loaders, + ...runtime.manifest.actions, + }); + + const tools = functionKeys + .map((functionKey) => { + const functionDefinition = btoa(functionKey); + const schema = schemas.definitions[functionDefinition]; + + if ((schema as { ignoreAI?: boolean })?.ignoreAI) { + return undefined; + } + + const propsRef = (schema?.allOf?.[0] as JSONSchema7)?.$ref; + if (!propsRef) { + return undefined; + } + + const dereferenced = dereferenceJsonSchema({ + $ref: propsRef, + ...schemas, + }); + + if ( + dereferenced.type !== "object" || + dereferenced.oneOf || + dereferenced.anyOf || + dereferenced.allOf || + dereferenced.enum || + dereferenced.not + ) { + return undefined; + } + + return { + name: pathFormatter.encode(functionKey), + description: + `Usage for: ${schema?.description}. Example: ${schema?.examples}`, + input_schema: { + ...dereferenced, + definitions: undefined, + root: undefined, + title: undefined, + }, + }; + }) + .filter(notUndefined); + + return tools as Anthropic.Tool[] | undefined; +}; diff --git a/apify/actions/runActor.ts b/apify/actions/runActor.ts new file mode 100644 index 000000000..d13cc72c3 --- /dev/null +++ b/apify/actions/runActor.ts @@ -0,0 +1,75 @@ +import { AppContext } from "../mod.ts"; + +export interface Props { + /** + * @title Actor ID + * @description The ID of the actor to run + */ + actorId: string; + + /** + * @title Input + * @description Input data for the actor run (Stringified JSON object). If you don't know what object to pass, use an empty object: {} + */ + input: string; + + /** + * @title Timeout (seconds) + * @description Maximum timeout for the run in seconds + */ + timeout?: number; + + /** + * @title Memory (MB) + * @description Amount of memory allocated for the run in megabytes + */ + memory?: number; + + /** + * @title Build + * @description Specific build version to use (optional) + */ + build?: string; +} + +/** + * @name RUN_ACTOR + * @title Run Actor + * @description Run an Apify actor synchronously and return dataset items + * @deprecated Use RUN_ACTOR_V2 instead + */ +export default async function runActor( + props: Props, + _req: Request, + ctx: AppContext, +): Promise> | { error: string }> { + try { + const { actorId, input: inputString, timeout, memory, build } = props; + + if (!actorId) { + return { error: "Actor ID is required" }; + } + + const response = await ctx.api + ["POST /v2/acts/:actorId/run-sync-get-dataset-items"]({ + actorId, + timeout, + memory, + build, + }, { + body: JSON.parse(inputString), + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`HTTP ${response.status}: ${errorText}`); + } + + // Este endpoint retorna diretamente os itens do dataset + const result = await response.json(); + return result; + } catch (error) { + console.error("Error running actor:", error); + return ctx.errorHandler.toHttpError(error, "Error running actor"); + } +} diff --git a/apify/actions/runActorAsync.ts b/apify/actions/runActorAsync.ts new file mode 100644 index 000000000..5496549ff --- /dev/null +++ b/apify/actions/runActorAsync.ts @@ -0,0 +1,89 @@ +import { AppContext } from "../mod.ts"; +import { ActorRun } from "../utils/types.ts"; + +export interface Props { + /** + * @title Actor ID + * @description The ID of the actor to run + */ + actorId: string; + + /** + * @title Input + * @description Input data for the actor run (Stringified JSON object). If you don't know what object to pass, use an empty object: {} + */ + input: string; + + /** + * @title Timeout (seconds) + * @description Maximum timeout for the run in seconds + */ + timeout?: number; + + /** + * @title Memory (MB) + * @description Amount of memory allocated for the run in megabytes + */ + memory?: number; + + /** + * @title Build + * @description Specific build version to use (optional) + */ + build?: string; +} + +/** + * @name RUN_ACTOR_ASYNC + * @title Run Actor Async + * @description Run an Apify actor asynchronously and return immediately without waiting for completion + */ +export default async function runActorAsync( + props: Props, + _req: Request, + ctx: AppContext, +): Promise< + { data: ActorRun; error: null } | { + error: string; + data: null; + } +> { + try { + const { actorId, timeout, memory, build } = props; + + if (!actorId) { + return { error: "Actor ID is required", data: null }; + } + + // Build query parameters + const searchParams = new URLSearchParams(); + if (timeout !== undefined) { + searchParams.set("timeout", timeout.toString()); + } + if (memory !== undefined) { + searchParams.set("memory", memory.toString()); + } + if (build !== undefined) { + searchParams.set("build", build); + } + + const response = await ctx.api["POST /v2/acts/:actorId/runs"]({ + actorId, + ...(searchParams.toString() ? { searchParams } : {}), + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`HTTP ${response.status}: ${errorText}`); + } + + const result = await response.json(); + return { data: result, error: null }; + } catch (error) { + console.error("Error starting actor run:", error); + return { + error: ctx.errorHandler.toHttpError(error, "Error starting actor run"), + data: null, + }; + } +} diff --git a/apify/actions/runActorV2.ts b/apify/actions/runActorV2.ts new file mode 100644 index 000000000..8b89c827f --- /dev/null +++ b/apify/actions/runActorV2.ts @@ -0,0 +1,81 @@ +import { AppContext } from "../mod.ts"; + +export interface Props { + /** + * @title Actor ID + * @description The ID of the actor to run + */ + actorId: string; + + /** + * @title Input + * @description Input data for the actor run (Stringified JSON object). If you don't know what object to pass, use an empty object: {} + */ + input: string; + + /** + * @title Timeout (seconds) + * @description Maximum timeout for the run in seconds + */ + timeout?: number; + + /** + * @title Memory (MB) + * @description Amount of memory allocated for the run in megabytes + */ + memory?: number; + + /** + * @title Build + * @description Specific build version to use (optional) + */ + build?: string; +} + +/** + * @name RUN_ACTOR_V2 + * @title Run Actor V2 + * @description Run an Apify actor synchronously and return dataset items + */ +export default async function runActorV2( + props: Props, + _req: Request, + ctx: AppContext, +): Promise< + { data: Array>; error: null } | { + error: string; + data: null; + } +> { + try { + const { actorId, input: inputString, timeout, memory, build } = props; + + if (!actorId) { + return { error: "Actor ID is required", data: null }; + } + + const response = await ctx.api + ["POST /v2/acts/:actorId/run-sync-get-dataset-items"]({ + actorId, + timeout, + memory, + build, + }, { + body: JSON.parse(inputString), + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`HTTP ${response.status}: ${errorText}`); + } + + const result = await response.json(); + return { data: result, error: null }; + } catch (error) { + console.error("Error running actor:", error); + return { + error: ctx.errorHandler.toHttpError(error, "Error running actor"), + data: null, + }; + } +} diff --git a/apify/loaders/getActor.ts b/apify/loaders/getActor.ts new file mode 100644 index 000000000..521b8bcb0 --- /dev/null +++ b/apify/loaders/getActor.ts @@ -0,0 +1,38 @@ +import { AppContext } from "../mod.ts"; +import { Actor } from "../utils/types.ts"; + +export interface Props { + /** + * @title Actor ID + * @description The ID or name of the actor (e.g., 'my-actor-id' or 'username~my-actor') + */ + actorId: string; +} + +/** + * @name GET_ACTOR + * @title Get Actor + * @description Get details of a specific actor + */ +export default async function getActor( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + try { + const { actorId } = props; + + if (!actorId) { + return { error: "Actor ID is required" }; + } + + const response = await ctx.api["GET /v2/acts/:actorId"]({ + actorId, + }); + + return response.json(); + } catch (error) { + console.error("Error getting actor:", error); + return ctx.errorHandler.toHttpError(error, "Error getting actor"); + } +} diff --git a/apify/loaders/getActorRun.ts b/apify/loaders/getActorRun.ts new file mode 100644 index 000000000..78e7bef70 --- /dev/null +++ b/apify/loaders/getActorRun.ts @@ -0,0 +1,62 @@ +import { AppContext } from "../mod.ts"; +import { ActorRunResponse } from "../utils/types.ts"; + +export interface Props { + /** + * @title Actor ID + * @description The ID of the actor + */ + actorId: string; + + /** + * @title Run ID + * @description The ID of the actor run + */ + runId: string; + + /** + * @title Include Dataset Items + * @description If true, include dataset items in the response + */ + includeDatasetItems?: boolean; +} + +/** + * @name GET_ACTOR_RUN + * @title Get Actor Run + * @description Get details of a specific actor run + */ +export default async function getActorRun( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + try { + const { actorId, runId } = props; + + if (!actorId || !runId) { + return { error: "Actor ID and Run ID are required" }; + } + + const response = await ctx.api["GET /v2/acts/:actorId/runs/:runId"]({ + actorId, + runId, + }); + + const result = await response.json() as ActorRunResponse; + + if (props.includeDatasetItems && result.data.defaultDatasetId) { + const datasetItemsResponse = await ctx.api + ["GET /v2/datasets/:datasetId/items"]({ + datasetId: result.data.defaultDatasetId, + format: "json", + }); + result.data.results = await datasetItemsResponse.json(); // Place dataset items in the response. + } + + return result; + } catch (error) { + console.error("Error getting actor run:", error); + return ctx.errorHandler.toHttpError(error, "Error getting actor run"); + } +} diff --git a/apify/loaders/listActorRuns.ts b/apify/loaders/listActorRuns.ts new file mode 100644 index 000000000..7b14ffab7 --- /dev/null +++ b/apify/loaders/listActorRuns.ts @@ -0,0 +1,66 @@ +import { AppContext } from "../mod.ts"; +import { ActorRunsResponse } from "../utils/types.ts"; + +export interface Props { + /** + * @title Actor ID + * @description The ID of the actor + */ + actorId: string; + + /** + * @title Limit + * @description Maximum number of runs to return (default: 10) + */ + limit?: number; + + /** + * @title Offset + * @description Number of runs to skip (default: 0) + */ + offset?: number; + + /** + * @title Status + * @description Filter runs by status (READY, RUNNING, SUCCEEDED, FAILED, TIMING-OUT, TIMED-OUT, ABORTING, ABORTED) + */ + status?: string; + + /** + * @title Descending Order + * @description If true, sort results in descending order by creation date + */ + desc?: boolean; +} + +/** + * @title List Actor Runs + * @name LIST_ACTOR_RUNS + * @description List runs of a specific actor + */ +export default async function listActorRuns( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + try { + const { actorId, limit = 10, offset = 0, status, desc = true } = props; + + if (!actorId) { + return { error: "Actor ID is required" }; + } + + const response = await ctx.api["GET /v2/acts/:actorId/runs"]({ + actorId, + limit, + offset, + status, + desc, + }); + + return response.json(); + } catch (error) { + console.error("Error listing actor runs:", error); + return ctx.errorHandler.toHttpError(error, "Error listing actor runs"); + } +} diff --git a/apify/loaders/listActors.ts b/apify/loaders/listActors.ts new file mode 100644 index 000000000..d5a690daf --- /dev/null +++ b/apify/loaders/listActors.ts @@ -0,0 +1,55 @@ +import { AppContext } from "../mod.ts"; +import { ActorsResponse } from "../utils/types.ts"; + +export interface Props { + /** + * @title Limit + * @description Maximum number of actors to return (default: 10) + */ + limit?: number; + + /** + * @title Offset + * @description Number of actors to skip (default: 0) + */ + offset?: number; + + /** + * @title Only My Actors + * @description If true, only return actors owned by the user + */ + my?: boolean; + + /** + * @title Descending Order + * @description If true, sort results in descending order by creation date + */ + desc?: boolean; +} + +/** + * @name LIST_ACTORS + * @title List Actors + * @description List actors from Apify platform + */ +export default async function listActors( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + try { + const { limit = 10, offset = 0, my = false, desc = true } = props; + + const response = await ctx.api["GET /v2/acts"]({ + limit, + offset, + my, + desc, + }); + + return response.json(); + } catch (error) { + console.error("Error listing actors:", error); + return ctx.errorHandler.toHttpError(error, "Error listing actors"); + } +} diff --git a/apify/manifest.gen.ts b/apify/manifest.gen.ts new file mode 100644 index 000000000..7531ac0e6 --- /dev/null +++ b/apify/manifest.gen.ts @@ -0,0 +1,31 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/runActor.ts"; +import * as $$$$$$$$$1 from "./actions/runActorAsync.ts"; +import * as $$$$$$$$$2 from "./actions/runActorV2.ts"; +import * as $$$0 from "./loaders/getActor.ts"; +import * as $$$1 from "./loaders/getActorRun.ts"; +import * as $$$2 from "./loaders/listActorRuns.ts"; +import * as $$$3 from "./loaders/listActors.ts"; + +const manifest = { + "loaders": { + "apify/loaders/getActor.ts": $$$0, + "apify/loaders/getActorRun.ts": $$$1, + "apify/loaders/listActorRuns.ts": $$$2, + "apify/loaders/listActors.ts": $$$3, + }, + "actions": { + "apify/actions/runActor.ts": $$$$$$$$$0, + "apify/actions/runActorAsync.ts": $$$$$$$$$1, + "apify/actions/runActorV2.ts": $$$$$$$$$2, + }, + "name": "apify", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/apify/mod.ts b/apify/mod.ts new file mode 100644 index 000000000..578e65884 --- /dev/null +++ b/apify/mod.ts @@ -0,0 +1,65 @@ +import type { App, FnContext } from "@deco/deco"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { createHttpClient } from "../utils/http.ts"; +import { fetchSafe } from "../utils/fetch.ts"; +import { Secret } from "../website/loaders/secret.ts"; +import { ApifyClient } from "./utils/client.ts"; +import { APIFY_API_BASE_URL, APIFY_ERROR_MESSAGES } from "./utils/constant.ts"; +import { + createErrorHandler, + ErrorHandler, +} from "../mcp/utils/errorHandling.ts"; + +export interface Props { + /** + * @title Apify API Token + * @description Your Apify API token. Get it from https://console.apify.com/account/integrations + */ + token: string | Secret; +} + +export interface State extends Omit { + api: ReturnType>; + errorHandler: ErrorHandler; + token: string; +} + +export type AppContext = FnContext; + +/** + * @title Apify + * @appName apify + * @description Automate scraping and browser workflows with prebuilt actors. + * @category Automation + * @logo https://assets.decocache.com/mcp/4eda8c60-503f-4001-9edb-89de961ab7f0/Apify.svg + */ +export default function App(props: Props): App { + const { token } = props; + + const stringToken = typeof token === "string" ? token : token?.get?.() ?? ""; + + const api = createHttpClient({ + base: APIFY_API_BASE_URL, + headers: new Headers({ + "Authorization": `Bearer ${stringToken}`, + "Content-Type": "application/json", + }), + fetcher: fetchSafe, + }); + + const errorHandler = createErrorHandler({ + errorMessages: APIFY_ERROR_MESSAGES, + defaultErrorMessage: "Apify operation failed", + }); + + const state: State = { + api, + errorHandler, + token: stringToken, + }; + + return { + state, + manifest, + }; +} diff --git a/apify/utils/client.ts b/apify/utils/client.ts new file mode 100644 index 000000000..31a755785 --- /dev/null +++ b/apify/utils/client.ts @@ -0,0 +1,52 @@ +import { + Actor, + ActorRun, + ActorRunsResponse, + ActorsResponse, + DatasetItemsQueryParams, +} from "./types.ts"; + +// Apify API client interface - simplified for Deco compatibility +export interface ApifyClient { + // Run Actor - POST /v2/acts/:actorId/runs + "POST /v2/acts/:actorId/runs": { + response: ActorRun; + }; + // Get list of runs - GET /v2/acts/:actorId/runs + "GET /v2/acts/:actorId/runs": { + searchParams: { + limit?: number; + offset?: number; + status?: string; + desc?: boolean; + }; + response: ActorRunsResponse; + }; + // Get run - GET /v2/acts/:actorId/runs/:runId + "GET /v2/acts/:actorId/runs/:runId": { + response: ActorRun; + }; + // Get Actor - GET /v2/acts/:actorId + "GET /v2/acts/:actorId": { + response: Actor; + }; + // Get list of Actors - GET /v2/acts + "GET /v2/acts": { + response: ActorsResponse; + }; + "POST /v2/acts/:actorId/run-sync-get-dataset-items": { + searchParams: { + timeout?: number; + memory?: number; + build?: string; + }; + body: unknown; + response: Array>; + }; + // Get dataset items - GET /v2/datasets/:datasetId/items + "GET /v2/datasets/:datasetId/items": { + searchParams: DatasetItemsQueryParams; + // deno-lint-ignore no-explicit-any + response: any; + }; +} diff --git a/apify/utils/constant.ts b/apify/utils/constant.ts new file mode 100644 index 000000000..f7adb9349 --- /dev/null +++ b/apify/utils/constant.ts @@ -0,0 +1,26 @@ +// Apify API constants +export const APIFY_API_BASE_URL = "https://api.apify.com"; + +export const APIFY_ERROR_MESSAGES = { + "PERMISSION_DENIED": + "Acesso negado ao Apify. Verifique suas permissões e token de API.", + "NOT_FOUND": "Recurso não encontrado. Verifique o ID fornecido.", + "INVALID_ARGUMENT": + "Argumento inválido na requisição. Verifique os parâmetros.", + "FAILED_PRECONDITION": "Operação não permitida no estado atual.", + "RESOURCE_EXHAUSTED": + "Limite de requisições da API do Apify excedido. Tente novamente mais tarde.", + "UNAUTHENTICATED": + "Falha na autenticação da API do Apify. Verifique seu token de API.", + "QUOTA_EXCEEDED": + "Cota da API do Apify excedida. Tente novamente mais tarde.", + "ALREADY_EXISTS": "O recurso já existe.", + "DEADLINE_EXCEEDED": "A operação expirou. Tente novamente.", + "UNAVAILABLE": + "Serviço do Apify temporariamente indisponível. Tente novamente mais tarde.", + "INVALID_VALUE": "Um ou mais valores na sua requisição são inválidos.", + "ACTOR_NOT_FOUND": "Actor não encontrado ou inacessível.", + "RUN_NOT_FOUND": "Execução não encontrada.", + "INVALID_TOKEN": "Token de API inválido ou expirado.", + "INSUFFICIENT_CREDIT": "Créditos insuficientes para executar esta operação.", +} as const; diff --git a/apify/utils/types.ts b/apify/utils/types.ts new file mode 100644 index 000000000..398b16cf2 --- /dev/null +++ b/apify/utils/types.ts @@ -0,0 +1,172 @@ +// Apify API types based on official v2 documentation +export interface ActorRun { + id: string; + // deno-lint-ignore no-explicit-any + data?: any; + actId: string; + userId: string; + status: string; + startedAt: string; + finishedAt?: string; + buildId?: string; + exitCode?: number; + defaultDatasetId?: string; + defaultKeyValueStoreId?: string; + defaultRequestQueueId?: string; + buildNumber?: string; + isContainerServerReady?: boolean; + gitBranchName?: string; + usage?: { + ACTOR_COMPUTE_UNITS?: number; + DATASET_READS?: number; + DATASET_WRITES?: number; + KEY_VALUE_STORE_READS?: number; + KEY_VALUE_STORE_WRITES?: number; + REQUEST_QUEUE_READS?: number; + REQUEST_QUEUE_WRITES?: number; + DATA_TRANSFER_INTERNAL_GBYTES?: number; + DATA_TRANSFER_EXTERNAL_GBYTES?: number; + PROXY_RESIDENTIAL_TRANSFER_GBYTES?: number; + PROXY_SERPS?: number; + }; + usageTotalUsd?: number; + usageUsd?: { + ACTOR_COMPUTE_UNITS?: number; + DATASET_READS?: number; + DATASET_WRITES?: number; + KEY_VALUE_STORE_READS?: number; + KEY_VALUE_STORE_WRITES?: number; + REQUEST_QUEUE_READS?: number; + REQUEST_QUEUE_WRITES?: number; + DATA_TRANSFER_INTERNAL_GBYTES?: number; + DATA_TRANSFER_EXTERNAL_GBYTES?: number; + PROXY_RESIDENTIAL_TRANSFER_GBYTES?: number; + PROXY_SERPS?: number; + }; +} + +// Enhanced ActorRun response that may include dataset results +export interface ActorRunResponse { + data: ActorRun & { + // Dataset items included when includeDatasetItems is true + results?: Array>; + }; +} + +export interface Actor { + id: string; + userId: string; + name: string; + username: string; + description?: string; + readme?: string; + isPublic: boolean; + createdAt: string; + modifiedAt: string; + restartOnError: boolean; + isDeprecated: boolean; + isAnonymouslyRunnable: boolean; + categories: string[]; + defaultRunOptions?: { + build: string; + timeoutSecs: number; + memoryMbytes: number; + }; + exampleRunInput?: Record; + stats: { + totalRuns: number; + totalUsers?: number; + totalUsers7Days?: number; + totalUsers30Days?: number; + totalUsers90Days?: number; + totalMetamorphs?: number; + lastRunStartedAt?: string; + }; +} + +export interface ActorsResponse { + data: { + total: number; + count: number; + offset: number; + limit: number; + desc: boolean; + items: Actor[]; + }; +} + +export interface ActorRunsResponse { + data: { + total: number; + count: number; + offset: number; + limit: number; + desc: boolean; + items: ActorRun[]; + }; +} + +export interface Dataset { + id: string; + name?: string; + userId: string; + createdAt: string; + modifiedAt: string; + accessedAt: string; + itemCount: number; + cleanItemCount: number; + actId?: string; + actRunId?: string; +} + +export interface KeyValueStore { + id: string; + name?: string; + userId: string; + createdAt: string; + modifiedAt: string; + accessedAt: string; + actId?: string; + actRunId?: string; +} + +// Dataset Items API types +export type DatasetItemFormat = + | "json" + | "jsonl" + | "xml" + | "html" + | "csv" + | "xlsx" + | "rss"; + +export interface DatasetItemsQueryParams { + /** Response format - determines how data is structured and returned */ + format?: DatasetItemFormat; + /** Skip hidden fields (starting with #) from output */ + skipHidden?: boolean | 0 | 1; + /** Clean output by omitting hidden fields (alias for skipHidden) */ + clean?: boolean | 0 | 1; + /** Unwind array fields to separate items */ + unwind?: string; + /** Flatten nested objects using dot notation */ + flatten?: string[]; + /** Select only specific fields */ + fields?: string[]; + /** Omit specific fields */ + omit?: string[]; + /** Return results in descending order (newest first) */ + desc?: boolean | 0 | 1; + /** Pagination offset */ + offset?: number; + /** Maximum number of items to return */ + limit?: number; + /** Custom XML root element name (for XML/RSS formats) */ + xmlRoot?: string; + /** Custom XML row element name (for XML/RSS formats) */ + xmlRow?: string; + /** Skip empty items */ + skipEmpty?: boolean | 0 | 1; + /** Simplified format for easier processing */ + simplified?: boolean | 0 | 1; +} diff --git a/assets/Konfidency.svg b/assets/Konfidency.svg new file mode 100644 index 000000000..d1cdb690a --- /dev/null +++ b/assets/Konfidency.svg @@ -0,0 +1,26 @@ + + + + + + + + + diff --git a/assets/logo.svg b/assets/logo.svg index fab575f92..40d356f47 100644 --- a/assets/logo.svg +++ b/assets/logo.svg @@ -1,7 +1,20 @@ - - + - + - + - + - + - + - + - + - + - + - + - \ No newline at end of file +z" + /> + diff --git a/aws/README.md b/aws/README.md new file mode 100644 index 000000000..3d3386093 --- /dev/null +++ b/aws/README.md @@ -0,0 +1,332 @@ +# AWS Cost Explorer & Billing App + +A comprehensive AWS integration app for cost analysis, budget monitoring, and billing insights using the AWS Cost Explorer API. + +## Features + +### 📊 Cost Analysis +- **Cost and Usage Reports**: Detailed cost breakdowns with customizable time periods and grouping +- **Cost Forecasting**: Predict future costs with confidence intervals and trend analysis +- **Service Cost Analysis**: Deep dive into service-specific costs with trend comparisons +- **Multi-dimensional Breakdowns**: Analyze costs by service, region, account, usage type, and more + +### 💰 Budget Management +- **Budget Monitoring**: Track budget performance with utilization percentages and alerts +- **Budget Creation**: Create new budgets with filters and customizable parameters +- **Budget Updates**: Modify existing budgets with change tracking +- **Budget Deletion**: Safe budget removal with confirmation + +### 🚨 Anomaly Detection +- **Cost Anomalies**: Identify unusual spending patterns with severity classification +- **Root Cause Analysis**: Detailed breakdown of anomaly causes by service and region +- **Risk Assessment**: Automated risk level calculation and actionable insights +- **Trend Monitoring**: Track anomaly patterns over time + +### 💾 Data Export +- **Multiple Formats**: Export cost data in JSON or CSV formats +- **Custom Grouping**: Export with various grouping dimensions +- **Summary Statistics**: Include summary metrics in exports +- **Bulk Data Processing**: Handle large datasets efficiently + +### 🔍 Reserved Instances & Savings Plans +- **RI Coverage Analysis**: Monitor reserved instance coverage and utilization +- **Savings Plans Tracking**: Track savings plans utilization and net savings +- **Cost Optimization**: Identify opportunities for reserved instance purchases + +## Setup + +### Prerequisites +- AWS Account with appropriate permissions +- AWS Access Key ID and Secret Access Key +- Cost Explorer enabled in your AWS account + +### Required AWS Permissions + +Create an IAM policy with the following permissions: + +```json +{ + "Version": "2012-10-17", + "Statement": [ + { + "Effect": "Allow", + "Action": [ + "ce:GetCostAndUsage", + "ce:GetCostForecast", + "ce:GetUsageForecast", + "ce:GetAnomalies", + "ce:GetDimensionValues", + "ce:GetReservationCoverage", + "ce:GetSavingsPlansUtilization", + "budgets:DescribeBudgets", + "budgets:DescribeBudget", + "budgets:CreateBudget", + "budgets:ModifyBudget", + "budgets:DeleteBudget" + ], + "Resource": "*" + } + ] +} +``` + +### Configuration + +Add the AWS app to your deco configuration with the following parameters: + +```typescript +{ + accessKeyId: "your-aws-access-key-id", // Required - string + secretAccessKey: "your-aws-secret-access-key", // Required - string + region: "us-east-1", // Optional, defaults to us-east-1 + sessionToken: "your-session-token", // Optional - for temporary credentials + accountId: "your-aws-account-id", // Required for budget operations + defaultCurrency: "USD", // Optional, defaults to USD + enableAnomalyDetection: true, // Optional, defaults to true + enableBudgetMonitoring: true // Optional, defaults to true +} +``` + +**Important Notes:** +- **Billing Services Region**: AWS Cost Explorer and Budgets APIs are only available in `us-east-1`. The app automatically uses this region for all billing operations, regardless of your configured region setting. +- **Security**: Store your AWS credentials securely. In production environments, consider using environment variables or AWS IAM roles for enhanced security. +- **Region Setting**: The `region` parameter is available for future extensibility but currently doesn't affect billing operations since they're centralized in `us-east-1`. + +## Loaders + +### Cost and Usage (`costAndUsage.ts`) +Retrieve detailed cost and usage data with customizable grouping and filtering. + +**Parameters:** +- `timePeriodDays`: Number of days to analyze (default: 30) +- `granularity`: DAILY, MONTHLY, or HOURLY +- `groupBy`: Dimension to group by (SERVICE, REGION, etc.) +- `metrics`: Cost metrics to retrieve +- `serviceFilter`: Filter by specific AWS service + +**Example Response:** +```json +{ + "costData": [ + { + "timePeriod": {"Start": "2024-01-01", "End": "2024-01-02"}, + "total": {"amount": "125.50", "formatted": "$125.50"}, + "groups": [ + { + "keys": ["Amazon Elastic Compute Cloud - Compute"], + "metrics": {"BlendedCost": {"amount": "75.30", "formatted": "$75.30"}} + } + ] + } + ], + "summary": { + "totalCost": {"amount": "3765.00", "formatted": "$3,765.00"}, + "topServices": [ + {"service": "EC2", "cost": 1250.30, "percentage": 33.2} + ] + } +} +``` + +### Cost Forecast (`costForecast.ts`) +Generate cost forecasts with confidence intervals and trend analysis. + +**Parameters:** +- `forecastDays`: Number of days to forecast (default: 30) +- `metric`: Cost metric to forecast +- `predictionIntervalLevel`: Confidence level (default: 80) +- `includeHistoricalComparison`: Include historical data for trend analysis + +### Budget Monitoring (`budgets.ts`) +Monitor budget performance and utilization. + +**Parameters:** +- `budgetName`: Specific budget to analyze (optional) +- `maxResults`: Maximum number of budgets to return + +**Example Response:** +```json +{ + "budgets": [ + { + "budgetName": "Monthly Cost Budget", + "utilizationPercentage": 75.5, + "status": "ON_TRACK", + "remainingBudget": {"amount": "245.50", "formatted": "$245.50"} + } + ], + "alerts": [ + { + "budgetName": "Production Budget", + "alertType": "HIGH_UTILIZATION", + "severity": "MEDIUM" + } + ] +} +``` + +### Anomaly Detection (`anomalies.ts`) +Detect and analyze cost anomalies with severity classification. + +**Parameters:** +- `timePeriodDays`: Analysis period (default: 30) +- `minImpactAmount`: Minimum impact threshold (default: $10) +- `maxResults`: Maximum anomalies to return + +### Service Analysis (`services.ts`) +Detailed service-level cost analysis with trend comparisons. + +**Parameters:** +- `topServicesLimit`: Number of top services to analyze (default: 10) +- `compareWithPreviousPeriod`: Include period-over-period comparison +- `includeCostTrends`: Include trend analysis + +### Cost Breakdown (`costBreakdown.ts`) +Multi-dimensional cost analysis across various AWS dimensions. + +**Parameters:** +- `primaryDimension`: Primary grouping dimension +- `secondaryDimension`: Secondary grouping (optional) +- `includeRegionalBreakdown`: Include regional analysis +- `includeUsageTypeAnalysis`: Include usage type breakdown + +## Actions + +### Create Budget (`createBudget.ts`) +Create new AWS budgets with customizable parameters. + +**Parameters:** +- `budgetName`: Name for the new budget (required) +- `budgetAmount`: Budget limit amount (required) +- `budgetType`: COST, USAGE, RI_UTILIZATION, etc. +- `timeUnit`: DAILY, MONTHLY, QUARTERLY, ANNUALLY +- `serviceFilter`: Filter by specific service (optional) + +### Update Budget (`updateBudget.ts`) +Modify existing budgets with change tracking. + +**Parameters:** +- `budgetName`: Budget to update (required) +- `budgetAmount`: New budget amount (optional) +- `currency`: New currency (optional) +- `startDate`/`endDate`: New time period (optional) + +### Delete Budget (`deleteBudget.ts`) +Safely delete budgets with confirmation. + +**Parameters:** +- `budgetName`: Budget to delete (required) +- `confirmDeletion`: Safety confirmation (required) + +### Export Cost Data (`exportCostData.ts`) +Export cost data in JSON or CSV format. + +**Parameters:** +- `format`: JSON or CSV +- `groupBy`: Grouping dimension +- `includeSummary`: Include summary statistics +- `timePeriodDays`: Data period to export + +## Usage Examples + +### Basic Cost Analysis +```typescript +// Get last 30 days of cost data grouped by service +const costData = await invoke.aws.loaders.costAndUsage({ + timePeriodDays: 30, + groupBy: "SERVICE", + granularity: "DAILY" +}); +``` + +### Budget Monitoring Dashboard +```typescript +// Get all budgets with performance metrics +const budgets = await invoke.aws.loaders.budgets({ + includeBudgetPerformance: true +}); + +// Check for budget alerts +const alerts = budgets.alerts.filter(alert => + alert.severity === "HIGH" || alert.severity === "CRITICAL" +); +``` + +### Cost Optimization Analysis +```typescript +// Analyze service costs with trends +const services = await invoke.aws.loaders.services({ + topServicesLimit: 15, + compareWithPreviousPeriod: true, + includeCostTrends: true +}); + +// Get cost breakdown by multiple dimensions +const breakdown = await invoke.aws.loaders.costBreakdown({ + primaryDimension: "SERVICE", + secondaryDimension: "REGION", + includeRegionalBreakdown: true +}); +``` + +### Anomaly Detection +```typescript +// Monitor for cost anomalies +const anomalies = await invoke.aws.loaders.anomalies({ + timePeriodDays: 30, + minImpactAmount: 50, + includeRootCauseAnalysis: true +}); + +// Filter critical anomalies +const criticalAnomalies = anomalies.anomalies.filter( + anomaly => anomaly.score.severity === "CRITICAL" +); +``` + +### Data Export +```typescript +// Export cost data for external analysis +const exportResult = await invoke.aws.actions.exportCostData({ + format: "CSV", + timePeriodDays: 90, + groupBy: "SERVICE", + includeSummary: true +}); + +// The exported data is available in exportResult.exportData.content +``` + +## Error Handling + +The app includes comprehensive error handling for common scenarios: + +- **Invalid Credentials**: Clear error messages for authentication issues +- **Missing Permissions**: Specific guidance on required AWS permissions +- **API Limits**: Graceful handling of AWS API rate limits +- **Data Validation**: Input validation with helpful error messages + +## Cost Optimization Tips + +The app provides automated insights and recommendations: + +1. **Service Concentration**: Alerts when a single service dominates costs +2. **Regional Distribution**: Recommendations for multi-region strategies +3. **Reserved Instances**: Suggestions for RI purchases based on usage patterns +4. **Anomaly Response**: Actionable steps for cost anomaly resolution +5. **Budget Optimization**: Dynamic budget adjustment recommendations + +## Support + +For issues or feature requests: +1. Check the error messages for specific guidance +2. Verify AWS permissions and credentials +3. Ensure Cost Explorer is enabled in your AWS account +4. Review the AWS Cost Explorer API documentation for additional context + +## Security + +- Credentials are handled securely using the app's Secret type +- All API calls use AWS Signature Version 4 for authentication +- No sensitive data is logged or exposed in error messages +- Budget operations require explicit confirmation for safety \ No newline at end of file diff --git a/aws/actions/createBudget.ts b/aws/actions/createBudget.ts new file mode 100644 index 000000000..260c57965 --- /dev/null +++ b/aws/actions/createBudget.ts @@ -0,0 +1,332 @@ +import { AppContext } from "../mod.ts"; +import { AWSBudgetsClient } from "../client.ts"; +import type { Budget } from "../client.ts"; + +export interface Props { + /** + * @title Budget Name + * @description Name for the new budget + */ + budgetName: string; + + /** + * @title Budget Amount + * @description Budget limit amount + */ + budgetAmount: number; + + /** + * @title Currency + * @description Currency for the budget + * @default "USD" + */ + currency?: string; + + /** + * @title Budget Type + * @description Type of budget to create + * @default "COST" + */ + budgetType?: + | "USAGE" + | "COST" + | "RI_UTILIZATION" + | "RI_COVERAGE" + | "SAVINGS_PLANS_UTILIZATION" + | "SAVINGS_PLANS_COVERAGE"; + + /** + * @title Time Unit + * @description Time unit for the budget period + * @default "MONTHLY" + */ + timeUnit?: "DAILY" | "MONTHLY" | "QUARTERLY" | "ANNUALLY"; + + /** + * @title Start Date + * @description Budget period start date (YYYY-MM-DD format) + * @format date + */ + startDate?: string; + + /** + * @title End Date + * @description Budget period end date (YYYY-MM-DD format). If not provided, will be calculated based on time unit + * @format date + */ + endDate?: string; + + /** + * @title Filter by Service + * @description Filter budget by specific AWS service + */ + serviceFilter?: string; + + /** + * @title Filter by Linked Account + * @description Filter budget by specific linked account ID + */ + linkedAccountFilter?: string; + + /** + * @title Filter by Region + * @description Filter budget by specific AWS region + */ + regionFilter?: string; + + /** + * @title Filter by Usage Type + * @description Filter budget by specific usage type + */ + usageTypeFilter?: string; + + /** + * @title Auto-Adjust Budget + * @description Automatically adjust budget based on historical data + * @default false + */ + autoAdjust?: boolean; +} + +export interface CreateBudgetResponse { + success: boolean; + budgetName: string; + message: string; + budgetDetails: { + budgetName: string; + budgetLimit: { + amount: string; + unit: string; + }; + budgetType: string; + timeUnit: string; + timePeriod: { + start: string; + end: string; + }; + filters?: Record; + }; + recommendations?: string[]; +} + +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + budgetName, + budgetAmount, + currency = "USD", + budgetType = "COST", + timeUnit = "MONTHLY", + startDate, + endDate, + serviceFilter, + linkedAccountFilter, + regionFilter, + usageTypeFilter, + autoAdjust = false, + } = props; + + // Validate credentials and account ID + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + if (!ctx.accountId) { + throw new Error( + "AWS Account ID not configured. Please set accountId in the app configuration.", + ); + } + + // Validate inputs + if (!budgetName.trim()) { + throw new Error("Budget name is required"); + } + + if (budgetAmount <= 0) { + throw new Error("Budget amount must be greater than 0"); + } + + const client = new AWSBudgetsClient(ctx.credentials); + + try { + // Calculate time period + let calculatedStartDate: string; + let calculatedEndDate: string; + + if (startDate) { + calculatedStartDate = startDate; + } else { + const now = new Date(); + calculatedStartDate = now.toISOString().split("T")[0]; + } + + if (endDate) { + calculatedEndDate = endDate; + } else { + const start = new Date(calculatedStartDate); + const end = new Date(start); + + switch (timeUnit) { + case "DAILY": + end.setDate(end.getDate() + 1); + break; + case "MONTHLY": + end.setMonth(end.getMonth() + 1); + break; + case "QUARTERLY": + end.setMonth(end.getMonth() + 3); + break; + case "ANNUALLY": + end.setFullYear(end.getFullYear() + 1); + break; + } + + calculatedEndDate = end.toISOString().split("T")[0]; + } + + // Build cost filters + const costFilters: Record = {}; + + if (serviceFilter) { + costFilters["SERVICE"] = [serviceFilter]; + } + + if (linkedAccountFilter) { + costFilters["LINKED_ACCOUNT"] = [linkedAccountFilter]; + } + + if (regionFilter) { + costFilters["REGION"] = [regionFilter]; + } + + if (usageTypeFilter) { + costFilters["USAGE_TYPE"] = [usageTypeFilter]; + } + + // Check if budget name already exists + try { + await client.getBudget(ctx.accountId, budgetName); + throw new Error( + `Budget with name "${budgetName}" already exists. Please choose a different name.`, + ); + } catch (error) { + // Budget doesn't exist, which is what we want + const errorMessage = error instanceof Error + ? error.message + : "Unknown error"; + if ( + !errorMessage.includes("NotFound") && + !errorMessage.includes("already exists") + ) { + throw error; + } + } + + // Auto-adjust budget amount if requested + const finalBudgetAmount = budgetAmount; + const recommendations: string[] = []; + + if (autoAdjust) { + // This would typically involve analyzing historical spending patterns + // For now, we'll provide some basic recommendations + recommendations.push( + "Consider reviewing historical spending patterns to optimize budget amount", + ); + + if (budgetType === "COST" && timeUnit === "MONTHLY") { + recommendations.push( + "For monthly cost budgets, consider setting up alerts at 50%, 80%, and 100% thresholds", + ); + } + + if (serviceFilter) { + recommendations.push( + `Monitor ${serviceFilter} usage patterns and consider reserved instances or savings plans for cost optimization`, + ); + } + } + + // Create the budget + const budget: Omit = { + BudgetName: budgetName, + BudgetLimit: { + Amount: finalBudgetAmount.toString(), + Unit: currency, + }, + CostFilters: Object.keys(costFilters).length > 0 + ? costFilters + : undefined, + TimeUnit: timeUnit, + TimePeriod: { + Start: calculatedStartDate, + End: calculatedEndDate, + }, + BudgetType: budgetType, + }; + + await client.createBudget(ctx.accountId, budget); + + // Add success recommendations + recommendations.push("Budget created successfully"); + recommendations.push( + "Consider setting up budget alerts to monitor spending progress", + ); + + if (budgetType === "COST") { + recommendations.push( + "Monitor your budget regularly and adjust as needed based on actual spending patterns", + ); + } + + return { + success: true, + budgetName, + message: + `Budget "${budgetName}" created successfully with a limit of ${currency} ${finalBudgetAmount}`, + budgetDetails: { + budgetName, + budgetLimit: { + amount: finalBudgetAmount.toString(), + unit: currency, + }, + budgetType, + timeUnit, + timePeriod: { + start: calculatedStartDate, + end: calculatedEndDate, + }, + filters: Object.keys(costFilters).length > 0 ? costFilters : undefined, + }, + recommendations, + }; + } catch (error) { + console.error("Error creating budget:", error); + + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + return { + success: false, + budgetName, + message: `Failed to create budget: ${errorMessage}`, + budgetDetails: { + budgetName, + budgetLimit: { + amount: budgetAmount.toString(), + unit: currency, + }, + budgetType, + timeUnit, + timePeriod: { + start: startDate || "N/A", + end: endDate || "N/A", + }, + }, + }; + } +} diff --git a/aws/actions/deleteBudget.ts b/aws/actions/deleteBudget.ts new file mode 100644 index 000000000..2f2a12223 --- /dev/null +++ b/aws/actions/deleteBudget.ts @@ -0,0 +1,129 @@ +import { AppContext } from "../mod.ts"; +import { AWSBudgetsClient } from "../client.ts"; + +export interface Props { + /** + * @title Budget Name + * @description Name of the budget to delete + */ + budgetName: string; + + /** + * @title Confirm Deletion + * @description Confirm that you want to delete this budget (required for safety) + * @default false + */ + confirmDeletion: boolean; +} + +export interface DeleteBudgetResponse { + success: boolean; + budgetName: string; + message: string; + deletedBudgetInfo?: { + budgetName: string; + budgetAmount: string; + budgetType: string; + timeUnit: string; + deletedAt: string; + }; +} + +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + budgetName, + confirmDeletion, + } = props; + + // Validate credentials and account ID + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + if (!ctx.accountId) { + throw new Error( + "AWS Account ID not configured. Please set accountId in the app configuration.", + ); + } + + // Validate inputs + if (!budgetName.trim()) { + throw new Error("Budget name is required"); + } + + if (!confirmDeletion) { + return { + success: false, + budgetName, + message: + "Budget deletion not confirmed. Please check the confirmation checkbox to proceed with deletion.", + }; + } + + const client = new AWSBudgetsClient(ctx.credentials); + + try { + // First, get the budget details for confirmation + let budgetInfo: { + budgetName: string; + budgetAmount: string; + budgetType: string; + timeUnit: string; + }; + + try { + const budgetResponse = await client.getBudget(ctx.accountId, budgetName); + const budget = budgetResponse.Budget; + + budgetInfo = { + budgetName: budget.BudgetName, + budgetAmount: `${budget.BudgetLimit.Unit} ${budget.BudgetLimit.Amount}`, + budgetType: budget.BudgetType, + timeUnit: budget.TimeUnit, + }; + } catch (error) { + const errorMessage = error instanceof Error + ? error.message + : "Unknown error"; + if (errorMessage.includes("NotFound")) { + return { + success: false, + budgetName, + message: + `Budget "${budgetName}" not found. It may have already been deleted or the name may be incorrect.`, + }; + } + throw error; + } + + // Delete the budget + await client.deleteBudget(ctx.accountId, budgetName); + + return { + success: true, + budgetName, + message: `Budget "${budgetName}" has been successfully deleted.`, + deletedBudgetInfo: { + ...budgetInfo, + deletedAt: new Date().toISOString(), + }, + }; + } catch (error) { + console.error("Error deleting budget:", error); + + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + return { + success: false, + budgetName, + message: `Failed to delete budget: ${errorMessage}`, + }; + } +} diff --git a/aws/actions/exportCostData.ts b/aws/actions/exportCostData.ts new file mode 100644 index 000000000..c1c1ace91 --- /dev/null +++ b/aws/actions/exportCostData.ts @@ -0,0 +1,280 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval, GroupDefinition } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to export cost data for + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format) + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format) + * @format date + */ + endDate?: string; + + /** + * @title Export Format + * @description Format for the exported data + * @default "JSON" + */ + format?: "JSON" | "CSV"; + + /** + * @title Group By + * @description How to group the cost data in the export + * @default "SERVICE" + */ + groupBy?: + | "SERVICE" + | "AZ" + | "INSTANCE_TYPE" + | "LINKED_ACCOUNT" + | "OPERATION" + | "PURCHASE_TYPE" + | "REGION" + | "USAGE_TYPE" + | "USAGE_TYPE_GROUP"; + + /** + * @title Granularity + * @description The granularity of the cost data + * @default "DAILY" + */ + granularity?: "DAILY" | "MONTHLY"; + + /** + * @title Include Summary + * @description Include summary statistics in the export + * @default true + */ + includeSummary?: boolean; + + /** + * @title Metric + * @description Cost metric to export + * @default "BlendedCost" + */ + metric?: + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost"; +} + +export interface ExportCostDataResponse { + success: boolean; + message: string; + exportData: { + format: string; + content: string; + filename: string; + recordCount: number; + timePeriod: DateInterval; + generatedAt: string; + }; + summary?: { + totalCost: string; + totalRecords: number; + dateRange: string; + grouping: string; + }; +} + +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + format = "JSON", + groupBy = "SERVICE", + granularity = "DAILY", + includeSummary = true, + metric = "BlendedCost", + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let timePeriod: DateInterval; + if (startDate && endDate) { + timePeriod = { Start: startDate, End: endDate }; + } else { + timePeriod = AWSCostUtils.getDateRange(timePeriodDays); + } + + try { + // Fetch cost data + const groupByConfig: GroupDefinition[] = [{ + Type: "DIMENSION", + Key: groupBy, + }]; + + const response = await client.getCostAndUsage({ + TimePeriod: timePeriod, + Granularity: granularity, + Metrics: [metric], + GroupBy: groupByConfig, + }); + + // Process the data for export + const exportRecords: Array<{ + date: string; + group: string; + amount: string; + unit: string; + estimated: boolean; + }> = []; + + let totalCost = 0; + + response.ResultsByTime.forEach((result) => { + const date = result.TimePeriod.Start; + + if (result.Groups && result.Groups.length > 0) { + result.Groups.forEach((group) => { + const groupName = group.Keys[0] || "Unknown"; + const cost = parseFloat(group.Metrics[metric]?.Amount || "0"); + const unit = group.Metrics[metric]?.Unit || "USD"; + + exportRecords.push({ + date, + group: groupName, + amount: cost.toString(), + unit, + estimated: result.Estimated, + }); + + totalCost += cost; + }); + } else { + // No grouping + const cost = parseFloat(result.Total[metric]?.Amount || "0"); + const unit = result.Total[metric]?.Unit || "USD"; + + exportRecords.push({ + date, + group: "Total", + amount: cost.toString(), + unit, + estimated: result.Estimated, + }); + + totalCost += cost; + } + }); + + // Generate export content based on format + let content: string; + let filename: string; + + if (format === "CSV") { + // Generate CSV + const csvHeaders = ["Date", "Group", "Amount", "Unit", "Estimated"]; + const csvRows = exportRecords.map((record) => [ + record.date, + `"${record.group.replace(/"/g, '""')}"`, // Escape quotes in CSV + record.amount, + record.unit, + record.estimated.toString(), + ]); + + content = [csvHeaders.join(","), ...csvRows.map((row) => row.join(","))] + .join("\n"); + filename = `aws-cost-export-${timePeriod.Start}-to-${timePeriod.End}.csv`; + } else { + // Generate JSON + const jsonData = { + metadata: { + exportedAt: new Date().toISOString(), + timePeriod, + groupBy, + granularity, + metric, + totalRecords: exportRecords.length, + }, + summary: includeSummary + ? { + totalCost: totalCost.toString(), + formattedTotalCost: AWSCostUtils.formatCurrency( + totalCost.toString(), + ), + recordCount: exportRecords.length, + dateRange: `${timePeriod.Start} to ${timePeriod.End}`, + currency: exportRecords[0]?.unit || "USD", + } + : undefined, + data: exportRecords, + }; + + content = JSON.stringify(jsonData, null, 2); + filename = + `aws-cost-export-${timePeriod.Start}-to-${timePeriod.End}.json`; + } + + const summary = includeSummary + ? { + totalCost: AWSCostUtils.formatCurrency(totalCost.toString()), + totalRecords: exportRecords.length, + dateRange: `${timePeriod.Start} to ${timePeriod.End}`, + grouping: groupBy, + } + : undefined; + + return { + success: true, + message: + `Successfully exported ${exportRecords.length} cost records in ${format} format`, + exportData: { + format, + content, + filename, + recordCount: exportRecords.length, + timePeriod, + generatedAt: new Date().toISOString(), + }, + summary, + }; + } catch (error) { + console.error("Error exporting cost data:", error); + + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + return { + success: false, + message: `Failed to export cost data: ${errorMessage}`, + exportData: { + format, + content: "", + filename: "", + recordCount: 0, + timePeriod, + generatedAt: new Date().toISOString(), + }, + }; + } +} diff --git a/aws/actions/updateBudget.ts b/aws/actions/updateBudget.ts new file mode 100644 index 000000000..3694b3562 --- /dev/null +++ b/aws/actions/updateBudget.ts @@ -0,0 +1,219 @@ +import { AppContext } from "../mod.ts"; +import { AWSBudgetsClient } from "../client.ts"; +import type { Budget } from "../client.ts"; + +export interface Props { + /** + * @title Budget Name + * @description Name of the budget to update + */ + budgetName: string; + + /** + * @title New Budget Amount + * @description New budget limit amount (optional - leave empty to keep current) + */ + budgetAmount?: number; + + /** + * @title New Currency + * @description New currency for the budget (optional - leave empty to keep current) + */ + currency?: string; + + /** + * @title New Start Date + * @description New budget period start date (optional - leave empty to keep current) + * @format date + */ + startDate?: string; + + /** + * @title New End Date + * @description New budget period end date (optional - leave empty to keep current) + * @format date + */ + endDate?: string; +} + +export interface UpdateBudgetResponse { + success: boolean; + budgetName: string; + message: string; + changes: Array<{ + field: string; + oldValue: string; + newValue: string; + }>; + updatedBudget?: { + budgetName: string; + budgetLimit: { + amount: string; + unit: string; + }; + timeUnit: string; + timePeriod: { + start: string; + end: string; + }; + }; +} + +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + budgetName, + budgetAmount, + currency, + startDate, + endDate, + } = props; + + // Validate credentials and account ID + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + if (!ctx.accountId) { + throw new Error( + "AWS Account ID not configured. Please set accountId in the app configuration.", + ); + } + + // Validate inputs + if (!budgetName.trim()) { + throw new Error("Budget name is required"); + } + + const client = new AWSBudgetsClient(ctx.credentials); + + try { + // Get current budget + const currentBudgetResponse = await client.getBudget( + ctx.accountId, + budgetName, + ); + const currentBudget = currentBudgetResponse.Budget; + + // Track changes + const changes: Array< + { field: string; oldValue: string; newValue: string } + > = []; + + // Create updated budget object + const updatedBudget: Budget = { ...currentBudget }; + + // Update budget amount if provided + if (budgetAmount !== undefined && budgetAmount > 0) { + const oldAmount = currentBudget.BudgetLimit.Amount; + const newAmount = budgetAmount.toString(); + + if (oldAmount !== newAmount) { + changes.push({ + field: "Budget Amount", + oldValue: `${currentBudget.BudgetLimit.Unit} ${oldAmount}`, + newValue: `${ + currency || currentBudget.BudgetLimit.Unit + } ${newAmount}`, + }); + + updatedBudget.BudgetLimit.Amount = newAmount; + } + } + + // Update currency if provided + if (currency && currency !== currentBudget.BudgetLimit.Unit) { + changes.push({ + field: "Currency", + oldValue: currentBudget.BudgetLimit.Unit, + newValue: currency, + }); + + updatedBudget.BudgetLimit.Unit = currency; + } + + // Update time period if provided + if (startDate && startDate !== currentBudget.TimePeriod.Start) { + changes.push({ + field: "Start Date", + oldValue: currentBudget.TimePeriod.Start, + newValue: startDate, + }); + + updatedBudget.TimePeriod.Start = startDate; + } + + if (endDate && endDate !== currentBudget.TimePeriod.End) { + changes.push({ + field: "End Date", + oldValue: currentBudget.TimePeriod.End, + newValue: endDate, + }); + + updatedBudget.TimePeriod.End = endDate; + } + + // Check if any changes were made + if (changes.length === 0) { + return { + success: true, + budgetName, + message: + `No changes detected for budget "${budgetName}". Budget remains unchanged.`, + changes: [], + updatedBudget: { + budgetName: currentBudget.BudgetName, + budgetLimit: { + amount: currentBudget.BudgetLimit.Amount, + unit: currentBudget.BudgetLimit.Unit, + }, + timeUnit: currentBudget.TimeUnit, + timePeriod: { + start: currentBudget.TimePeriod.Start, + end: currentBudget.TimePeriod.End, + }, + }, + }; + } + + // Update the budget + await client.updateBudget(ctx.accountId, updatedBudget); + + return { + success: true, + budgetName, + message: + `Budget "${budgetName}" updated successfully with ${changes.length} change(s).`, + changes, + updatedBudget: { + budgetName: updatedBudget.BudgetName, + budgetLimit: { + amount: updatedBudget.BudgetLimit.Amount, + unit: updatedBudget.BudgetLimit.Unit, + }, + timeUnit: updatedBudget.TimeUnit, + timePeriod: { + start: updatedBudget.TimePeriod.Start, + end: updatedBudget.TimePeriod.End, + }, + }, + }; + } catch (error) { + console.error("Error updating budget:", error); + + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + return { + success: false, + budgetName, + message: `Failed to update budget: ${errorMessage}`, + changes: [], + }; + } +} diff --git a/aws/client.ts b/aws/client.ts new file mode 100644 index 000000000..558054d0a --- /dev/null +++ b/aws/client.ts @@ -0,0 +1,856 @@ +import { createHash, createHmac } from "node:crypto"; + +export interface AWSCredentials { + accessKeyId: string; + secretAccessKey: string; + region?: string; + sessionToken?: string | null; +} + +export interface DateInterval { + Start: string; // Format: YYYY-MM-DD + End: string; // Format: YYYY-MM-DD +} + +export interface GroupDefinition { + Type: "DIMENSION" | "TAG" | "COST_CATEGORY"; + Key: string; +} + +export interface Metric { + Key: + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost" + | "UsageQuantity" + | "NormalizedUsageAmount"; + MatchOptions?: Array< + | "EQUALS" + | "ABSENT" + | "STARTS_WITH" + | "ENDS_WITH" + | "CONTAINS" + | "CASE_SENSITIVE" + | "CASE_INSENSITIVE" + >; + Values?: string[]; +} + +export interface Expression { + Or?: Expression[]; + And?: Expression[]; + Not?: Expression; + Dimensions?: { + Key: string; + Values: string[]; + MatchOptions?: Array< + | "EQUALS" + | "ABSENT" + | "STARTS_WITH" + | "ENDS_WITH" + | "CONTAINS" + | "CASE_SENSITIVE" + | "CASE_INSENSITIVE" + >; + }; + Tags?: { + Key: string; + Values: string[]; + MatchOptions?: Array< + | "EQUALS" + | "ABSENT" + | "STARTS_WITH" + | "ENDS_WITH" + | "CONTAINS" + | "CASE_SENSITIVE" + | "CASE_INSENSITIVE" + >; + }; + CostCategories?: { + Key: string; + Values: string[]; + MatchOptions?: Array< + | "EQUALS" + | "ABSENT" + | "STARTS_WITH" + | "ENDS_WITH" + | "CONTAINS" + | "CASE_SENSITIVE" + | "CASE_INSENSITIVE" + >; + }; +} + +export interface GetCostAndUsageRequest { + TimePeriod: DateInterval; + Granularity: "DAILY" | "MONTHLY" | "HOURLY"; + Metrics: string[]; + GroupBy?: GroupDefinition[]; + Filter?: Expression; + NextPageToken?: string; +} + +export interface GetCostAndUsageResponse { + NextPageToken?: string; + GroupDefinitions?: GroupDefinition[]; + ResultsByTime: Array<{ + TimePeriod: DateInterval; + Total: Record; + Groups?: Array<{ + Keys: string[]; + Metrics: Record; + }>; + Estimated: boolean; + }>; + DimensionKey?: string; +} + +export interface GetCostForecastRequest { + TimePeriod: DateInterval; + Metric: + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost" + | "UsageQuantity" + | "NormalizedUsageAmount"; + Granularity: "DAILY" | "MONTHLY"; + Filter?: Expression; + PredictionIntervalLevel?: number; +} + +export interface GetCostForecastResponse { + Total: { + Amount: string; + Unit: string; + }; + ForecastResultsByTime: Array<{ + TimePeriod: DateInterval; + MeanValue: string; + PredictionIntervalLowerBound: string; + PredictionIntervalUpperBound: string; + }>; +} + +export interface GetDimensionValuesRequest { + SearchString?: string; + TimePeriod: DateInterval; + Dimension: + | "AZ" + | "INSTANCE_TYPE" + | "KEY" + | "LINKED_ACCOUNT" + | "OPERATION" + | "PURCHASE_TYPE" + | "REGION" + | "SERVICE" + | "USAGE_TYPE" + | "USAGE_TYPE_GROUP" + | "RECORD_TYPE" + | "OPERATING_SYSTEM" + | "TENANCY" + | "SCOPE" + | "PLATFORM" + | "SUBSCRIPTION_ID" + | "LEGAL_ENTITY_NAME" + | "DEPLOYMENT_OPTION" + | "DATABASE_ENGINE" + | "CACHE_ENGINE" + | "INSTANCE_TYPE_FAMILY" + | "BILLING_ENTITY" + | "RESERVATION_ID" + | "RESOURCE_ID" + | "RIGHTSIZING_TYPE" + | "SAVINGS_PLANS_TYPE" + | "SAVINGS_PLAN_ARN" + | "PAYMENT_OPTION" + | "AGREEMENT_END_DATE_TIME_AFTER" + | "AGREEMENT_END_DATE_TIME_BEFORE" + | "INVOICING_ENTITY" + | "ANOMALY_TOTAL_IMPACT_ABSOLUTE" + | "ANOMALY_TOTAL_IMPACT_PERCENTAGE"; + Context?: "COST_AND_USAGE" | "RESERVATIONS" | "SAVINGS_PLANS"; + Filter?: Expression; + SortBy?: Array<{ + Key: string; + SortOrder: "ASCENDING" | "DESCENDING"; + }>; + NextPageToken?: string; + MaxResults?: number; +} + +export interface GetDimensionValuesResponse { + DimensionValues: Array<{ + Value: string; + Attributes: Record; + MatchOptions: string[]; + }>; + ReturnSize: number; + TotalSize: number; + NextPageToken?: string; +} + +export interface GetAnomaliesRequest { + MonitorArn?: string; + DateInterval: DateInterval; + Feedback?: "YES" | "NO" | "PLANNED_ACTIVITY"; + TotalImpact?: { + NumericOperator: + | "EQUAL" + | "GREATER_THAN_OR_EQUAL" + | "LESS_THAN_OR_EQUAL" + | "GREATER_THAN" + | "LESS_THAN" + | "BETWEEN"; + StartValue: number; + EndValue?: number; + }; + NextPageToken?: string; + MaxResults?: number; +} + +export interface AnomalyData { + AnomalyId: string; + AnomalyStartDate: string; + AnomalyEndDate: string; + DimensionKey: string; + RootCauses: Array<{ + Service: string; + Region: string; + UsageType: string; + }>; + AnomalyScore: { + MaxScore: number; + CurrentScore: number; + }; + Impact: { + MaxImpact: number; + TotalImpact: number; + TotalActualSpend: number; + TotalExpectedSpend: number; + TotalImpactPercentage: number; + }; + MonitorArn: string; + Feedback?: "YES" | "NO" | "PLANNED_ACTIVITY"; +} + +export interface GetAnomaliesResponse { + Anomalies: AnomalyData[]; + NextPageToken?: string; +} + +export interface GetBudgetsRequest { + AccountId: string; + MaxResults?: number; + NextToken?: string; +} + +export interface Budget { + BudgetName: string; + BudgetLimit: { + Amount: string; + Unit: string; + }; + CostFilters?: Record; + TimeUnit: "DAILY" | "MONTHLY" | "QUARTERLY" | "ANNUALLY"; + TimePeriod: { + Start: string; + End: string; + }; + CalculatedSpend: { + ActualSpend: { + Amount: string; + Unit: string; + }; + ForecastedSpend?: { + Amount: string; + Unit: string; + }; + }; + BudgetType: + | "USAGE" + | "COST" + | "RI_UTILIZATION" + | "RI_COVERAGE" + | "SAVINGS_PLANS_UTILIZATION" + | "SAVINGS_PLANS_COVERAGE"; + LastUpdatedTime: string; +} + +export interface GetBudgetsResponse { + Budgets: Budget[]; + NextToken?: string; +} + +export class AWSCostExplorerClient { + private credentials: AWSCredentials; + private baseUrl: string; + + constructor(credentials: AWSCredentials) { + this.credentials = credentials; + this.baseUrl = `https://ce.us-east-1.amazonaws.com`; + } + + private signRequest( + method: string, + path: string, + body: string, + headers: Record, + ): Record { + const now = new Date(); + const isoDateTime = now.toISOString().replace(/[:\-]|\.\d{3}/g, ""); + const isoDate = isoDateTime.substr(0, 8); + + // AWS Cost Explorer is only available in us-east-1 + const region = "us-east-1"; + const service = "ce"; + + // Create canonical request + const canonicalHeaders = Object.keys(headers) + .sort() + .map((key) => `${key.toLowerCase()}:${headers[key]}`) + .join("\n"); + + const signedHeaders = Object.keys(headers) + .sort() + .map((key) => key.toLowerCase()) + .join(";"); + + const bodyHash = createHash("sha256").update(body).digest("hex"); + + const canonicalRequest = [ + method, + path, + "", // query string + canonicalHeaders, + "", + signedHeaders, + bodyHash, + ].join("\n"); + + // Create string to sign + const credentialScope = `${isoDate}/${region}/${service}/aws4_request`; + const algorithm = "AWS4-HMAC-SHA256"; + const canonicalRequestHash = createHash("sha256").update(canonicalRequest) + .digest("hex"); + + const stringToSign = [ + algorithm, + isoDateTime, + credentialScope, + canonicalRequestHash, + ].join("\n"); + + // Calculate signature + const kDate = createHmac( + "sha256", + `AWS4${this.credentials.secretAccessKey}`, + ).update(isoDate).digest(); + const kRegion = createHmac("sha256", kDate).update(region).digest(); + const kService = createHmac("sha256", kRegion).update(service).digest(); + const kSigning = createHmac("sha256", kService).update("aws4_request") + .digest(); + const signature = createHmac("sha256", kSigning).update(stringToSign) + .digest("hex"); + + const authorizationHeader = + `${algorithm} Credential=${this.credentials.accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`; + + return { + ...headers, + "Authorization": authorizationHeader, + "X-Amz-Date": isoDateTime, + ...(this.credentials.sessionToken && + { "X-Amz-Security-Token": this.credentials.sessionToken }), + }; + } + + // deno-lint-ignore no-explicit-any + private async makeRequest(target: string, body: any): Promise { + const requestBody = JSON.stringify(body); + const headers = { + "Content-Type": "application/x-amz-json-1.1", + "X-Amz-Target": target, + "Host": new URL(this.baseUrl).host, + "User-Agent": "deco-aws-app/1.0", + "Accept": "application/json", + "Content-Length": requestBody.length.toString(), + }; + + const signedHeaders = await this.signRequest( + "POST", + "/", + requestBody, + headers, + ); + + const response = await fetch(this.baseUrl, { + method: "POST", + headers: signedHeaders, + body: requestBody, + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`AWS API Error (${response.status}): ${errorText}`); + } + + // Check if response has content + const responseText = await response.text(); + + if (!responseText) { + throw new Error("AWS API returned empty response"); + } + + try { + return JSON.parse(responseText); + } catch (parseError) { + const errorMessage = parseError instanceof Error + ? parseError.message + : "Unknown JSON parse error"; + throw new Error( + `Failed to parse AWS API response as JSON: ${errorMessage}`, + ); + } + } + + getCostAndUsage( + request: GetCostAndUsageRequest, + ): Promise { + return this.makeRequest("AWSInsightsIndexService.GetCostAndUsage", request); + } + + getCostForecast( + request: GetCostForecastRequest, + ): Promise { + return this.makeRequest("AWSInsightsIndexService.GetCostForecast", request); + } + + getDimensionValues( + request: GetDimensionValuesRequest, + ): Promise { + return this.makeRequest( + "AWSInsightsIndexService.GetDimensionValues", + request, + ); + } + + getAnomalies( + request: GetAnomaliesRequest, + ): Promise { + return this.makeRequest("AWSInsightsIndexService.GetAnomalies", request); + } + + getUsageForecast(request: { + TimePeriod: DateInterval; + Metric: "UsageQuantity" | "NormalizedUsageAmount"; + Granularity: "DAILY" | "MONTHLY"; + Filter?: Expression; + PredictionIntervalLevel?: number; + }): Promise { + return this.makeRequest( + "AWSInsightsIndexService.GetUsageForecast", + request, + ); + } + + getReservationCoverage(request: { + TimePeriod: DateInterval; + GroupBy?: GroupDefinition[]; + Granularity?: "DAILY" | "MONTHLY"; + Filter?: Expression; + Metrics?: string[]; + NextPageToken?: string; + SortBy?: { + Key: string; + SortOrder: "ASCENDING" | "DESCENDING"; + }; + MaxResults?: number; + }): Promise<{ + CoveragesByTime: Array<{ + TimePeriod: DateInterval; + Groups?: Array<{ + Attributes: Record; + Coverage: { + CoverageHours: { + OnDemandHours: string; + ReservedHours: string; + TotalRunningHours: string; + CoverageHoursPercentage: string; + }; + CoverageNormalizedUnits: { + OnDemandNormalizedUnits: string; + ReservedNormalizedUnits: string; + TotalRunningNormalizedUnits: string; + CoverageNormalizedUnitsPercentage: string; + }; + CoverageCost: { + OnDemandCost: string; + }; + }; + }>; + Total?: { + CoverageHours: { + OnDemandHours: string; + ReservedHours: string; + TotalRunningHours: string; + CoverageHoursPercentage: string; + }; + CoverageNormalizedUnits: { + OnDemandNormalizedUnits: string; + ReservedNormalizedUnits: string; + TotalRunningNormalizedUnits: string; + CoverageNormalizedUnitsPercentage: string; + }; + CoverageCost: { + OnDemandCost: string; + }; + }; + }>; + NextPageToken?: string; + }> { + return this.makeRequest( + "AWSInsightsIndexService.GetReservationCoverage", + request, + ); + } + + getSavingsPlansUtilization(request: { + TimePeriod: DateInterval; + Granularity?: "DAILY" | "MONTHLY"; + Filter?: Expression; + SortBy?: { + Key: string; + SortOrder: "ASCENDING" | "DESCENDING"; + }; + NextToken?: string; + MaxResults?: number; + }): Promise<{ + SavingsPlansUtilizationsByTime: Array<{ + TimePeriod: DateInterval; + Utilization: { + TotalCommitment: string; + UsedCommitment: string; + UnusedCommitment: string; + UtilizationPercentage: string; + }; + Savings: { + NetSavings: string; + OnDemandCostEquivalent: string; + }; + AmortizedCommitment: { + AmortizedRecurringCommitment: string; + AmortizedUpfrontCommitment: string; + TotalAmortizedCommitment: string; + }; + }>; + Total: { + Utilization: { + TotalCommitment: string; + UsedCommitment: string; + UnusedCommitment: string; + UtilizationPercentage: string; + }; + Savings: { + NetSavings: string; + OnDemandCostEquivalent: string; + }; + AmortizedCommitment: { + AmortizedRecurringCommitment: string; + AmortizedUpfrontCommitment: string; + TotalAmortizedCommitment: string; + }; + }; + NextToken?: string; + }> { + return this.makeRequest( + "AWSInsightsIndexService.GetSavingsPlansUtilization", + request, + ); + } +} + +export class AWSBudgetsClient { + private credentials: AWSCredentials; + private baseUrl: string; + + constructor(credentials: AWSCredentials) { + this.credentials = credentials; + this.baseUrl = `https://budgets.us-east-1.amazonaws.com`; + } + + private signRequest( + method: string, + path: string, + body: string, + headers: Record, + ): Record { + const now = new Date(); + const isoDateTime = now.toISOString().replace(/[:\-]|\.\d{3}/g, ""); + const isoDate = isoDateTime.substr(0, 8); + + // AWS Budgets is only available in us-east-1 + const region = "us-east-1"; + const service = "budgets"; + + // Create canonical request + const canonicalHeaders = Object.keys(headers) + .sort() + .map((key) => `${key.toLowerCase()}:${headers[key]}`) + .join("\n"); + + const signedHeaders = Object.keys(headers) + .sort() + .map((key) => key.toLowerCase()) + .join(";"); + + const bodyHash = createHash("sha256").update(body).digest("hex"); + + const canonicalRequest = [ + method, + path, + "", // query string + canonicalHeaders, + "", + signedHeaders, + bodyHash, + ].join("\n"); + + // Create string to sign + const credentialScope = `${isoDate}/${region}/${service}/aws4_request`; + const algorithm = "AWS4-HMAC-SHA256"; + const canonicalRequestHash = createHash("sha256").update(canonicalRequest) + .digest("hex"); + + const stringToSign = [ + algorithm, + isoDateTime, + credentialScope, + canonicalRequestHash, + ].join("\n"); + + // Calculate signature + const kDate = createHmac( + "sha256", + `AWS4${this.credentials.secretAccessKey}`, + ).update(isoDate).digest(); + const kRegion = createHmac("sha256", kDate).update(region).digest(); + const kService = createHmac("sha256", kRegion).update(service).digest(); + const kSigning = createHmac("sha256", kService).update("aws4_request") + .digest(); + const signature = createHmac("sha256", kSigning).update(stringToSign) + .digest("hex"); + + const authorizationHeader = + `${algorithm} Credential=${this.credentials.accessKeyId}/${credentialScope}, SignedHeaders=${signedHeaders}, Signature=${signature}`; + + return { + ...headers, + "Authorization": authorizationHeader, + "X-Amz-Date": isoDateTime, + ...(this.credentials.sessionToken && + { "X-Amz-Security-Token": this.credentials.sessionToken }), + }; + } + + // deno-lint-ignore no-explicit-any + private async makeRequest(target: string, body: any): Promise { + const requestBody = JSON.stringify(body); + const headers = { + "Content-Type": "application/x-amz-json-1.1", + "X-Amz-Target": target, + "Host": new URL(this.baseUrl).host, + "User-Agent": "deco-aws-app/1.0", + "Accept": "application/json", + "Content-Length": requestBody.length.toString(), + }; + + const signedHeaders = await this.signRequest( + "POST", + "/", + requestBody, + headers, + ); + + const response = await fetch(this.baseUrl, { + method: "POST", + headers: signedHeaders, + body: requestBody, + }); + + if (!response.ok) { + const errorText = await response.text(); + throw new Error(`AWS API Error (${response.status}): ${errorText}`); + } + + // Check if response has content + const responseText = await response.text(); + + if (!responseText) { + throw new Error("AWS API returned empty response"); + } + + try { + return JSON.parse(responseText); + } catch (parseError) { + const errorMessage = parseError instanceof Error + ? parseError.message + : "Unknown JSON parse error"; + throw new Error( + `Failed to parse AWS API response as JSON: ${errorMessage}`, + ); + } + } + + getBudgets(request: GetBudgetsRequest): Promise { + return this.makeRequest("AWSBudgetServiceGateway.DescribeBudgets", request); + } + + getBudget( + accountId: string, + budgetName: string, + ): Promise<{ Budget: Budget }> { + return this.makeRequest("AWSBudgetServiceGateway.DescribeBudget", { + AccountId: accountId, + BudgetName: budgetName, + }); + } + + createBudget( + accountId: string, + budget: Omit, + ): Promise { + return this.makeRequest("AWSBudgetServiceGateway.CreateBudget", { + AccountId: accountId, + Budget: budget, + }); + } + + updateBudget(accountId: string, budget: Budget): Promise { + return this.makeRequest("AWSBudgetServiceGateway.ModifyBudget", { + AccountId: accountId, + NewBudget: budget, + }); + } + + deleteBudget(accountId: string, budgetName: string): Promise { + return this.makeRequest("AWSBudgetServiceGateway.DeleteBudget", { + AccountId: accountId, + BudgetName: budgetName, + }); + } +} + +// Utility functions for common operations +export class AWSCostUtils { + static formatCurrency(amount: string, unit: string = "USD"): string { + const num = parseFloat(amount); + return new Intl.NumberFormat("en-US", { + style: "currency", + currency: unit, + minimumFractionDigits: 2, + maximumFractionDigits: 2, + }).format(num); + } + + static getDateRange(days: number): DateInterval { + const end = new Date(); + const start = new Date(); + start.setDate(start.getDate() - days); + + return { + Start: start.toISOString().split("T")[0], + End: end.toISOString().split("T")[0], + }; + } + + static getMonthlyDateRange(months: number): DateInterval { + const end = new Date(); + const start = new Date(); + start.setMonth(start.getMonth() - months); + start.setDate(1); // Start of month + + return { + Start: start.toISOString().split("T")[0], + End: end.toISOString().split("T")[0], + }; + } + + static getCurrentMonth(): DateInterval { + const now = new Date(); + const start = new Date(now.getFullYear(), now.getMonth(), 1); + const end = new Date(now.getFullYear(), now.getMonth() + 1, 0); + + return { + Start: start.toISOString().split("T")[0], + End: end.toISOString().split("T")[0], + }; + } + + static getLastMonth(): DateInterval { + const now = new Date(); + const start = new Date(now.getFullYear(), now.getMonth() - 1, 1); + const end = new Date(now.getFullYear(), now.getMonth(), 0); + + return { + Start: start.toISOString().split("T")[0], + End: end.toISOString().split("T")[0], + }; + } + + static calculateCostDifference(current: string, previous: string): { + difference: number; + percentage: number; + isIncrease: boolean; + } { + const currentAmount = parseFloat(current); + const previousAmount = parseFloat(previous); + const difference = currentAmount - previousAmount; + const percentage = previousAmount !== 0 + ? (difference / previousAmount) * 100 + : 0; + + return { + difference: Math.abs(difference), + percentage: Math.abs(percentage), + isIncrease: difference > 0, + }; + } + + static groupByService( + results: GetCostAndUsageResponse, + ): Record { + const serviceMap: Record = {}; + + for (const result of results.ResultsByTime) { + if (result.Groups) { + for (const group of result.Groups) { + const serviceName = group.Keys[0] || "Unknown"; + const cost = parseFloat(group.Metrics.BlendedCost?.Amount || "0"); + serviceMap[serviceName] = (serviceMap[serviceName] || 0) + cost; + } + } + } + + return serviceMap; + } + + static getTopServices( + serviceMap: Record, + limit: number = 10, + ): Array<{ service: string; cost: number }> { + return Object.entries(serviceMap) + .map(([service, cost]) => ({ service, cost })) + .sort((a, b) => b.cost - a.cost) + .slice(0, limit); + } +} diff --git a/aws/loaders/anomalies.ts b/aws/loaders/anomalies.ts new file mode 100644 index 000000000..04bf19360 --- /dev/null +++ b/aws/loaders/anomalies.ts @@ -0,0 +1,443 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to look back for anomalies + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + endDate?: string; + + /** + * @title Monitor ARN + * @description Specific anomaly monitor ARN to filter results + */ + monitorArn?: string; + + /** + * @title Feedback Filter + * @description Filter by feedback status + */ + feedbackFilter?: "YES" | "NO" | "PLANNED_ACTIVITY"; + + /** + * @title Minimum Impact Amount + * @description Minimum impact amount to filter anomalies (in USD) + * @default 10 + */ + minImpactAmount?: number; + + /** + * @title Max Results + * @description Maximum number of anomalies to return + * @default 50 + */ + maxResults?: number; + + /** + * @title Include Root Cause Analysis + * @description Include detailed root cause analysis + * @default true + */ + includeRootCauseAnalysis?: boolean; +} + +export interface ProcessedAnomaly { + anomalyId: string; + dateRange: { + start: string; + end: string; + }; + dimensionKey: string; + rootCauses: Array<{ + service: string; + region: string; + usageType: string; + }>; + score: { + max: number; + current: number; + severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + }; + impact: { + maxImpact: { + amount: string; + formatted: string; + }; + totalImpact: { + amount: string; + formatted: string; + }; + totalActualSpend: { + amount: string; + formatted: string; + }; + totalExpectedSpend: { + amount: string; + formatted: string; + }; + impactPercentage: number; + }; + monitorArn: string; + feedback?: "YES" | "NO" | "PLANNED_ACTIVITY"; + description: string; + recommendations: string[]; +} + +export interface AnomaliesResponse { + anomalies: ProcessedAnomaly[]; + summary: { + totalAnomalies: number; + totalImpactAmount: { + amount: string; + formatted: string; + }; + averageImpact: { + amount: string; + formatted: string; + }; + severityBreakdown: { + critical: number; + high: number; + medium: number; + low: number; + }; + topServices: Array<{ + service: string; + anomalyCount: number; + totalImpact: string; + }>; + topRegions: Array<{ + region: string; + anomalyCount: number; + totalImpact: string; + }>; + }; + insights: { + trendAnalysis: string; + riskLevel: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + actionableInsights: string[]; + }; + metadata: { + dateRange: DateInterval; + generatedAt: string; + monitorArn?: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + monitorArn, + feedbackFilter, + minImpactAmount = 10, + maxResults = 50, + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + if (!ctx.enableAnomalyDetection) { + throw new Error("Anomaly detection is disabled in the app configuration."); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let dateInterval: DateInterval; + if (startDate && endDate) { + dateInterval = { Start: startDate, End: endDate }; + } else { + dateInterval = AWSCostUtils.getDateRange(timePeriodDays); + } + + try { + const response = await client.getAnomalies({ + MonitorArn: monitorArn, + DateInterval: dateInterval, + Feedback: feedbackFilter, + TotalImpact: minImpactAmount > 0 + ? { + NumericOperator: "GREATER_THAN_OR_EQUAL", + StartValue: minImpactAmount, + } + : undefined, + MaxResults: maxResults, + }); + + // Process anomalies + const processedAnomalies: ProcessedAnomaly[] = response.Anomalies.map( + (anomaly) => { + // Determine severity based on impact and score + let severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + const impact = anomaly.Impact.TotalImpact; + const score = anomaly.AnomalyScore.CurrentScore; + + if (impact > 1000 || score > 90) { + severity = "CRITICAL"; + } else if (impact > 500 || score > 70) { + severity = "HIGH"; + } else if (impact > 100 || score > 50) { + severity = "MEDIUM"; + } else { + severity = "LOW"; + } + + // Generate description + const primaryService = anomaly.RootCauses[0]?.Service || + "Unknown Service"; + const primaryRegion = anomaly.RootCauses[0]?.Region || "Unknown Region"; + const description = + `Anomaly detected in ${primaryService} (${primaryRegion}) with ${ + anomaly.Impact.TotalImpactPercentage.toFixed(1) + }% cost increase`; + + // Generate recommendations + const recommendations: string[] = []; + + if (severity === "CRITICAL" || severity === "HIGH") { + recommendations.push( + "Immediately investigate the root cause and consider scaling down resources if appropriate", + ); + } + + if (anomaly.RootCauses.length > 1) { + recommendations.push( + "Review multiple affected services for coordinated cost optimization", + ); + } + + if (anomaly.Impact.TotalImpactPercentage > 50) { + recommendations.push( + "Consider setting up budget alerts for this service/region combination", + ); + } + + recommendations.push( + `Monitor ${primaryService} usage patterns and consider reserved instances or savings plans`, + ); + + return { + anomalyId: anomaly.AnomalyId, + dateRange: { + start: anomaly.AnomalyStartDate, + end: anomaly.AnomalyEndDate, + }, + dimensionKey: anomaly.DimensionKey, + rootCauses: anomaly.RootCauses.map((cause) => ({ + service: cause.Service, + region: cause.Region, + usageType: cause.UsageType, + })), + score: { + max: anomaly.AnomalyScore.MaxScore, + current: anomaly.AnomalyScore.CurrentScore, + severity, + }, + impact: { + maxImpact: { + amount: anomaly.Impact.MaxImpact.toString(), + formatted: AWSCostUtils.formatCurrency( + anomaly.Impact.MaxImpact.toString(), + ), + }, + totalImpact: { + amount: anomaly.Impact.TotalImpact.toString(), + formatted: AWSCostUtils.formatCurrency( + anomaly.Impact.TotalImpact.toString(), + ), + }, + totalActualSpend: { + amount: anomaly.Impact.TotalActualSpend.toString(), + formatted: AWSCostUtils.formatCurrency( + anomaly.Impact.TotalActualSpend.toString(), + ), + }, + totalExpectedSpend: { + amount: anomaly.Impact.TotalExpectedSpend.toString(), + formatted: AWSCostUtils.formatCurrency( + anomaly.Impact.TotalExpectedSpend.toString(), + ), + }, + impactPercentage: anomaly.Impact.TotalImpactPercentage, + }, + monitorArn: anomaly.MonitorArn, + feedback: anomaly.Feedback, + description, + recommendations, + }; + }, + ); + + // Calculate summary statistics + const totalImpact = processedAnomalies.reduce( + (sum, anomaly) => sum + parseFloat(anomaly.impact.totalImpact.amount), + 0, + ); + + const averageImpact = processedAnomalies.length > 0 + ? totalImpact / processedAnomalies.length + : 0; + + const severityBreakdown = { + critical: processedAnomalies.filter((a) => + a.score.severity === "CRITICAL" + ).length, + high: processedAnomalies.filter((a) => + a.score.severity === "HIGH" + ).length, + medium: processedAnomalies.filter((a) => + a.score.severity === "MEDIUM" + ).length, + low: processedAnomalies.filter((a) => a.score.severity === "LOW").length, + }; + + // Analyze top services and regions + const serviceMap = new Map(); + const regionMap = new Map(); + + processedAnomalies.forEach((anomaly) => { + anomaly.rootCauses.forEach((cause) => { + // Services + const serviceData = serviceMap.get(cause.service) || + { count: 0, impact: 0 }; + serviceData.count++; + serviceData.impact += parseFloat(anomaly.impact.totalImpact.amount); + serviceMap.set(cause.service, serviceData); + + // Regions + const regionData = regionMap.get(cause.region) || + { count: 0, impact: 0 }; + regionData.count++; + regionData.impact += parseFloat(anomaly.impact.totalImpact.amount); + regionMap.set(cause.region, regionData); + }); + }); + + const topServices = Array.from(serviceMap.entries()) + .map(([service, data]) => ({ + service, + anomalyCount: data.count, + totalImpact: AWSCostUtils.formatCurrency(data.impact.toString()), + })) + .sort((a, b) => b.anomalyCount - a.anomalyCount) + .slice(0, 5); + + const topRegions = Array.from(regionMap.entries()) + .map(([region, data]) => ({ + region, + anomalyCount: data.count, + totalImpact: AWSCostUtils.formatCurrency(data.impact.toString()), + })) + .sort((a, b) => b.anomalyCount - a.anomalyCount) + .slice(0, 5); + + // Generate insights + let riskLevel: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + if (severityBreakdown.critical > 0) { + riskLevel = "CRITICAL"; + } else if (severityBreakdown.high > 2) { + riskLevel = "HIGH"; + } else if (severityBreakdown.high > 0 || severityBreakdown.medium > 3) { + riskLevel = "MEDIUM"; + } else { + riskLevel = "LOW"; + } + + const actionableInsights: string[] = []; + + if (processedAnomalies.length === 0) { + actionableInsights.push( + "No significant cost anomalies detected in the specified period", + ); + } else { + if (severityBreakdown.critical > 0) { + actionableInsights.push( + `${severityBreakdown.critical} critical anomalies require immediate attention`, + ); + } + + if (topServices.length > 0) { + actionableInsights.push( + `${topServices[0].service} has the most anomalies (${ + topServices[0].anomalyCount + })`, + ); + } + + if (totalImpact > 1000) { + actionableInsights.push( + `Total anomaly impact of ${ + AWSCostUtils.formatCurrency(totalImpact.toString()) + } suggests systematic cost optimization opportunities`, + ); + } + } + + const trendAnalysis = processedAnomalies.length > 0 + ? `Detected ${processedAnomalies.length} anomalies with average impact of ${ + AWSCostUtils.formatCurrency(averageImpact.toString()) + }. Risk level: ${riskLevel}.` + : "No significant anomalies detected. Cost patterns appear normal."; + + return { + anomalies: processedAnomalies, + summary: { + totalAnomalies: processedAnomalies.length, + totalImpactAmount: { + amount: totalImpact.toString(), + formatted: AWSCostUtils.formatCurrency(totalImpact.toString()), + }, + averageImpact: { + amount: averageImpact.toString(), + formatted: AWSCostUtils.formatCurrency(averageImpact.toString()), + }, + severityBreakdown, + topServices, + topRegions, + }, + insights: { + trendAnalysis, + riskLevel, + actionableInsights, + }, + metadata: { + dateRange: dateInterval, + generatedAt: new Date().toISOString(), + monitorArn, + }, + }; + } catch (error) { + console.error("Error fetching anomaly data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch anomaly data: ${errorMessage}`); + } +} diff --git a/aws/loaders/budgets.ts b/aws/loaders/budgets.ts new file mode 100644 index 000000000..a82f6553f --- /dev/null +++ b/aws/loaders/budgets.ts @@ -0,0 +1,348 @@ +import { AppContext } from "../mod.ts"; +import { AWSBudgetsClient, AWSCostUtils } from "../client.ts"; +import type { Budget } from "../client.ts"; + +export interface Props { + /** + * @title Budget Name Filter + * @description Filter by specific budget name (optional) + */ + budgetName?: string; + + /** + * @title Max Results + * @description Maximum number of budgets to return + * @default 20 + */ + maxResults?: number; + + /** + * @title Include Budget Performance + * @description Calculate budget performance metrics + * @default true + */ + includeBudgetPerformance?: boolean; +} + +export interface BudgetPerformance { + budgetName: string; + budgetLimit: { + amount: string; + unit: string; + formatted: string; + }; + actualSpend: { + amount: string; + unit: string; + formatted: string; + }; + forecastedSpend?: { + amount: string; + unit: string; + formatted: string; + }; + utilizationPercentage: number; + remainingBudget: { + amount: string; + unit: string; + formatted: string; + }; + status: "UNDER_BUDGET" | "ON_TRACK" | "OVER_BUDGET" | "FORECASTED_OVER"; + timeUnit: string; + timePeriod: { + start: string; + end: string; + }; + lastUpdated: string; + budgetType: string; + daysRemaining?: number; + projectedOverage?: { + amount: string; + formatted: string; + }; +} + +export interface BudgetsResponse { + budgets: BudgetPerformance[]; + summary: { + totalBudgets: number; + totalBudgetAmount: { + amount: string; + unit: string; + formatted: string; + }; + totalActualSpend: { + amount: string; + unit: string; + formatted: string; + }; + averageUtilization: number; + budgetsOverLimit: number; + budgetsOnTrack: number; + budgetsUnderUtilized: number; + }; + alerts: Array<{ + budgetName: string; + alertType: "OVER_BUDGET" | "FORECASTED_OVER" | "HIGH_UTILIZATION"; + message: string; + severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + }>; + metadata: { + accountId: string; + generatedAt: string; + currency: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + budgetName, + maxResults = 20, + } = props; + + // Validate credentials and account ID + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + if (!ctx.accountId) { + throw new Error( + "AWS Account ID not configured. Please set accountId in the app configuration.", + ); + } + + const client = new AWSBudgetsClient(ctx.credentials); + + try { + let budgets: Budget[]; + + if (budgetName) { + // Get specific budget + const response = await client.getBudget(ctx.accountId, budgetName); + budgets = [response.Budget]; + } else { + // Get all budgets + const response = await client.getBudgets({ + AccountId: ctx.accountId, + MaxResults: maxResults, + }); + budgets = response.Budgets; + } + + // Process budget data and calculate performance metrics + const budgetPerformances: BudgetPerformance[] = budgets.map((budget) => { + const limitAmount = parseFloat(budget.BudgetLimit.Amount); + const actualAmount = parseFloat( + budget.CalculatedSpend.ActualSpend.Amount, + ); + const forecastedAmount = budget.CalculatedSpend.ForecastedSpend + ? parseFloat(budget.CalculatedSpend.ForecastedSpend.Amount) + : undefined; + + const utilizationPercentage = limitAmount > 0 + ? (actualAmount / limitAmount) * 100 + : 0; + const remainingAmount = Math.max(0, limitAmount - actualAmount); + + // Determine status + let status: + | "UNDER_BUDGET" + | "ON_TRACK" + | "OVER_BUDGET" + | "FORECASTED_OVER"; + if (actualAmount > limitAmount) { + status = "OVER_BUDGET"; + } else if (forecastedAmount && forecastedAmount > limitAmount) { + status = "FORECASTED_OVER"; + } else if (utilizationPercentage > 80) { + status = "ON_TRACK"; + } else { + status = "UNDER_BUDGET"; + } + + // Calculate days remaining in budget period + const endDate = new Date(budget.TimePeriod.End); + const now = new Date(); + const daysRemaining = Math.max( + 0, + Math.ceil((endDate.getTime() - now.getTime()) / (1000 * 60 * 60 * 24)), + ); + + // Calculate projected overage if forecasted to exceed + let projectedOverage: { amount: string; formatted: string } | undefined; + if (forecastedAmount && forecastedAmount > limitAmount) { + const overageAmount = forecastedAmount - limitAmount; + projectedOverage = { + amount: overageAmount.toString(), + formatted: AWSCostUtils.formatCurrency( + overageAmount.toString(), + budget.BudgetLimit.Unit, + ), + }; + } + + return { + budgetName: budget.BudgetName, + budgetLimit: { + amount: budget.BudgetLimit.Amount, + unit: budget.BudgetLimit.Unit, + formatted: AWSCostUtils.formatCurrency( + budget.BudgetLimit.Amount, + budget.BudgetLimit.Unit, + ), + }, + actualSpend: { + amount: budget.CalculatedSpend.ActualSpend.Amount, + unit: budget.CalculatedSpend.ActualSpend.Unit, + formatted: AWSCostUtils.formatCurrency( + budget.CalculatedSpend.ActualSpend.Amount, + budget.CalculatedSpend.ActualSpend.Unit, + ), + }, + forecastedSpend: budget.CalculatedSpend.ForecastedSpend + ? { + amount: budget.CalculatedSpend.ForecastedSpend.Amount, + unit: budget.CalculatedSpend.ForecastedSpend.Unit, + formatted: AWSCostUtils.formatCurrency( + budget.CalculatedSpend.ForecastedSpend.Amount, + budget.CalculatedSpend.ForecastedSpend.Unit, + ), + } + : undefined, + utilizationPercentage, + remainingBudget: { + amount: remainingAmount.toString(), + unit: budget.BudgetLimit.Unit, + formatted: AWSCostUtils.formatCurrency( + remainingAmount.toString(), + budget.BudgetLimit.Unit, + ), + }, + status, + timeUnit: budget.TimeUnit, + timePeriod: { + start: budget.TimePeriod.Start, + end: budget.TimePeriod.End, + }, + lastUpdated: budget.LastUpdatedTime, + budgetType: budget.BudgetType, + daysRemaining, + projectedOverage, + }; + }); + + // Calculate summary statistics + const totalBudgetAmount = budgetPerformances.reduce( + (sum, budget) => sum + parseFloat(budget.budgetLimit.amount), + 0, + ); + + const totalActualSpend = budgetPerformances.reduce( + (sum, budget) => sum + parseFloat(budget.actualSpend.amount), + 0, + ); + + const averageUtilization = budgetPerformances.length > 0 + ? budgetPerformances.reduce( + (sum, budget) => sum + budget.utilizationPercentage, + 0, + ) / budgetPerformances.length + : 0; + + const budgetsOverLimit = budgetPerformances.filter((b) => + b.status === "OVER_BUDGET" + ).length; + const budgetsOnTrack = budgetPerformances.filter((b) => + b.status === "ON_TRACK" + ).length; + const budgetsUnderUtilized = + budgetPerformances.filter((b) => b.status === "UNDER_BUDGET").length; + + // Generate alerts + const alerts: Array<{ + budgetName: string; + alertType: "OVER_BUDGET" | "FORECASTED_OVER" | "HIGH_UTILIZATION"; + message: string; + severity: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + }> = []; + + budgetPerformances.forEach((budget) => { + if (budget.status === "OVER_BUDGET") { + alerts.push({ + budgetName: budget.budgetName, + alertType: "OVER_BUDGET", + message: `Budget "${budget.budgetName}" has exceeded its limit by ${ + budget.utilizationPercentage.toFixed(1) + }%`, + severity: "CRITICAL", + }); + } else if (budget.status === "FORECASTED_OVER") { + alerts.push({ + budgetName: budget.budgetName, + alertType: "FORECASTED_OVER", + message: + `Budget "${budget.budgetName}" is forecasted to exceed its limit. Projected overage: ${ + budget.projectedOverage?.formatted || "N/A" + }`, + severity: "HIGH", + }); + } else if (budget.utilizationPercentage > 80) { + alerts.push({ + budgetName: budget.budgetName, + alertType: "HIGH_UTILIZATION", + message: `Budget "${budget.budgetName}" is at ${ + budget.utilizationPercentage.toFixed(1) + }% utilization`, + severity: budget.utilizationPercentage > 90 ? "HIGH" : "MEDIUM", + }); + } + }); + + const defaultCurrency = ctx.defaultCurrency || "USD"; + + return { + budgets: budgetPerformances, + summary: { + totalBudgets: budgetPerformances.length, + totalBudgetAmount: { + amount: totalBudgetAmount.toString(), + unit: defaultCurrency, + formatted: AWSCostUtils.formatCurrency( + totalBudgetAmount.toString(), + defaultCurrency, + ), + }, + totalActualSpend: { + amount: totalActualSpend.toString(), + unit: defaultCurrency, + formatted: AWSCostUtils.formatCurrency( + totalActualSpend.toString(), + defaultCurrency, + ), + }, + averageUtilization, + budgetsOverLimit, + budgetsOnTrack, + budgetsUnderUtilized, + }, + alerts, + metadata: { + accountId: ctx.accountId, + generatedAt: new Date().toISOString(), + currency: defaultCurrency, + }, + }; + } catch (error) { + console.error("Error fetching budget data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch budget data: ${errorMessage}`); + } +} diff --git a/aws/loaders/costAndUsage.ts b/aws/loaders/costAndUsage.ts new file mode 100644 index 000000000..5565fe055 --- /dev/null +++ b/aws/loaders/costAndUsage.ts @@ -0,0 +1,296 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval, Expression, GroupDefinition } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to look back for cost data + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + endDate?: string; + + /** + * @title Granularity + * @description The granularity of the cost data + * @default "DAILY" + */ + granularity?: "DAILY" | "MONTHLY" | "HOURLY"; + + /** + * @title Group By + * @description How to group the cost data + * @default "SERVICE" + */ + groupBy?: + | "SERVICE" + | "AZ" + | "INSTANCE_TYPE" + | "LINKED_ACCOUNT" + | "OPERATION" + | "PURCHASE_TYPE" + | "REGION" + | "USAGE_TYPE" + | "USAGE_TYPE_GROUP" + | "RECORD_TYPE" + | "OPERATING_SYSTEM" + | "TENANCY" + | "SCOPE" + | "PLATFORM"; + + /** + * @title Metrics + * @description Cost metrics to retrieve + * @default ["BlendedCost"] + */ + metrics?: Array< + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost" + | "UsageQuantity" + | "NormalizedUsageAmount" + >; + + /** + * @title Filter by Service + * @description Filter results by specific AWS service (e.g., "Amazon Elastic Compute Cloud - Compute") + */ + serviceFilter?: string; + + /** + * @title Include Forecasted Data + * @description Whether to include estimated/forecasted data + * @default true + */ + includeForecast?: boolean; + + /** + * @title Max Results + * @description Maximum number of results to return + * @default 100 + */ + maxResults?: number; +} + +export interface CostData { + timePeriod: DateInterval; + total: { + amount: string; + unit: string; + formatted: string; + }; + groups?: Array<{ + keys: string[]; + metrics: Record; + }>; + estimated: boolean; +} + +export interface CostAndUsageResponse { + costData: CostData[]; + summary: { + totalCost: { + amount: string; + unit: string; + formatted: string; + }; + timeRange: DateInterval; + granularity: string; + groupBy?: string; + topServices?: Array<{ + service: string; + cost: number; + formatted: string; + percentage: number; + }>; + }; + metadata: { + resultsCount: number; + hasMoreResults: boolean; + requestedAt: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + granularity = "DAILY", + groupBy = "SERVICE", + metrics = ["BlendedCost"], + serviceFilter, + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let timePeriod: DateInterval; + if (startDate && endDate) { + timePeriod = { Start: startDate, End: endDate }; + } else { + timePeriod = AWSCostUtils.getDateRange(timePeriodDays); + } + + // Build group by configuration + const groupByConfig: GroupDefinition[] = [{ + Type: "DIMENSION", + Key: groupBy, + }]; + + // Build filter if service is specified + let filter: Expression | undefined; + if (serviceFilter) { + filter = { + Dimensions: { + Key: "SERVICE", + Values: [serviceFilter], + MatchOptions: ["EQUALS"], + }, + }; + } + + try { + const response = await client.getCostAndUsage({ + TimePeriod: timePeriod, + Granularity: granularity, + Metrics: metrics, + GroupBy: groupByConfig, + Filter: filter, + }); + + // Process the response data + const costData: CostData[] = response.ResultsByTime.map((result) => { + const totalMetric = result.Total[metrics[0]]; + let totalAmount = parseFloat(totalMetric?.Amount || "0"); + + // If Total is 0 but we have groups (which happens when grouping by dimensions), + // calculate the total by summing up all the groups + if (totalAmount === 0 && result.Groups && result.Groups.length > 0) { + totalAmount = result.Groups.reduce((sum, group) => { + const groupAmount = parseFloat( + group.Metrics[metrics[0]]?.Amount || "0", + ); + return sum + groupAmount; + }, 0); + } + + const unit = totalMetric?.Unit || ctx.defaultCurrency || "USD"; + + return { + timePeriod: result.TimePeriod, + total: { + amount: totalAmount.toString(), + unit: unit, + formatted: AWSCostUtils.formatCurrency(totalAmount.toString(), unit), + }, + groups: result.Groups?.map((group) => ({ + keys: group.Keys, + metrics: Object.fromEntries( + Object.entries(group.Metrics).map(([key, value]) => [ + key, + { + amount: value.Amount, + unit: value.Unit, + formatted: AWSCostUtils.formatCurrency( + value.Amount, + value.Unit, + ), + }, + ]), + ), + })), + estimated: result.Estimated, + }; + }); + + // Calculate summary data - now using the corrected totals + const totalCost = costData.reduce((sum, data) => { + return sum + parseFloat(data.total.amount); + }, 0); + + const totalCostFormatted = AWSCostUtils.formatCurrency( + totalCost.toString(), + costData[0]?.total.unit || ctx.defaultCurrency || "USD", + ); + + // Calculate top services if grouped by service + let topServices: + | Array<{ + service: string; + cost: number; + formatted: string; + percentage: number; + }> + | undefined; + + if (groupBy === "SERVICE") { + const serviceMap = AWSCostUtils.groupByService(response); + const topServicesList = AWSCostUtils.getTopServices(serviceMap, 10); + + topServices = topServicesList.map(({ service, cost }) => ({ + service, + cost, + formatted: AWSCostUtils.formatCurrency(cost.toString()), + percentage: totalCost > 0 ? (cost / totalCost) * 100 : 0, + })); + } + + return { + costData, + summary: { + totalCost: { + amount: totalCost.toString(), + unit: costData[0]?.total.unit || ctx.defaultCurrency || "USD", + formatted: totalCostFormatted, + }, + timeRange: timePeriod, + granularity, + groupBy, + topServices, + }, + metadata: { + resultsCount: costData.length, + hasMoreResults: !!response.NextPageToken, + requestedAt: new Date().toISOString(), + }, + }; + } catch (error) { + console.error("Error fetching cost and usage data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch cost and usage data: ${errorMessage}`); + } +} diff --git a/aws/loaders/costBreakdown.ts b/aws/loaders/costBreakdown.ts new file mode 100644 index 000000000..e6ecb4471 --- /dev/null +++ b/aws/loaders/costBreakdown.ts @@ -0,0 +1,461 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval, GroupDefinition } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to analyze for cost breakdown + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + endDate?: string; + + /** + * @title Primary Dimension + * @description Primary dimension for cost breakdown + * @default "SERVICE" + */ + primaryDimension?: + | "SERVICE" + | "AZ" + | "INSTANCE_TYPE" + | "LINKED_ACCOUNT" + | "OPERATION" + | "PURCHASE_TYPE" + | "REGION" + | "USAGE_TYPE" + | "USAGE_TYPE_GROUP"; + + /** + * @title Secondary Dimension + * @description Secondary dimension for detailed breakdown (optional) + */ + secondaryDimension?: + | "SERVICE" + | "AZ" + | "INSTANCE_TYPE" + | "LINKED_ACCOUNT" + | "OPERATION" + | "PURCHASE_TYPE" + | "REGION" + | "USAGE_TYPE" + | "USAGE_TYPE_GROUP"; + + /** + * @title Include Regional Breakdown + * @description Include detailed breakdown by AWS regions + * @default true + */ + includeRegionalBreakdown?: boolean; + + /** + * @title Include Account Breakdown + * @description Include breakdown by linked accounts (for consolidated billing) + * @default false + */ + includeAccountBreakdown?: boolean; + + /** + * @title Include Usage Type Analysis + * @description Include detailed usage type analysis + * @default true + */ + includeUsageTypeAnalysis?: boolean; + + /** + * @title Top Items Limit + * @description Number of top items to show for each dimension + * @default 10 + */ + topItemsLimit?: number; + + /** + * @title Metric + * @description Cost metric to analyze + * @default "BlendedCost" + */ + metric?: + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost"; +} + +export interface BreakdownItem { + name: string; + cost: { + amount: string; + formatted: string; + }; + percentage: number; + subBreakdown?: BreakdownItem[]; +} + +export interface DimensionBreakdown { + dimension: string; + items: BreakdownItem[]; + totalCost: { + amount: string; + formatted: string; + }; + topItem: { + name: string; + cost: string; + percentage: number; + }; +} + +export interface CostBreakdownResponse { + primaryBreakdown: DimensionBreakdown; + secondaryBreakdown?: DimensionBreakdown; + regionalBreakdown?: DimensionBreakdown; + accountBreakdown?: DimensionBreakdown; + usageTypeBreakdown?: DimensionBreakdown; + summary: { + totalCost: { + amount: string; + formatted: string; + }; + period: DateInterval; + primaryDimension: string; + itemsAnalyzed: number; + costDistribution: { + top3ItemsPercentage: number; + top5ItemsPercentage: number; + top10ItemsPercentage: number; + }; + }; + insights: { + costConcentration: { + level: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + description: string; + }; + regionalDistribution: { + primaryRegion: string; + regionCount: number; + isWellDistributed: boolean; + }; + recommendations: string[]; + riskFactors: string[]; + }; + metadata: { + generatedAt: string; + metric: string; + dimensions: string[]; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + primaryDimension = "SERVICE", + secondaryDimension, + includeRegionalBreakdown = true, + includeAccountBreakdown = false, + includeUsageTypeAnalysis = true, + topItemsLimit = 10, + metric = "BlendedCost", + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let timePeriod: DateInterval; + if (startDate && endDate) { + timePeriod = { Start: startDate, End: endDate }; + } else { + timePeriod = AWSCostUtils.getDateRange(timePeriodDays); + } + + try { + // Helper function to get breakdown for a dimension + const getBreakdownForDimension = async ( + dimension: string, + ): Promise => { + const groupBy: GroupDefinition[] = [{ + Type: "DIMENSION", + Key: dimension, + }]; + + const response = await client.getCostAndUsage({ + TimePeriod: timePeriod, + Granularity: "MONTHLY", + Metrics: [metric], + GroupBy: groupBy, + }); + + // Aggregate data across time periods + const itemMap = new Map(); + + response.ResultsByTime.forEach((result) => { + result.Groups?.forEach((group) => { + const itemName = group.Keys[0] || "Unknown"; + const cost = parseFloat(group.Metrics[metric]?.Amount || "0"); + const existingCost = itemMap.get(itemName) || 0; + itemMap.set(itemName, existingCost + cost); + }); + }); + + // Sort by cost and take top items + const sortedItems = Array.from(itemMap.entries()) + .sort(([, a], [, b]) => b - a) + .slice(0, topItemsLimit); + + const totalCost = Array.from(itemMap.values()).reduce( + (sum, cost) => sum + cost, + 0, + ); + + const items: BreakdownItem[] = sortedItems.map(([name, cost]) => ({ + name, + cost: { + amount: cost.toString(), + formatted: AWSCostUtils.formatCurrency(cost.toString()), + }, + percentage: totalCost > 0 ? (cost / totalCost) * 100 : 0, + })); + + const topItem = items[0]; + + return { + dimension, + items, + totalCost: { + amount: totalCost.toString(), + formatted: AWSCostUtils.formatCurrency(totalCost.toString()), + }, + topItem: { + name: topItem?.name || "N/A", + cost: topItem?.cost.formatted || "$0.00", + percentage: topItem?.percentage || 0, + }, + }; + }; + + // Get primary breakdown + const primaryBreakdown = await getBreakdownForDimension(primaryDimension); + + // Get secondary breakdown if specified + let secondaryBreakdown: DimensionBreakdown | undefined; + if (secondaryDimension && secondaryDimension !== primaryDimension) { + secondaryBreakdown = await getBreakdownForDimension(secondaryDimension); + } + + // Get regional breakdown if requested + let regionalBreakdown: DimensionBreakdown | undefined; + if (includeRegionalBreakdown && primaryDimension !== "REGION") { + regionalBreakdown = await getBreakdownForDimension("REGION"); + } + + // Get account breakdown if requested + let accountBreakdown: DimensionBreakdown | undefined; + if (includeAccountBreakdown && primaryDimension !== "LINKED_ACCOUNT") { + try { + accountBreakdown = await getBreakdownForDimension("LINKED_ACCOUNT"); + } catch (error) { + console.warn("Could not fetch account breakdown:", error); + } + } + + // Get usage type breakdown if requested + let usageTypeBreakdown: DimensionBreakdown | undefined; + if (includeUsageTypeAnalysis && primaryDimension !== "USAGE_TYPE") { + usageTypeBreakdown = await getBreakdownForDimension("USAGE_TYPE"); + } + + // Calculate summary statistics + const totalCost = parseFloat(primaryBreakdown.totalCost.amount); + const top3Cost = primaryBreakdown.items.slice(0, 3).reduce( + (sum, item) => sum + parseFloat(item.cost.amount), + 0, + ); + const top5Cost = primaryBreakdown.items.slice(0, 5).reduce( + (sum, item) => sum + parseFloat(item.cost.amount), + 0, + ); + const top10Cost = primaryBreakdown.items.slice(0, 10).reduce( + (sum, item) => sum + parseFloat(item.cost.amount), + 0, + ); + + const costDistribution = { + top3ItemsPercentage: totalCost > 0 ? (top3Cost / totalCost) * 100 : 0, + top5ItemsPercentage: totalCost > 0 ? (top5Cost / totalCost) * 100 : 0, + top10ItemsPercentage: totalCost > 0 ? (top10Cost / totalCost) * 100 : 0, + }; + + // Analyze cost concentration + let costConcentrationLevel: "LOW" | "MEDIUM" | "HIGH" | "CRITICAL"; + let costConcentrationDescription: string; + + if (costDistribution.top3ItemsPercentage > 80) { + costConcentrationLevel = "CRITICAL"; + costConcentrationDescription = + "Extremely high cost concentration - top 3 items account for over 80% of costs"; + } else if (costDistribution.top3ItemsPercentage > 60) { + costConcentrationLevel = "HIGH"; + costConcentrationDescription = + "High cost concentration - top 3 items account for over 60% of costs"; + } else if (costDistribution.top5ItemsPercentage > 70) { + costConcentrationLevel = "MEDIUM"; + costConcentrationDescription = + "Moderate cost concentration - top 5 items account for over 70% of costs"; + } else { + costConcentrationLevel = "LOW"; + costConcentrationDescription = + "Well-distributed costs across multiple items"; + } + + // Analyze regional distribution + const regionalData = regionalBreakdown || primaryBreakdown; + const primaryRegion = regionalData.topItem.name; + const regionCount = regionalData.items.length; + const isWellDistributed = regionalData.topItem.percentage < 60; + + // Generate insights and recommendations + const recommendations: string[] = []; + const riskFactors: string[] = []; + + if ( + costConcentrationLevel === "CRITICAL" || costConcentrationLevel === "HIGH" + ) { + riskFactors.push( + `High cost concentration in ${primaryDimension.toLowerCase()}`, + ); + recommendations.push( + `Diversify your usage across different ${primaryDimension.toLowerCase()}s to reduce risk`, + ); + } + + if (primaryBreakdown.topItem.percentage > 70) { + riskFactors.push( + `${primaryBreakdown.topItem.name} represents ${ + primaryBreakdown.topItem.percentage.toFixed(1) + }% of total costs`, + ); + recommendations.push( + `Focus optimization efforts on ${primaryBreakdown.topItem.name}`, + ); + } + + if (!isWellDistributed && regionalBreakdown) { + riskFactors.push( + `Regional concentration risk - ${primaryRegion} accounts for ${ + regionalBreakdown.topItem.percentage.toFixed(1) + }% of costs`, + ); + recommendations.push( + "Consider distributing workloads across multiple regions for better resilience", + ); + } + + if (regionCount === 1) { + riskFactors.push("Single region deployment - no geographic redundancy"); + recommendations.push( + "Consider multi-region deployment for disaster recovery and cost optimization", + ); + } + + // General recommendations based on cost patterns + if (totalCost > 10000) { + recommendations.push( + "Consider enterprise savings plans or reserved instances for significant cost savings", + ); + } + + if (primaryDimension === "SERVICE" && primaryBreakdown.items.length > 10) { + recommendations.push( + "Consider consolidating services to reduce management overhead", + ); + } + + recommendations.push( + "Regularly review cost allocation tags for better cost tracking", + ); + recommendations.push( + "Set up automated cost alerts for unusual spending patterns", + ); + + const analyzedDimensions = [primaryDimension]; + if (secondaryDimension) analyzedDimensions.push(secondaryDimension); + if (includeRegionalBreakdown && primaryDimension !== "REGION") { + analyzedDimensions.push("REGION"); + } + if (includeAccountBreakdown && primaryDimension !== "LINKED_ACCOUNT") { + analyzedDimensions.push("LINKED_ACCOUNT"); + } + if (includeUsageTypeAnalysis && primaryDimension !== "USAGE_TYPE") { + analyzedDimensions.push("USAGE_TYPE"); + } + + return { + primaryBreakdown, + secondaryBreakdown, + regionalBreakdown, + accountBreakdown, + usageTypeBreakdown, + summary: { + totalCost: { + amount: totalCost.toString(), + formatted: AWSCostUtils.formatCurrency(totalCost.toString()), + }, + period: timePeriod, + primaryDimension, + itemsAnalyzed: primaryBreakdown.items.length, + costDistribution, + }, + insights: { + costConcentration: { + level: costConcentrationLevel, + description: costConcentrationDescription, + }, + regionalDistribution: { + primaryRegion, + regionCount, + isWellDistributed, + }, + recommendations, + riskFactors, + }, + metadata: { + generatedAt: new Date().toISOString(), + metric, + dimensions: analyzedDimensions, + }, + }; + } catch (error) { + console.error("Error fetching cost breakdown data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch cost breakdown data: ${errorMessage}`); + } +} diff --git a/aws/loaders/costForecast.ts b/aws/loaders/costForecast.ts new file mode 100644 index 000000000..25237e757 --- /dev/null +++ b/aws/loaders/costForecast.ts @@ -0,0 +1,306 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval, Expression } from "../client.ts"; + +export interface Props { + /** + * @title Forecast Period (Days) + * @description Number of days to forecast into the future + * @default 30 + */ + forecastDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date for forecast (YYYY-MM-DD format). If provided, overrides forecastDays + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date for forecast (YYYY-MM-DD format). If provided, overrides forecastDays + * @format date + */ + endDate?: string; + + /** + * @title Metric + * @description The cost metric to forecast + * @default "BlendedCost" + */ + metric?: + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost" + | "UsageQuantity" + | "NormalizedUsageAmount"; + + /** + * @title Granularity + * @description The granularity of the forecast data + * @default "DAILY" + */ + granularity?: "DAILY" | "MONTHLY"; + + /** + * @title Prediction Interval Level + * @description The confidence level for prediction intervals (80 = 80% confidence) + * @default 80 + */ + predictionIntervalLevel?: number; + + /** + * @title Filter by Service + * @description Filter forecast by specific AWS service + */ + serviceFilter?: string; + + /** + * @title Include Historical Comparison + * @description Include historical data for comparison with forecast + * @default true + */ + includeHistoricalComparison?: boolean; + + /** + * @title Historical Period (Days) + * @description Number of historical days to include for comparison + * @default 30 + */ + historicalDays?: number; +} + +export interface ForecastData { + timePeriod: DateInterval; + meanValue: string; + meanValueFormatted: string; + lowerBound: string; + lowerBoundFormatted: string; + upperBound: string; + upperBoundFormatted: string; +} + +export interface HistoricalData { + timePeriod: DateInterval; + actualCost: string; + actualCostFormatted: string; +} + +export interface CostForecastResponse { + total: { + amount: string; + unit: string; + formatted: string; + }; + forecastData: ForecastData[]; + historicalData?: HistoricalData[]; + insights: { + averageDailyCost: { + amount: string; + formatted: string; + }; + projectedMonthlySpend: { + amount: string; + formatted: string; + }; + confidenceLevel: number; + trend: "INCREASING" | "DECREASING" | "STABLE"; + trendPercentage: number; + }; + metadata: { + forecastPeriod: DateInterval; + metric: string; + granularity: string; + generatedAt: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + forecastDays = 30, + startDate, + endDate, + metric = "BlendedCost", + granularity = "DAILY", + predictionIntervalLevel = 80, + serviceFilter, + includeHistoricalComparison = true, + historicalDays = 30, + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine forecast time period + let forecastPeriod: DateInterval; + if (startDate && endDate) { + forecastPeriod = { Start: startDate, End: endDate }; + } else { + const start = new Date(); + const end = new Date(); + end.setDate(end.getDate() + forecastDays); + + forecastPeriod = { + Start: start.toISOString().split("T")[0], + End: end.toISOString().split("T")[0], + }; + } + + // Build filter if service is specified + let filter: Expression | undefined; + if (serviceFilter) { + filter = { + Dimensions: { + Key: "SERVICE", + Values: [serviceFilter], + MatchOptions: ["EQUALS"], + }, + }; + } + + try { + // Get cost forecast + const forecastResponse = await client.getCostForecast({ + TimePeriod: forecastPeriod, + Metric: metric, + Granularity: granularity, + Filter: filter, + PredictionIntervalLevel: predictionIntervalLevel, + }); + + const unit = forecastResponse.Total.Unit; + + // Process forecast data + const forecastData: ForecastData[] = forecastResponse.ForecastResultsByTime + .map((result) => ({ + timePeriod: result.TimePeriod, + meanValue: result.MeanValue, + meanValueFormatted: AWSCostUtils.formatCurrency(result.MeanValue, unit), + lowerBound: result.PredictionIntervalLowerBound, + lowerBoundFormatted: AWSCostUtils.formatCurrency( + result.PredictionIntervalLowerBound, + unit, + ), + upperBound: result.PredictionIntervalUpperBound, + upperBoundFormatted: AWSCostUtils.formatCurrency( + result.PredictionIntervalUpperBound, + unit, + ), + })); + + // Get historical data for comparison if requested + let historicalData: HistoricalData[] | undefined; + if (includeHistoricalComparison) { + const historicalPeriod = AWSCostUtils.getDateRange(historicalDays); + + try { + const historicalResponse = await client.getCostAndUsage({ + TimePeriod: historicalPeriod, + Granularity: granularity, + Metrics: [metric], + Filter: filter, + }); + + historicalData = historicalResponse.ResultsByTime.map((result) => { + const totalMetric = result.Total[metric]; + return { + timePeriod: result.TimePeriod, + actualCost: totalMetric?.Amount || "0", + actualCostFormatted: AWSCostUtils.formatCurrency( + totalMetric?.Amount || "0", + totalMetric?.Unit || unit, + ), + }; + }); + } catch (error) { + console.warn("Could not fetch historical data for comparison:", error); + } + } + + // Calculate insights + const totalForecastAmount = parseFloat(forecastResponse.Total.Amount); + const averageDailyCost = forecastData.length > 0 + ? totalForecastAmount / forecastData.length + : 0; + + // Estimate monthly spend based on average daily cost + const projectedMonthlySpend = averageDailyCost * 30; + + // Calculate trend + let trend: "INCREASING" | "DECREASING" | "STABLE" = "STABLE"; + let trendPercentage = 0; + + if ( + historicalData && historicalData.length > 0 && forecastData.length > 0 + ) { + const historicalAverage = historicalData.reduce((sum, data) => + sum + parseFloat(data.actualCost), 0) / historicalData.length; + + if (historicalAverage > 0) { + const difference = averageDailyCost - historicalAverage; + trendPercentage = Math.abs((difference / historicalAverage) * 100); + + if (Math.abs(difference) > historicalAverage * 0.05) { // 5% threshold + trend = difference > 0 ? "INCREASING" : "DECREASING"; + } + } + } + + return { + total: { + amount: forecastResponse.Total.Amount, + unit: forecastResponse.Total.Unit, + formatted: AWSCostUtils.formatCurrency( + forecastResponse.Total.Amount, + forecastResponse.Total.Unit, + ), + }, + forecastData, + historicalData, + insights: { + averageDailyCost: { + amount: averageDailyCost.toString(), + formatted: AWSCostUtils.formatCurrency( + averageDailyCost.toString(), + unit, + ), + }, + projectedMonthlySpend: { + amount: projectedMonthlySpend.toString(), + formatted: AWSCostUtils.formatCurrency( + projectedMonthlySpend.toString(), + unit, + ), + }, + confidenceLevel: predictionIntervalLevel, + trend, + trendPercentage, + }, + metadata: { + forecastPeriod, + metric, + granularity, + generatedAt: new Date().toISOString(), + }, + }; + } catch (error) { + console.error("Error fetching cost forecast data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch cost forecast data: ${errorMessage}`); + } +} diff --git a/aws/loaders/reservationCoverage.ts b/aws/loaders/reservationCoverage.ts new file mode 100644 index 000000000..e72bbeace --- /dev/null +++ b/aws/loaders/reservationCoverage.ts @@ -0,0 +1,142 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to analyze reservation coverage + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format) + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format) + * @format date + */ + endDate?: string; + + /** + * @title Granularity + * @description The granularity of the coverage data + * @default "MONTHLY" + */ + granularity?: "DAILY" | "MONTHLY"; +} + +export interface ReservationCoverageResponse { + coverageData: Array<{ + timePeriod: DateInterval; + coverageHoursPercentage: number; + onDemandCost: { + amount: string; + formatted: string; + }; + }>; + summary: { + averageCoverage: number; + totalOnDemandCost: { + amount: string; + formatted: string; + }; + period: DateInterval; + }; + metadata: { + generatedAt: string; + granularity: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + granularity = "MONTHLY", + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let timePeriod: DateInterval; + if (startDate && endDate) { + timePeriod = { Start: startDate, End: endDate }; + } else { + timePeriod = AWSCostUtils.getDateRange(timePeriodDays); + } + + try { + const response = await client.getReservationCoverage({ + TimePeriod: timePeriod, + Granularity: granularity, + }); + + const coverageData = response.CoveragesByTime.map((coverage) => ({ + timePeriod: coverage.TimePeriod, + coverageHoursPercentage: parseFloat( + coverage.Total?.CoverageHours?.CoverageHoursPercentage || "0", + ), + onDemandCost: { + amount: coverage.Total?.CoverageCost?.OnDemandCost || "0", + formatted: AWSCostUtils.formatCurrency( + coverage.Total?.CoverageCost?.OnDemandCost || "0", + ), + }, + })); + + const averageCoverage = coverageData.length > 0 + ? coverageData.reduce( + (sum, data) => sum + data.coverageHoursPercentage, + 0, + ) / coverageData.length + : 0; + + const totalOnDemandCost = coverageData.reduce( + (sum, data) => sum + parseFloat(data.onDemandCost.amount), + 0, + ); + + return { + coverageData, + summary: { + averageCoverage, + totalOnDemandCost: { + amount: totalOnDemandCost.toString(), + formatted: AWSCostUtils.formatCurrency(totalOnDemandCost.toString()), + }, + period: timePeriod, + }, + metadata: { + generatedAt: new Date().toISOString(), + granularity, + }, + }; + } catch (error) { + console.error("Error fetching reservation coverage data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error( + `Failed to fetch reservation coverage data: ${errorMessage}`, + ); + } +} diff --git a/aws/loaders/savingsPlans.ts b/aws/loaders/savingsPlans.ts new file mode 100644 index 000000000..db2ba8451 --- /dev/null +++ b/aws/loaders/savingsPlans.ts @@ -0,0 +1,180 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to analyze savings plans utilization + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format) + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format) + * @format date + */ + endDate?: string; + + /** + * @title Granularity + * @description The granularity of the utilization data + * @default "MONTHLY" + */ + granularity?: "DAILY" | "MONTHLY"; +} + +export interface SavingsPlansResponse { + utilizationData: Array<{ + timePeriod: DateInterval; + utilizationPercentage: number; + totalCommitment: { + amount: string; + formatted: string; + }; + usedCommitment: { + amount: string; + formatted: string; + }; + unusedCommitment: { + amount: string; + formatted: string; + }; + netSavings: { + amount: string; + formatted: string; + }; + }>; + summary: { + averageUtilization: number; + totalCommitment: { + amount: string; + formatted: string; + }; + totalSavings: { + amount: string; + formatted: string; + }; + period: DateInterval; + }; + metadata: { + generatedAt: string; + granularity: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + granularity = "MONTHLY", + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let timePeriod: DateInterval; + if (startDate && endDate) { + timePeriod = { Start: startDate, End: endDate }; + } else { + timePeriod = AWSCostUtils.getDateRange(timePeriodDays); + } + + try { + const response = await client.getSavingsPlansUtilization({ + TimePeriod: timePeriod, + Granularity: granularity, + }); + + const utilizationData = response.SavingsPlansUtilizationsByTime.map( + (utilization) => ({ + timePeriod: utilization.TimePeriod, + utilizationPercentage: parseFloat( + utilization.Utilization.UtilizationPercentage, + ), + totalCommitment: { + amount: utilization.Utilization.TotalCommitment, + formatted: AWSCostUtils.formatCurrency( + utilization.Utilization.TotalCommitment, + ), + }, + usedCommitment: { + amount: utilization.Utilization.UsedCommitment, + formatted: AWSCostUtils.formatCurrency( + utilization.Utilization.UsedCommitment, + ), + }, + unusedCommitment: { + amount: utilization.Utilization.UnusedCommitment, + formatted: AWSCostUtils.formatCurrency( + utilization.Utilization.UnusedCommitment, + ), + }, + netSavings: { + amount: utilization.Savings.NetSavings, + formatted: AWSCostUtils.formatCurrency( + utilization.Savings.NetSavings, + ), + }, + }), + ); + + const averageUtilization = utilizationData.length > 0 + ? utilizationData.reduce( + (sum, data) => sum + data.utilizationPercentage, + 0, + ) / utilizationData.length + : 0; + + const totalCommitment = parseFloat( + response.Total.Utilization.TotalCommitment, + ); + const totalSavings = parseFloat(response.Total.Savings.NetSavings); + + return { + utilizationData, + summary: { + averageUtilization, + totalCommitment: { + amount: totalCommitment.toString(), + formatted: AWSCostUtils.formatCurrency(totalCommitment.toString()), + }, + totalSavings: { + amount: totalSavings.toString(), + formatted: AWSCostUtils.formatCurrency(totalSavings.toString()), + }, + period: timePeriod, + }, + metadata: { + generatedAt: new Date().toISOString(), + granularity, + }, + }; + } catch (error) { + console.error("Error fetching savings plans data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch savings plans data: ${errorMessage}`); + } +} diff --git a/aws/loaders/services.ts b/aws/loaders/services.ts new file mode 100644 index 000000000..a94da0d05 --- /dev/null +++ b/aws/loaders/services.ts @@ -0,0 +1,537 @@ +import { AppContext } from "../mod.ts"; +import { AWSCostExplorerClient, AWSCostUtils } from "../client.ts"; +import type { DateInterval } from "../client.ts"; + +export interface Props { + /** + * @title Time Period (Days) + * @description Number of days to analyze service costs + * @default 30 + */ + timePeriodDays?: number; + + /** + * @title Custom Start Date + * @description Custom start date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + startDate?: string; + + /** + * @title Custom End Date + * @description Custom end date (YYYY-MM-DD format). If provided, overrides timePeriodDays + * @format date + */ + endDate?: string; + + /** + * @title Granularity + * @description The granularity of the analysis + * @default "MONTHLY" + */ + granularity?: "DAILY" | "MONTHLY"; + + /** + * @title Top Services Limit + * @description Number of top services to include in detailed analysis + * @default 10 + */ + topServicesLimit?: number; + + /** + * @title Include Cost Trends + * @description Include cost trend analysis for services + * @default true + */ + includeCostTrends?: boolean; + + /** + * @title Compare with Previous Period + * @description Compare costs with the previous equivalent period + * @default true + */ + compareWithPreviousPeriod?: boolean; + + /** + * @title Metric + * @description Cost metric to analyze + * @default "BlendedCost" + */ + metric?: + | "BlendedCost" + | "UnblendedCost" + | "AmortizedCost" + | "NetUnblendedCost" + | "NetAmortizedCost"; +} + +export interface ServiceCostData { + serviceName: string; + totalCost: { + amount: string; + formatted: string; + }; + percentage: number; + trend?: { + direction: "INCREASING" | "DECREASING" | "STABLE"; + changePercentage: number; + changeAmount: { + amount: string; + formatted: string; + }; + }; + dailyBreakdown?: Array<{ + date: string; + cost: { + amount: string; + formatted: string; + }; + }>; + monthlyBreakdown?: Array<{ + month: string; + cost: { + amount: string; + formatted: string; + }; + }>; +} + +export interface ServicesResponse { + services: ServiceCostData[]; + summary: { + totalCost: { + amount: string; + formatted: string; + }; + totalServices: number; + topServicesCost: { + amount: string; + formatted: string; + percentage: number; + }; + period: DateInterval; + averageDailyCost: { + amount: string; + formatted: string; + }; + }; + comparison?: { + previousPeriod: DateInterval; + totalCostChange: { + amount: string; + formatted: string; + percentage: number; + direction: "INCREASE" | "DECREASE" | "NO_CHANGE"; + }; + servicesWithBiggestIncrease: Array<{ + serviceName: string; + increaseAmount: string; + increasePercentage: number; + }>; + servicesWithBiggestDecrease: Array<{ + serviceName: string; + decreaseAmount: string; + decreasePercentage: number; + }>; + }; + insights: { + costOptimizationOpportunities: string[]; + riskFactors: string[]; + recommendations: string[]; + }; + metadata: { + generatedAt: string; + metric: string; + granularity: string; + }; +} + +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + timePeriodDays = 30, + startDate, + endDate, + granularity = "MONTHLY", + topServicesLimit = 10, + compareWithPreviousPeriod = true, + metric = "BlendedCost", + } = props; + + // Validate credentials + if (!ctx.credentials.accessKeyId || !ctx.credentials.secretAccessKey) { + throw new Error( + "AWS credentials not configured. Please set accessKeyId and secretAccessKey in the app configuration.", + ); + } + + const client = new AWSCostExplorerClient(ctx.credentials); + + // Determine time period + let currentPeriod: DateInterval; + if (startDate && endDate) { + currentPeriod = { Start: startDate, End: endDate }; + } else { + currentPeriod = AWSCostUtils.getDateRange(timePeriodDays); + } + + try { + // Get current period cost data grouped by service + const currentResponse = await client.getCostAndUsage({ + TimePeriod: currentPeriod, + Granularity: granularity, + Metrics: [metric], + GroupBy: [{ + Type: "DIMENSION", + Key: "SERVICE", + }], + }); + + // Process current period data + const serviceMap = new Map; + monthlyBreakdown: Array<{ month: string; cost: number }>; + }>(); + + currentResponse.ResultsByTime.forEach((result) => { + const period = granularity === "DAILY" + ? result.TimePeriod.Start + : result.TimePeriod.Start.substring(0, 7); + + result.Groups?.forEach((group) => { + const serviceName = group.Keys[0] || "Unknown Service"; + const cost = parseFloat(group.Metrics[metric]?.Amount || "0"); + + if (!serviceMap.has(serviceName)) { + serviceMap.set(serviceName, { + totalCost: 0, + dailyBreakdown: [], + monthlyBreakdown: [], + }); + } + + const serviceData = serviceMap.get(serviceName)!; + serviceData.totalCost += cost; + + if (granularity === "DAILY") { + serviceData.dailyBreakdown.push({ + date: result.TimePeriod.Start, + cost, + }); + } else { + serviceData.monthlyBreakdown.push({ + month: period, + cost, + }); + } + }); + }); + + // Calculate total cost + const totalCost = Array.from(serviceMap.values()).reduce( + (sum, service) => sum + service.totalCost, + 0, + ); + + // Get previous period data for comparison if requested + let previousPeriodData: Map | undefined; + let previousPeriod: DateInterval | undefined; + + if (compareWithPreviousPeriod) { + const currentStart = new Date(currentPeriod.Start); + const currentEnd = new Date(currentPeriod.End); + const periodLength = currentEnd.getTime() - currentStart.getTime(); + + const previousStart = new Date(currentStart.getTime() - periodLength); + const previousEnd = new Date(currentStart.getTime()); + + previousPeriod = { + Start: previousStart.toISOString().split("T")[0], + End: previousEnd.toISOString().split("T")[0], + }; + + try { + const previousResponse = await client.getCostAndUsage({ + TimePeriod: previousPeriod, + Granularity: "MONTHLY", // Use monthly for comparison to reduce complexity + Metrics: [metric], + GroupBy: [{ + Type: "DIMENSION", + Key: "SERVICE", + }], + }); + + previousPeriodData = new Map(); + previousResponse.ResultsByTime.forEach((result) => { + result.Groups?.forEach((group) => { + const serviceName = group.Keys[0] || "Unknown Service"; + const cost = parseFloat(group.Metrics[metric]?.Amount || "0"); + + const existingCost = previousPeriodData!.get(serviceName) || 0; + previousPeriodData!.set(serviceName, existingCost + cost); + }); + }); + } catch (error) { + console.warn( + "Could not fetch previous period data for comparison:", + error, + ); + } + } + + // Sort services by cost and take top N + const sortedServices = Array.from(serviceMap.entries()) + .sort(([, a], [, b]) => b.totalCost - a.totalCost) + .slice(0, topServicesLimit); + + // Process service data + const services: ServiceCostData[] = sortedServices.map( + ([serviceName, serviceData]) => { + const percentage = totalCost > 0 + ? (serviceData.totalCost / totalCost) * 100 + : 0; + + // Calculate trend if previous period data is available + let trend: ServiceCostData["trend"]; + if (previousPeriodData?.has(serviceName)) { + const previousCost = previousPeriodData.get(serviceName)!; + const changeAmount = serviceData.totalCost - previousCost; + const changePercentage = previousCost > 0 + ? (changeAmount / previousCost) * 100 + : 0; + + let direction: "INCREASING" | "DECREASING" | "STABLE"; + if (Math.abs(changePercentage) < 5) { + direction = "STABLE"; + } else { + direction = changeAmount > 0 ? "INCREASING" : "DECREASING"; + } + + trend = { + direction, + changePercentage: Math.abs(changePercentage), + changeAmount: { + amount: Math.abs(changeAmount).toString(), + formatted: AWSCostUtils.formatCurrency( + Math.abs(changeAmount).toString(), + ), + }, + }; + } + + return { + serviceName, + totalCost: { + amount: serviceData.totalCost.toString(), + formatted: AWSCostUtils.formatCurrency( + serviceData.totalCost.toString(), + ), + }, + percentage, + trend, + dailyBreakdown: granularity === "DAILY" + ? serviceData.dailyBreakdown.map((item) => ({ + date: item.date, + cost: { + amount: item.cost.toString(), + formatted: AWSCostUtils.formatCurrency(item.cost.toString()), + }, + })) + : undefined, + monthlyBreakdown: granularity === "MONTHLY" + ? serviceData.monthlyBreakdown.map((item) => ({ + month: item.month, + cost: { + amount: item.cost.toString(), + formatted: AWSCostUtils.formatCurrency(item.cost.toString()), + }, + })) + : undefined, + }; + }, + ); + + // Calculate summary + const topServicesCost = services.reduce( + (sum, service) => sum + parseFloat(service.totalCost.amount), + 0, + ); + const periodDays = Math.ceil( + (new Date(currentPeriod.End).getTime() - + new Date(currentPeriod.Start).getTime()) / (1000 * 60 * 60 * 24), + ); + const averageDailyCost = totalCost / Math.max(1, periodDays); + + // Generate comparison data + let comparison: ServicesResponse["comparison"]; + if (previousPeriodData && previousPeriod) { + const previousTotal = Array.from(previousPeriodData.values()).reduce( + (sum, cost) => sum + cost, + 0, + ); + const totalCostChange = totalCost - previousTotal; + const totalCostChangePercentage = previousTotal > 0 + ? (totalCostChange / previousTotal) * 100 + : 0; + + let direction: "INCREASE" | "DECREASE" | "NO_CHANGE"; + if (Math.abs(totalCostChangePercentage) < 1) { + direction = "NO_CHANGE"; + } else { + direction = totalCostChange > 0 ? "INCREASE" : "DECREASE"; + } + + // Find services with biggest changes + const serviceChanges: Array< + { serviceName: string; change: number; percentage: number } + > = []; + + services.forEach((service) => { + if (service.trend) { + const changeAmount = service.trend.direction === "INCREASING" + ? parseFloat(service.trend.changeAmount.amount) + : -parseFloat(service.trend.changeAmount.amount); + + serviceChanges.push({ + serviceName: service.serviceName, + change: changeAmount, + percentage: service.trend.direction === "INCREASING" + ? service.trend.changePercentage + : -service.trend.changePercentage, + }); + } + }); + + const servicesWithBiggestIncrease = serviceChanges + .filter((s) => s.change > 0) + .sort((a, b) => b.change - a.change) + .slice(0, 3) + .map((s) => ({ + serviceName: s.serviceName, + increaseAmount: AWSCostUtils.formatCurrency(s.change.toString()), + increasePercentage: s.percentage, + })); + + const servicesWithBiggestDecrease = serviceChanges + .filter((s) => s.change < 0) + .sort((a, b) => a.change - b.change) + .slice(0, 3) + .map((s) => ({ + serviceName: s.serviceName, + decreaseAmount: AWSCostUtils.formatCurrency( + Math.abs(s.change).toString(), + ), + decreasePercentage: Math.abs(s.percentage), + })); + + comparison = { + previousPeriod, + totalCostChange: { + amount: Math.abs(totalCostChange).toString(), + formatted: AWSCostUtils.formatCurrency( + Math.abs(totalCostChange).toString(), + ), + percentage: Math.abs(totalCostChangePercentage), + direction, + }, + servicesWithBiggestIncrease, + servicesWithBiggestDecrease, + }; + } + + // Generate insights + const insights = { + costOptimizationOpportunities: [] as string[], + riskFactors: [] as string[], + recommendations: [] as string[], + }; + + // Analyze top services for optimization opportunities + const topService = services[0]; + if (topService && topService.percentage > 50) { + insights.riskFactors.push( + `${topService.serviceName} accounts for ${ + topService.percentage.toFixed(1) + }% of total costs - high concentration risk`, + ); + insights.costOptimizationOpportunities.push( + `Focus on optimizing ${topService.serviceName} as it represents the largest cost component`, + ); + } + + // Check for services with high growth + services.forEach((service) => { + if ( + service.trend?.direction === "INCREASING" && + service.trend.changePercentage > 50 + ) { + insights.riskFactors.push( + `${service.serviceName} costs increased by ${ + service.trend.changePercentage.toFixed(1) + }%`, + ); + insights.recommendations.push( + `Investigate unusual cost increase in ${service.serviceName}`, + ); + } + }); + + // General recommendations + if (services.length >= 5) { + insights.recommendations.push( + "Consider consolidating workloads to reduce service sprawl and management overhead", + ); + } + + if (totalCost > 1000) { + insights.costOptimizationOpportunities.push( + "Consider purchasing reserved instances or savings plans for predictable workloads", + ); + } + + insights.recommendations.push( + "Regularly review and rightsize resources based on utilization metrics", + ); + insights.recommendations.push( + "Implement automated cost alerts to monitor spending trends", + ); + + return { + services, + summary: { + totalCost: { + amount: totalCost.toString(), + formatted: AWSCostUtils.formatCurrency(totalCost.toString()), + }, + totalServices: serviceMap.size, + topServicesCost: { + amount: topServicesCost.toString(), + formatted: AWSCostUtils.formatCurrency(topServicesCost.toString()), + percentage: totalCost > 0 ? (topServicesCost / totalCost) * 100 : 0, + }, + period: currentPeriod, + averageDailyCost: { + amount: averageDailyCost.toString(), + formatted: AWSCostUtils.formatCurrency(averageDailyCost.toString()), + }, + }, + comparison, + insights, + metadata: { + generatedAt: new Date().toISOString(), + metric, + granularity, + }, + }; + } catch (error) { + console.error("Error fetching service cost data:", error); + const errorMessage = error instanceof Error + ? error.message + : "Unknown error occurred"; + throw new Error(`Failed to fetch service cost data: ${errorMessage}`); + } +} diff --git a/aws/manifest.gen.ts b/aws/manifest.gen.ts new file mode 100644 index 000000000..7eb5f91cf --- /dev/null +++ b/aws/manifest.gen.ts @@ -0,0 +1,41 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/createBudget.ts"; +import * as $$$$$$$$$1 from "./actions/deleteBudget.ts"; +import * as $$$$$$$$$2 from "./actions/exportCostData.ts"; +import * as $$$$$$$$$3 from "./actions/updateBudget.ts"; +import * as $$$0 from "./loaders/anomalies.ts"; +import * as $$$1 from "./loaders/budgets.ts"; +import * as $$$2 from "./loaders/costAndUsage.ts"; +import * as $$$3 from "./loaders/costBreakdown.ts"; +import * as $$$4 from "./loaders/costForecast.ts"; +import * as $$$5 from "./loaders/reservationCoverage.ts"; +import * as $$$6 from "./loaders/savingsPlans.ts"; +import * as $$$7 from "./loaders/services.ts"; + +const manifest = { + "loaders": { + "aws/loaders/anomalies.ts": $$$0, + "aws/loaders/budgets.ts": $$$1, + "aws/loaders/costAndUsage.ts": $$$2, + "aws/loaders/costBreakdown.ts": $$$3, + "aws/loaders/costForecast.ts": $$$4, + "aws/loaders/reservationCoverage.ts": $$$5, + "aws/loaders/savingsPlans.ts": $$$6, + "aws/loaders/services.ts": $$$7, + }, + "actions": { + "aws/actions/createBudget.ts": $$$$$$$$$0, + "aws/actions/deleteBudget.ts": $$$$$$$$$1, + "aws/actions/exportCostData.ts": $$$$$$$$$2, + "aws/actions/updateBudget.ts": $$$$$$$$$3, + }, + "name": "aws", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/aws/mod.ts b/aws/mod.ts new file mode 100644 index 000000000..00cf1cebc --- /dev/null +++ b/aws/mod.ts @@ -0,0 +1,99 @@ +import type { App, FnContext } from "@deco/deco"; +import { AWSCredentials } from "./client.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; + +export interface Props { + /** + * @title AWS Access Key ID + * @description Your AWS access key ID for authentication + */ + accessKeyId?: string; + + /** + * @title AWS Secret Access Key + * @description Your AWS secret access key for authentication + */ + secretAccessKey?: string; + + /** + * @title AWS Region + * @description The AWS region to use (defaults to us-east-1) + * @default "us-east-1" + */ + region?: string; + + /** + * @title AWS Session Token + * @description Optional session token for temporary credentials + */ + sessionToken?: string; + + /** + * @title AWS Account ID + * @description Your AWS account ID (required for some operations like budgets) + */ + accountId?: string; + + /** + * @title Default Currency + * @description Default currency for cost displays + * @default "USD" + */ + defaultCurrency?: string; + + /** + * @title Enable Cost Anomaly Detection + * @description Enable fetching and monitoring of cost anomalies + * @default true + */ + enableAnomalyDetection?: boolean; + + /** + * @title Enable Budget Monitoring + * @description Enable budget monitoring and alerts + * @default true + */ + enableBudgetMonitoring?: boolean; +} + +export interface State extends Props { + credentials: AWSCredentials; +} + +/** + * @title AWS + * @appName aws + * @description Track cloud costs, budgets, and billing insights using AWS tools. + * @category Analytics + * @logo https://assets.decocache.com/mcp/ece686cd-c380-41e8-97c8-34616a3bf5ba/AWS.svg + */ +export default function App(state: Props): App { + // Validate required credentials + if (!state.accessKeyId || !state.secretAccessKey) { + console.warn( + "AWS app: Missing required credentials (accessKeyId or secretAccessKey)", + ); + } + + const credentials: AWSCredentials = { + accessKeyId: state.accessKeyId || "", + secretAccessKey: state.secretAccessKey || "", + region: state.region || "us-east-1", + sessionToken: state.sessionToken, + }; + + const newState: State = { + ...state, + credentials, + defaultCurrency: state.defaultCurrency || "USD", + enableAnomalyDetection: state.enableAnomalyDetection ?? true, + enableBudgetMonitoring: state.enableBudgetMonitoring ?? true, + }; + + return { + state: newState, + manifest, + }; +} + +export type AppContext = FnContext; diff --git a/barte/README.md b/barte/README.md new file mode 100644 index 000000000..837bf6cfc --- /dev/null +++ b/barte/README.md @@ -0,0 +1,11 @@ +# Barte MCP + +This is an MCP for integration with the Barte platform (https://www.barte.com/), a payment and financial management service. + +The MCP allows LLMs to interact with the Barte API to perform operations such as: + +- Partial charge refunds +- Transaction queries +- Payment management + +Complete API documentation can be found at https://barte.gitbook.io/barte-api diff --git a/barte/actions/partialRefund.ts b/barte/actions/partialRefund.ts new file mode 100644 index 000000000..1a3ef4344 --- /dev/null +++ b/barte/actions/partialRefund.ts @@ -0,0 +1,47 @@ +import { AppContext } from "../mod.ts"; +import { PartialRefundResponse } from "../utils/types.ts"; + +interface Props { + /** + * @title Charge UUID + * @description The UUID of the charge to refund (uuid · string) + */ + uuid: string; + /** + * @title Refund Value + * @description Value to be refunded (value · number · double) + */ + value: number; +} + +/** + * @name PARTIAL_REFUND + * @title Partial Refund + * @description Refund a partial amount of a charge + */ +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { uuid, value } = props; + + try { + const response = await api["PATCH /charges/partial-refund/:uuid"]({ + uuid, + }, { body: { value } }); + + if (!response.ok) { + ctx.errorHandler.toHttpError(response, "Error to partial refund"); + } + + const result = await response.json(); + + return result; + } catch (error) { + ctx.errorHandler.toHttpError(error, "Error to partial refund"); + } +}; + +export default action; diff --git a/barte/loaders/getCharges.ts b/barte/loaders/getCharges.ts new file mode 100644 index 000000000..0619814ee --- /dev/null +++ b/barte/loaders/getCharges.ts @@ -0,0 +1,69 @@ +import { AppContext } from "../mod.ts"; +import { + ChargeStatus, + GetChargesResponse, + PaymentMethod, +} from "../utils/types.ts"; + +export interface Props { + /** + * @title Initial Expiration Date + * @description The initial expiration date of the charges. Format: YYYY-MM-DD + * @example 2025-01-01 + */ + expirationDateInitial?: string; + /** + * @title Final Expiration Date + * @description The final expiration date of the charges. Format: YYYY-MM-DD + * @example 2025-01-01 + */ + expirationDateFinal?: string; + /** + * @title Status + * @description The status of the charges. + * @example PENDING + */ + status?: ChargeStatus; + /** + * @title Payment Method + * @description The payment method of the charges. + * @example DEBIT_CARD + */ + paymentMethod?: PaymentMethod; + /** + * @title Notification Email + * @description The email to be notified when the charge is created. + * @example teste@teste.com + */ + notificationEmail: string; + /** + * @title Customer Document + * @description The document of the customer. + * @example 1234567890 + */ + customerDocument?: string; +} + +/** + * @name GET_CHARGES + * @title Get Charges + * @description Get a list of charges, based on the search params + */ +export default async function getCharges( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { api } = ctx; + try { + const response = await api["GET /charges"]({ + ...props, + }); + if (!response.ok) { + ctx.errorHandler.toHttpError(response, "Error to get charges"); + } + return response.json(); + } catch (error) { + ctx.errorHandler.toHttpError(error, "Error to get charges"); + } +} diff --git a/barte/manifest.gen.ts b/barte/manifest.gen.ts new file mode 100644 index 000000000..d449bf6af --- /dev/null +++ b/barte/manifest.gen.ts @@ -0,0 +1,21 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/partialRefund.ts"; +import * as $$$0 from "./loaders/getCharges.ts"; + +const manifest = { + "loaders": { + "barte/loaders/getCharges.ts": $$$0, + }, + "actions": { + "barte/actions/partialRefund.ts": $$$$$$$$$0, + }, + "name": "barte", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/barte/mod.ts b/barte/mod.ts new file mode 100644 index 000000000..2abff5711 --- /dev/null +++ b/barte/mod.ts @@ -0,0 +1,57 @@ +import type { App, FnContext } from "@deco/deco"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { Client } from "./utils/client.ts"; +import { BART_URL } from "./utils/constants.ts"; +import { createHttpClient } from "../utils/http.ts"; +import { Secret } from "../website/loaders/secret.ts"; +import { fetchSafe } from "../utils/fetch.ts"; +import { + createErrorHandler, + ErrorHandler, +} from "../mcp/utils/errorHandling.ts"; + +export type AppContext = FnContext; + +export interface Props { + /** + * @title API token + * @description The token to access the Barte API + */ + token?: Secret | string; +} + +export interface State extends Omit { + api: ReturnType>; + errorHandler: ErrorHandler; +} + +/** + * @title Barte + * @appName barte + * @description Centralize and structure your product data with Barte’s catalog tools. + * @category Payment Platform + * @logo https://assets.decocache.com/mcp/2b4f178a-73be-44c9-a342-4d4c0e9bcad4/Barte.svg + */ +export default function App(props: Props): App { + const { token } = props; + + const stringToken = typeof token === "string" ? token : token?.get?.() ?? ""; + + const api = createHttpClient({ + base: BART_URL, + headers: new Headers({ "X-Token-Api": `${stringToken}` }), + fetcher: fetchSafe, + }); + + const errorHandler = createErrorHandler({ + errorMessages: {}, + defaultErrorMessage: "Barte operation failed", + }); + + const state = { ...props, api, errorHandler }; + + return { + state, + manifest, + }; +} diff --git a/barte/utils/client.ts b/barte/utils/client.ts new file mode 100644 index 000000000..a7db93efa --- /dev/null +++ b/barte/utils/client.ts @@ -0,0 +1,15 @@ +import { GetChargesResponse, PartialRefundResponse } from "./types.ts"; +import { Props as GetChargesProps } from "../loaders/getCharges.ts"; + +export interface Client { + "PATCH /charges/partial-refund/:uuid": { + response: PartialRefundResponse; + body: { + value: number; + }; + }; + "GET /charges": { + response: GetChargesResponse; + searchParams: GetChargesProps; + }; +} diff --git a/barte/utils/constants.ts b/barte/utils/constants.ts new file mode 100644 index 000000000..e6dfe10b6 --- /dev/null +++ b/barte/utils/constants.ts @@ -0,0 +1 @@ +export const BART_URL = "https://api.barte.com/v2"; diff --git a/barte/utils/types.ts b/barte/utils/types.ts new file mode 100644 index 000000000..034d94243 --- /dev/null +++ b/barte/utils/types.ts @@ -0,0 +1,80 @@ +export interface PartialRefundResponse { + uuid: string; + value: number; +} + +export interface GetChargesResponse { + content: Content[]; + pageable: Pageable; + totalPages: number; + totalElements: number; + last: boolean; + numberOfElements: number; + size: number; + number: number; + sort: Sort; + first: boolean; + empty: boolean; +} + +export interface Content { + uuid: string; + title: string; + expirationDate: string; + paidDate: string; + value: number; + paymentMethod: string; + status: string; + customer: Customer; + authorizationCode: string; + authorizationNsu: string; + refunds: string[]; + retryable: boolean; +} + +export interface Customer { + uuid: string; + document: string; + type: string; + name: string; + email: string; + phone: string; +} + +export interface Pageable { + sort: Sort; + pageNumber: number; + pageSize: number; + offset: number; + paged: boolean; + unpaged: boolean; +} + +export interface Sort { + unsorted: boolean; + sorted: boolean; + empty: boolean; +} + +export type ChargeStatus = + | "ABANDONED" + | "CANCELED" + | "CHARGEBACK" + | "DISPUTE" + | "FAILED" + | "LATE" + | "PAID" + | "PAID_MANUALLY" + | "PRE_AUTHORIZED" + | "REFUND" + | "SCHEDULED"; + +export type PaymentMethod = + | "DEBIT_CARD" + | "APPLE_PAY" + | "BANK_SLIP" + | "CREDIT_CARD" + | "CREDIT_CARD_EARLY_BUYER" + | "CREDIT_CARD_EARLY_SELLER" + | "GOOGLE_PAY" + | "PIX"; diff --git a/blog/actions/submitRating.ts b/blog/actions/submitRating.ts new file mode 100644 index 000000000..9d4c7cec2 --- /dev/null +++ b/blog/actions/submitRating.ts @@ -0,0 +1,75 @@ +import { and, eq, like, or } from "npm:drizzle-orm@0.30.10"; +import { Person } from "../../commerce/types.ts"; +import { AppContext } from "../mod.ts"; +import { logger } from "@deco/deco/o11y"; +import { Rating } from "../types.ts"; +import { rating } from "../db/schema.ts"; + +export interface Props { + itemReviewed: string; + author: Person; + ratingValue: number; + additionalType?: string; +} + +export default async function submitRating( + { itemReviewed, author, ratingValue, additionalType }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const records = await ctx.invoke.records.loaders.drizzle(); + + try { + const storedRating = await records.select({ + id: rating.id, + itemReviewed: rating.itemReviewed, + author: rating.author, + ratingValue: rating.ratingValue, + additionalType: rating.additionalType, + }) + .from(rating).where( + and( + eq(rating.itemReviewed, itemReviewed), + or( + like(rating.author, `%"email":"${author.email}"%`), + like(rating.author, `%"id":"${author["@id"]}"%`), + ), + ), + ) as Rating[] | undefined; + + //if has data, then update de table + if (storedRating && storedRating.length > 0 && storedRating?.at(0)?.id) { + const current = storedRating.at(0)!; + await records.update(rating).set({ + ratingValue, + additionalType: additionalType ?? current.additionalType, + }).where( + eq(rating.id, current.id!), + ); + return { + ...current, + ratingValue, + additionalType: additionalType ?? current.additionalType, + }; + } + + const insertedData = { + itemReviewed, + author: author!, + ratingValue: ratingValue!, + additionalType: additionalType, + }; + + await records.insert(rating).values({ + ...insertedData, + }); + + return { + "@type": "Rating", + ...insertedData, + }; + } catch (e) { + logger.error(e); + return null; + } +} diff --git a/blog/actions/submitReview.ts b/blog/actions/submitReview.ts new file mode 100644 index 000000000..f199bf39f --- /dev/null +++ b/blog/actions/submitReview.ts @@ -0,0 +1,87 @@ +import { eq } from "npm:drizzle-orm@0.30.10"; +import { Person } from "../../commerce/types.ts"; +import { AppContext } from "../mod.ts"; +import { logger } from "@deco/deco/o11y"; +import { Review } from "../types.ts"; +import { getReviewById } from "../core/records.ts"; +import { review } from "../db/schema.ts"; + +export interface Props { + action: "create" | "update"; + id?: string; + reviewBody?: string; + reviewHeadline?: string; + itemReviewed?: string; + author?: Person; + /** Review status */ + additionalType?: string; + isAnonymous?: boolean; +} + +export default async function submitReview( + { + reviewBody, + reviewHeadline, + itemReviewed, + id, + author, + action, + additionalType, + isAnonymous, + }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const isoDate = new Date().toISOString(); + const records = await ctx.invoke.records.loaders.drizzle(); + + try { + if (action != "create") { + const storedReview = await getReviewById({ ctx, id }); + if (!storedReview) { + return null; + } + const updateRecord = { + additionalType: additionalType ?? storedReview.additionalType, + reviewHeadline: reviewHeadline ?? storedReview.reviewHeadline, + reviewBody: reviewBody ?? storedReview.reviewBody, + dateModified: isoDate, + }; + await records.update(review).set({ + ...updateRecord, + }).where( + eq(review.id, id!), + ); + + return { + ...updateRecord, + "@type": "Review", + author: author ?? storedReview.author, + datePublished: storedReview.datePublished, + }; + } + + const insertData = { + itemReviewed, + isAnonymous, + author: author!, + additionalType: additionalType, + reviewHeadline: reviewHeadline, + reviewBody: reviewBody!, + datePublished: isoDate, + dateModified: isoDate, + }; + + await records.insert(review).values({ + ...insertData, + }); + + return { + "@type": "Review", + ...insertData, + }; + } catch (e) { + logger.error(e); + return null; + } +} diff --git a/blog/actions/submitView.ts b/blog/actions/submitView.ts new file mode 100644 index 000000000..4bb2a76a0 --- /dev/null +++ b/blog/actions/submitView.ts @@ -0,0 +1,38 @@ +import { eq } from "npm:drizzle-orm@0.30.10"; +import { postViews } from "../db/schema.ts"; +import { AppContext } from "../mod.ts"; +import { ViewFromDatabase } from "../types.ts"; + +export interface Props { + id: string; +} + +export default async function action( + { id }: Props, + _req: Request, + ctx: AppContext, +): Promise<{ count: number }> { + const records = await ctx.invoke.records.loaders.drizzle(); + + const existingRecord = await records.select() + .from(postViews) + .where(eq(postViews.id, id)) + .get() as ViewFromDatabase | null; + + if (!existingRecord) { + await records.insert(postViews).values({ + id, + userInteractionCount: 1, + }); + + return { count: 1 }; + } + + const newCount = existingRecord.userInteractionCount! + 1; + + await records.update(postViews) + .set({ userInteractionCount: newCount }) + .where(eq(postViews.id, id)); + + return { count: newCount }; +} diff --git a/blog/core/handlePosts.ts b/blog/core/handlePosts.ts new file mode 100644 index 000000000..9d8859d46 --- /dev/null +++ b/blog/core/handlePosts.ts @@ -0,0 +1,214 @@ +import { postViews } from "../db/schema.ts"; +import { AppContext } from "../mod.ts"; +import { BlogPost, SortBy, ViewFromDatabase } from "../types.ts"; +import { VALID_SORT_ORDERS } from "../utils/constants.ts"; + +/** + * Returns an sorted BlogPost list + * + * @param posts Posts to be sorted + * @param sortBy Sort option (must be: "date_desc" | "date_asc" | "title_asc" | "title_desc" | "view_asc" | "view_desc" ) + */ +export const sortPosts = async ( + blogPosts: BlogPost[], + sortBy: SortBy, + ctx: AppContext, +) => { + const splittedSort = sortBy.split("_"); + + if (splittedSort[0] === "view") { + //If sort is "view_asc" or "view_desc" + + const records = await ctx.invoke.records.loaders.drizzle(); + //Deco records not installed + if (records.__resolveType) { + throw new Error("Deco Records not installed!"); + } + + //Get views from database + const views = await records.select({ + id: postViews.id, + userInteractionCount: postViews.userInteractionCount, + }).from(postViews) as ViewFromDatabase[] | null; + + if (!views) { + return blogPosts; + } + + //Act like a real extension + for (let i = 0; i < views.length; i++) { + const view = views[i]; + const post = blogPosts.findIndex(({ slug }) => slug === view.id); + + if (blogPosts[post]) { + blogPosts[post].interactionStatistic = { + "@type": "InteractionCounter", + userInteractionCount: view.userInteractionCount, + }; + } + } + + const sortOrder = VALID_SORT_ORDERS.includes(splittedSort[1]) + ? splittedSort[1] + : "desc"; + + //Sort and return + return blogPosts.toSorted((a, b) => { + const countOfA = a?.interactionStatistic?.userInteractionCount; + const countOfB = b?.interactionStatistic?.userInteractionCount; + if ( + !countOfA && + !countOfB + ) { + return 0; + } + + const comparison = (countOfA ?? 0) - (countOfB ?? 0); + return sortOrder === "desc" ? comparison : -comparison; + }); + } + + const sortMethod = splittedSort[0] in blogPosts[0] + ? splittedSort[0] as keyof BlogPost + : "date"; + const sortOrder = VALID_SORT_ORDERS.includes(splittedSort[1]) + ? splittedSort[1] + : "desc"; + + return blogPosts.toSorted((a, b) => { + if (!a[sortMethod] && !b[sortMethod]) { + return 0; // If both posts don't have the sort method, consider them equal + } + if (!a[sortMethod]) { + return 1; // If post a doesn't have sort method, put it after post b + } + if (!b[sortMethod]) { + return -1; // If post b doesn't have sort method, put it after post a + } + const comparison = sortMethod === "date" + ? new Date(b.date).getTime() - + new Date(a.date).getTime() + : a[sortMethod]?.toString().localeCompare( + b[sortMethod]?.toString() ?? "", + ) ?? 0; + return sortOrder === "desc" ? comparison : -comparison; // Invert sort depending of desc or asc + }); +}; + +/** + * Returns an filtered BlogPost list + * + * @param posts Posts to be handled + * @param slug Category Slug to be filter + */ +export const filterPostsByCategory = (posts: BlogPost[], slug?: string) => + slug + ? posts.filter(({ categories }) => categories.find((c) => c.slug === slug)) + : posts; + +/** + * Returns an filtered BlogPost list by specific slugs + * + * @param posts Posts to be handled + * @param postSlugs Specific slugs to be filter + */ +export const filterPostsBySlugs = (posts: BlogPost[], postSlugs: string[]) => + posts.filter(({ slug }) => postSlugs.includes(slug)); + +/** + * Returns an filtered BlogPost list + * + * @param posts Posts to be handled + * @param term Term to be filter + */ +export const filterPostsByTerm = (posts: BlogPost[], term: string) => + posts.filter(({ content, excerpt, title }) => + [content, excerpt, title].some((field) => + field.toLowerCase().includes(term.toLowerCase()) + ) + ); + +/** + * Returns an filtered BlogPost list + * + * @param posts Posts to be handled + * @param slug Category Slug to be filter + */ +export const filterRelatedPosts = ( + posts: BlogPost[], + slug: string[], +) => + posts.filter( + ({ categories }) => categories.find((c) => slug.includes(c.slug)), + ); + +/** + * Returns an filtered and sorted BlogPost list + * + * @param posts Posts to be handled + * @param pageNumber Actual page number + * @param postsPerPage Number of posts per page + */ +export const slicePosts = ( + posts: BlogPost[], + pageNumber: number, + postsPerPage: number, +) => { + const startIndex = (pageNumber - 1) * postsPerPage; + const endIndex = startIndex + postsPerPage; + return posts.slice(startIndex, endIndex); +}; + +const filterPosts = ( + posts: BlogPost[], + slug?: string | string[], + postSlugs?: string[], + term?: string, +): BlogPost[] => { + if (typeof slug === "string") { + const firstFilter = postSlugs && postSlugs.length > 0 + ? filterPostsBySlugs(posts, postSlugs) + : filterPostsByCategory(posts, slug); + + const filteredByTerm = term + ? filterPostsByTerm(firstFilter, term) + : firstFilter; + return filteredByTerm; + } + if (Array.isArray(slug)) { + return filterRelatedPosts(posts, slug); + } + + return posts; +}; + +/** + * Returns an filtered and sorted BlogPost list. It dont slice + * + * @param posts Posts to be handled + * @param sortBy Sort option (must be: "date_desc" | "date_asc" | "title_asc" | "title_desc") + * @param ctx AppContext + * @param slug Category slug or an array of slugs to be filtered + * @param postSlugs Specific slugs to be filtered + * @param term Term to be filtered + * @param excludePostSlug Slug to be excluded + */ +export default async function handlePosts( + posts: BlogPost[], + sortBy: SortBy, + ctx: AppContext, + slug?: string | string[], + postSlugs?: string[], + term?: string, + excludePostSlug?: string, +) { + const filteredPosts = filterPosts(posts, slug, postSlugs, term).filter( + ({ slug: postSlug }) => postSlug !== excludePostSlug, + ); + + if (!filteredPosts || filteredPosts.length === 0) { + return null; + } + + return await sortPosts(filteredPosts, sortBy, ctx); +} diff --git a/blog/core/records.ts b/blog/core/records.ts new file mode 100644 index 000000000..1750e0901 --- /dev/null +++ b/blog/core/records.ts @@ -0,0 +1,194 @@ +import { rating, review } from "../db/schema.ts"; +import { AppContext } from "../mod.ts"; +import { type Resolvable } from "@deco/deco"; +import { and, asc, desc, eq, notInArray } from "npm:drizzle-orm@0.30.10"; +import { BlogPost, Ignore, Rating, Review } from "../types.ts"; +import { logger } from "@deco/deco/o11y"; + +export async function getRecordsByPath( + ctx: AppContext, + path: string, + accessor: string, +): Promise { + const resolvables: Record> = await ctx.get({ + __resolveType: "resolvables", + }); + const current = Object.entries(resolvables).flatMap(([key, value]) => { + return key.startsWith(path) ? value : []; + }); + return (current as Record[]).map((item) => { + const id = (item.name as string).split(path)[1]?.replace("/", ""); + return { + ...item[accessor], + id, + }; + }); +} + +export async function getRatingsBySlug( + { ctx, slug }: { ctx: AppContext; slug: string }, +): Promise { + const records = await ctx.invoke.records.loaders.drizzle(); + try { + const currentRatings = await records.select({ + id: rating.id, + itemReviewed: rating.itemReviewed, + author: rating.author, + ratingValue: rating.ratingValue, + additionalType: rating.additionalType, + }) + .from(rating).where(eq(rating.itemReviewed, slug)) as + | Rating[] + | undefined; + + return currentRatings?.length === 0 || !currentRatings + ? [] + : currentRatings.map((rating) => ({ + ...rating, + bestRating: 5, + worstRating: 1, + })); + } catch (e) { + logger.error(e); + return []; + } +} + +export async function getRatings( + { ctx, post, ignoreRatings, onlyAggregate }: { + ctx: AppContext; + post: BlogPost; + ignoreRatings?: Ignore; + onlyAggregate?: boolean; + }, +): Promise { + const contentRating = await getRatingsBySlug({ + ctx, + slug: post.slug, + }); + + const { ratingCount, ratingTotal } = contentRating.length === 0 + ? { ratingCount: 0, ratingTotal: 0 } + : contentRating.reduce( + (acc, { ratingValue, additionalType }) => + ignoreRatings?.active && additionalType && + ignoreRatings.markedAs?.includes(additionalType) + ? acc + : { + ratingCount: acc.ratingCount + 1, + ratingTotal: acc.ratingTotal + (ratingValue ?? 0), + }, + { ratingCount: 0, ratingTotal: 0 }, + ); + + const ratingValue = ratingTotal / ratingCount; + + return { + ...post, + contentRating: onlyAggregate ? undefined : contentRating, + aggregateRating: { + ...post.aggregateRating, + "@type": "AggregateRating", + ratingCount, + ratingValue: isNaN(ratingValue) ? 0 : ratingValue, + bestRating: 5, + worstRating: 1, + }, + }; +} + +export const getReviewById = async ( + { ctx, id }: { ctx: AppContext; id?: string }, +): Promise => { + if (!id) { + return null; + } + const records = await ctx.invoke.records.loaders.drizzle(); + try { + const targetReview = await records.select({ + itemReviewed: review.itemReviewed, + author: review.author, + datePublished: review.datePublished, + dateModified: review.dateModified, + reviewBody: review.reviewBody, + reviewHeadline: review.reviewHeadline, + isAnonymous: review.isAnonymous, + additionalType: review.additionalType, + id: review.id, + }) + .from(review).where(eq(review.id, id)).get() as Review | undefined; + return targetReview ?? null; + } catch (e) { + logger.error(e); + return null; + } +}; + +export async function getReviewsBySlug( + { ctx, slug, ignoreReviews, orderBy = "date_desc" }: { + ctx: AppContext; + slug: string; + ignoreReviews?: Ignore; + orderBy?: "date_asc" | "date_desc"; + }, +): Promise { + const records = await ctx.invoke.records.loaders.drizzle(); + + const whereClause = ignoreReviews?.active && ignoreReviews?.markedAs && + ignoreReviews?.markedAs?.length > 0 + ? and( + eq(review.itemReviewed, slug), + notInArray(review.additionalType, ignoreReviews.markedAs), + ) + : eq(review.itemReviewed, slug); + const orderClause = orderBy.endsWith("desc") + ? desc(review.datePublished) + : asc(review.datePublished); + + try { + const currentComments = await records.select({ + itemReviewed: review.itemReviewed, + author: review.author, + datePublished: review.datePublished, + dateModified: review.dateModified, + reviewBody: review.reviewBody, + reviewHeadline: review.reviewHeadline, + isAnonymous: review.isAnonymous, + additionalType: review.additionalType, + id: review.id, + }) + .from(review).where(whereClause).orderBy(orderClause) as + | Review[] + | undefined; + + return currentComments ?? []; + } catch (e) { + logger.error(e); + return []; + } +} + +export async function getReviews( + { ctx, post, ...rest }: { + ctx: AppContext; + post: BlogPost; + ignoreReviews?: Ignore; + orderBy?: "date_asc" | "date_desc"; + }, +): Promise { + const review = await getReviewsBySlug({ + ctx, + slug: post.slug, + ...rest, + }); + + return { + ...post, + review, + aggregateRating: { + ...post.aggregateRating, + "@type": "AggregateRating", + reviewCount: review.length, + }, + }; +} diff --git a/blog/db/schema.ts b/blog/db/schema.ts new file mode 100644 index 000000000..a37608ed6 --- /dev/null +++ b/blog/db/schema.ts @@ -0,0 +1,30 @@ +import { + integer, + sqliteTable, + text, +} from "npm:drizzle-orm@0.30.10/sqlite-core"; + +export const rating = sqliteTable("rating", { + id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()), + itemReviewed: text("itemReviewed").notNull(), + author: text("author", { mode: "json" }), + ratingValue: (integer("ratingValue")).notNull(), + additionalType: text("additionalType"), +}); + +export const review = sqliteTable("review", { + id: text("id").primaryKey().$defaultFn(() => crypto.randomUUID()), + itemReviewed: text("itemReviewed").notNull(), + author: text("author", { mode: "json" }), + datePublished: (text("datePublished")).notNull(), + dateModified: (text("dateModified")).notNull(), + reviewHeadline: (text("reviewHeadline")), + reviewBody: (text("reviewBody")).notNull(), + additionalType: (text("additionalType")), + isAnonymous: integer("isAnonymous", { mode: "boolean" }), +}); + +export const postViews = sqliteTable("postViews", { + id: text("id").primaryKey(), + userInteractionCount: integer("userInteractionCount").notNull(), +}); diff --git a/blog/loaders/Author.ts b/blog/loaders/Author.ts new file mode 100644 index 000000000..3926c74cb --- /dev/null +++ b/blog/loaders/Author.ts @@ -0,0 +1,9 @@ +import { Author } from "../types.ts"; + +/** + * @title Author + * @description Defines a blog post author. + */ +const loader = ({ author }: { author: Author }): Author => author; + +export default loader; diff --git a/blog/loaders/BlogPostItem.ts b/blog/loaders/BlogPostItem.ts new file mode 100644 index 000000000..69161e918 --- /dev/null +++ b/blog/loaders/BlogPostItem.ts @@ -0,0 +1,36 @@ +import { AppContext } from "../mod.ts"; +import { BlogPost } from "../types.ts"; +import { getRecordsByPath } from "../core/records.ts"; +import type { RequestURLParam } from "../../website/functions/requestToParam.ts"; + +const COLLECTION_PATH = "collections/blog/posts"; +const ACCESSOR = "post"; + +export interface Props { + slug: RequestURLParam; +} + +/** + * @title BlogPostItem + * @description Fetches a specific blog post by its slug. + * + * Fetches a specific blog post by its slug. + * + * @param props - Contains the slug of the blog post. + * @param _req - The request object (unused). + * @param ctx - The application context. + * @returns A promise that resolves to the blog post or undefined if not found. + */ +export default async function BlogPostItem( + { slug }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const posts = await getRecordsByPath( + ctx, + COLLECTION_PATH, + ACCESSOR, + ); + + return posts.find((post) => post.slug === slug) || null; +} diff --git a/blog/loaders/BlogPostPage.ts b/blog/loaders/BlogPostPage.ts new file mode 100644 index 000000000..f12e002b5 --- /dev/null +++ b/blog/loaders/BlogPostPage.ts @@ -0,0 +1,53 @@ +import { AppContext } from "../mod.ts"; +import { BlogPost, BlogPostPage } from "../types.ts"; +import { getRecordsByPath } from "../core/records.ts"; +import type { RequestURLParam } from "../../website/functions/requestToParam.ts"; + +const COLLECTION_PATH = "collections/blog/posts"; +const ACCESSOR = "post"; + +export interface Props { + slug: RequestURLParam; +} + +/** + * @title BlogPostPage + * @description Fetches a specific blog post page by its slug. + * + * @param props - Contains the slug of the blog post. + * @param _req - The request object (unused). + * @param ctx - The application context. + * @returns A promise that resolves to the blog post or undefined if not found. + */ +export default async function BlogPostPageLoader( + { slug }: Props, + req: Request, + ctx: AppContext, +): Promise { + const posts = await getRecordsByPath( + ctx, + COLLECTION_PATH, + ACCESSOR, + ); + + const { url: baseUrl } = req; + const url = new URL(baseUrl); + + const post = posts.find((post) => post?.slug === slug); + + if (!post) { + return null; + } + + return { + "@type": "BlogPostPage", + post, + seo: { + title: post?.seo?.title || post?.title, + description: post?.seo?.description || post?.excerpt, + canonical: post?.seo?.canonical || url.href, + image: post?.seo?.image || post?.image, + noIndexing: post?.seo?.noIndexing || false, + }, + }; +} diff --git a/blog/loaders/BlogRelatedPosts.ts b/blog/loaders/BlogRelatedPosts.ts new file mode 100644 index 000000000..4441e32c8 --- /dev/null +++ b/blog/loaders/BlogRelatedPosts.ts @@ -0,0 +1,98 @@ +/** + * @title BlogRelatedPosts + * @description Retrieves a list of blog related posts. + * + * @param props - The props for the blog related post list. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog related posts. + */ +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import handlePosts, { slicePosts } from "../core/handlePosts.ts"; +import { getRecordsByPath } from "../core/records.ts"; +import { AppContext } from "../mod.ts"; +import { BlogPost, SortBy } from "../types.ts"; + +const COLLECTION_PATH = "collections/blog/posts"; +const ACCESSOR = "post"; + +export interface Props { + /** + * @title Items per page + * @description Number of posts per page to display. + */ + count?: number; + /** + * @title Page query parameter + * @description The current page number. Defaults to 1. + */ + page?: number; + /** + * @title Category Slug + * @description Filter by a specific category slug. + */ + slug?: RequestURLParam | string[]; + /** + * @title Page sorting parameter + * @description The sorting option. Default is "date_desc" + */ + sortBy?: SortBy; + /** + * @description Overrides the query term at url + */ + query?: string; + /** + * @title Exclude Post Slug + * @description Excludes a post slug from the list + */ + excludePostSlug?: RequestURLParam | string; +} + +/** + * @title BlogRelatedPosts + * @description Retrieves a list of blog related posts. + * + * @param props - The props for the blog related post list. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog related posts. + */ + +export type BlogRelatedPosts = BlogPost[] | null; + +export default async function BlogRelatedPosts( + { page, count, slug, sortBy, query, excludePostSlug }: Props, + req: Request, + ctx: AppContext, +): Promise { + const url = new URL(req.url); + const postsPerPage = Number(count ?? url.searchParams.get("count") ?? 12); + const pageNumber = Number(page ?? url.searchParams.get("page") ?? 1); + const pageSort = sortBy ?? (url.searchParams.get("sortBy") as SortBy) ?? + "date_desc"; + const term = query ?? url.searchParams.get("q") ?? undefined; + + const posts = await getRecordsByPath( + ctx, + COLLECTION_PATH, + ACCESSOR, + ); + + const handledPosts = await handlePosts( + posts, + pageSort, + ctx, + slug, + undefined, + term, + excludePostSlug, + ); + + if (!handledPosts) { + return null; + } + + const slicedPosts = slicePosts(handledPosts, pageNumber, postsPerPage); + + return slicedPosts.length > 0 ? slicedPosts : null; +} diff --git a/blog/loaders/Blogpost.ts b/blog/loaders/Blogpost.ts new file mode 100644 index 000000000..fde253ff5 --- /dev/null +++ b/blog/loaders/Blogpost.ts @@ -0,0 +1,9 @@ +import { BlogPost } from "../types.ts"; + +/** + * @title Blogpost + * @description Defines a blog post. + */ +const loader = ({ post }: { post: BlogPost }): BlogPost => post; + +export default loader; diff --git a/blog/loaders/BlogpostList.ts b/blog/loaders/BlogpostList.ts new file mode 100644 index 000000000..d34a83751 --- /dev/null +++ b/blog/loaders/BlogpostList.ts @@ -0,0 +1,99 @@ +/** + * Retrieves a list of blog posts. + * + * @param props - The props for the blog post list. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog posts. + */ +import { logger } from "@deco/deco/o11y"; +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { AppContext } from "../mod.ts"; +import { BlogPost, SortBy } from "../types.ts"; +import handlePosts, { slicePosts } from "../core/handlePosts.ts"; +import { getRecordsByPath } from "../core/records.ts"; + +const COLLECTION_PATH = "collections/blog/posts"; +const ACCESSOR = "post"; + +export interface Props { + /** + * @title Items per page + * @description Number of posts per page to display. + */ + count?: number; + /** + * @title Page query parameter + * @description The current page number. Defaults to 1. + */ + page?: number; + /** + * @title Category Slug + * @description Filter by a specific category slug. + */ + slug?: RequestURLParam; + /** + * @title Specific post slugs + * @description Filter by specific post slugs. + */ + postSlugs?: string[]; + /** + * @title Page sorting parameter + * @description The sorting option. Default is "date_desc" + */ + sortBy?: SortBy; + /** + * @description Overrides the query term at url + */ + query?: string; +} + +/** + * @title BlogPostList + * @description Retrieves a list of blog posts. + * + * @param props - The props for the blog post list. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog posts. + */ +export default async function BlogPostList( + { page, count, slug, sortBy, postSlugs, query }: Props, + req: Request, + ctx: AppContext, +): Promise { + const url = new URL(req.url); + const postsPerPage = Number(count ?? url.searchParams.get("count") ?? 12); + const pageNumber = Number(page ?? url.searchParams.get("page") ?? 1); + const pageSort = sortBy ?? url.searchParams.get("sortBy") as SortBy ?? + "date_desc"; + const term = query ?? url.searchParams.get("q") ?? undefined; + + const posts = await getRecordsByPath( + ctx, + COLLECTION_PATH, + ACCESSOR, + ); + + try { + const handledPosts = await handlePosts( + posts, + pageSort, + ctx, + slug, + postSlugs, + term, + ); + + if (!handledPosts) { + return null; + } + + const slicedPosts = slicePosts(handledPosts, pageNumber, postsPerPage); + + return slicedPosts.length > 0 ? slicedPosts : null; + } catch (e) { + logger.error(e); + return null; + } +} diff --git a/blog/loaders/BlogpostListing.ts b/blog/loaders/BlogpostListing.ts new file mode 100644 index 000000000..6689c7cb4 --- /dev/null +++ b/blog/loaders/BlogpostListing.ts @@ -0,0 +1,138 @@ +/** + * Retrieves a listing page of blog posts. + * + * @param props - The props for the blog post listing. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog posts. + */ +import { logger } from "@deco/deco/o11y"; +import { PageInfo } from "../../commerce/types.ts"; +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { AppContext } from "../mod.ts"; +import { BlogPost, BlogPostListingPage, SortBy } from "../types.ts"; +import handlePosts, { slicePosts } from "../core/handlePosts.ts"; +import { getRecordsByPath } from "../core/records.ts"; + +const COLLECTION_PATH = "collections/blog/posts"; +const ACCESSOR = "post"; + +export interface Props { + /** + * @title Category Slug + * @description Filter by a specific category slug. + */ + slug?: RequestURLParam; + /** + * @title Items per page + * @description Number of posts per page to display. + */ + count?: number; + /** + * @title Page query parameter + * @description The current page number. Defaults to 1. + */ + page?: number; + /** + * @title Page sorting parameter + * @description The sorting option. Default is "date_desc" + */ + sortBy?: SortBy; + /** + * @description Overrides the query term at url + */ + query?: string; +} + +/** + * @title BlogPostList + * @description Retrieves a list of blog posts. + * + * @param props - The props for the blog post list. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog posts. + */ +export default async function BlogPostList( + { page, count, slug, sortBy, query }: Props, + req: Request, + ctx: AppContext, +): Promise { + const url = new URL(req.url); + const params = url.searchParams; + const postsPerPage = Number(count ?? params.get("count") ?? 12); + const pageNumber = Number(page ?? params.get("page") ?? 1); + const pageSort = sortBy ?? params.get("sortBy") as SortBy ?? + "date_desc"; + const term = query ?? params.get("q") ?? undefined; + + const posts = await getRecordsByPath( + ctx, + COLLECTION_PATH, + ACCESSOR, + ); + + try { + const handledPosts = await handlePosts( + posts, + pageSort, + ctx, + slug, + undefined, + term, + ); + + if (!handledPosts) { + return null; + } + + const slicedPosts = slicePosts(handledPosts, pageNumber, postsPerPage); + + if (slicedPosts.length === 0) { + return null; + } + + const category = slicedPosts[0].categories.find((c) => c.slug === slug); + return { + posts: slicedPosts, + pageInfo: toPageInfo(handledPosts, postsPerPage, pageNumber, params), + seo: { + title: category?.name ?? "", + canonical: new URL(url.pathname, url.origin).href, + }, + }; + } catch (e) { + logger.error(e); + return null; + } +} + +const toPageInfo = ( + posts: BlogPost[], + postsPerPage: number, + pageNumber: number, + params: URLSearchParams, +): PageInfo => { + const totalPosts = posts.length; + const totalPages = Math.ceil(totalPosts / postsPerPage); + const hasNextPage = totalPages > pageNumber; + const hasPrevPage = pageNumber > 1; + const nextPage = new URLSearchParams(params); + const previousPage = new URLSearchParams(params); + + if (hasNextPage) { + nextPage.set("page", (pageNumber + 1).toString()); + } + + if (hasPrevPage) { + previousPage.set("page", (pageNumber - 1).toString()); + } + + return { + nextPage: hasNextPage ? `?${nextPage}` : undefined, + previousPage: hasPrevPage ? `?${previousPage}` : undefined, + currentPage: pageNumber, + records: totalPosts, + recordPerPage: postsPerPage, + }; +}; diff --git a/blog/loaders/Category.ts b/blog/loaders/Category.ts new file mode 100644 index 000000000..7a54da7a0 --- /dev/null +++ b/blog/loaders/Category.ts @@ -0,0 +1,9 @@ +import { Category } from "../types.ts"; + +/** + * @title Category + * @description Defines a blog post category. + */ +const loader = ({ category }: { category: Category }): Category => category; + +export default loader; diff --git a/blog/loaders/GetCategories.ts b/blog/loaders/GetCategories.ts new file mode 100644 index 000000000..c64317dc6 --- /dev/null +++ b/blog/loaders/GetCategories.ts @@ -0,0 +1,69 @@ +/** + * Retrieves a listing page of blog posts. + * + * @param props - The props for the blog post listing. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog posts. + */ +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { AppContext } from "../mod.ts"; +import { Category } from "../types.ts"; +import { getRecordsByPath } from "../core/records.ts"; + +const COLLECTION_PATH = "collections/blog/categories"; +const ACCESSOR = "category"; + +export interface Props { + /** + * @title Category Slug + * @description Get the category data from a specific slug. + */ + slug?: RequestURLParam; + /** + * @title Items count + * @description Number of categories to return + */ + count?: number; + /** + * @title Sort + * @description The sorting option. Default is "title_desc" + */ + sortBy?: "title_asc" | "title_desc"; +} + +/** + * @title BlogPostList + * @description Retrieves a list of blog posts. + * + * @param props - The props for the blog post list. + * @param req - The request object. + * @param ctx - The application context. + * @returns A promise that resolves to an array of blog posts. + */ +export default async function GetCategories( + { count, slug, sortBy = "title_desc" }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const categories = await getRecordsByPath( + ctx, + COLLECTION_PATH, + ACCESSOR, + ); + + if (!categories?.length) { + return null; + } + + if (slug) { + return categories.filter((c) => c.slug === slug); + } + + const sortedCategories = categories.sort((a, b) => { + const comparison = a.name.localeCompare(b.name); + return sortBy.endsWith("_desc") ? comparison : -comparison; + }); + + return count ? sortedCategories.slice(0, count) : sortedCategories; +} diff --git a/blog/loaders/extensions/BlogpostList.ts b/blog/loaders/extensions/BlogpostList.ts new file mode 100644 index 000000000..0e013e29a --- /dev/null +++ b/blog/loaders/extensions/BlogpostList.ts @@ -0,0 +1,16 @@ +import { + default as extend, + Props, +} from "../../../website/loaders/extension.ts"; +import { BlogPost } from "../../types.ts"; + +/** + * @title Extend your Blogpost List + */ +export default function ProductDetailsExt( + props: Props, +): Promise { + return extend(props); +} + +export const cache = "no-cache"; diff --git a/blog/loaders/extensions/BlogpostList/ratings.ts b/blog/loaders/extensions/BlogpostList/ratings.ts new file mode 100644 index 000000000..fb1647c3c --- /dev/null +++ b/blog/loaders/extensions/BlogpostList/ratings.ts @@ -0,0 +1,45 @@ +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { BlogPost, Ignore } from "../../../types.ts"; +import { getRatings } from "../../../core/records.ts"; + +interface Props { + /** + * @description Ignore ratings in the aggregateRating calc + */ + ignoreRatings?: Ignore; + /** + * @description Return only aggregate rating object + */ + onlyAggregate?: boolean; +} + +/** + * @title ExtensionOf BlogPost list: Ratings + * @description It can harm performance. Use wisely + */ +export default function ratingsExt( + { ignoreRatings, onlyAggregate }: Props, + _req: Request, + ctx: AppContext, +): ExtensionOf { + return async (posts: BlogPost[] | null) => { + if (posts?.length === 0 || !posts) { + return null; + } + + const postsWithRatings = await Promise.all( + posts.map(async (post) => { + const ratings = await getRatings({ + post, + ctx, + ignoreRatings, + onlyAggregate, + }); + return { ...post, ...ratings }; + }), + ); + + return postsWithRatings; + }; +} diff --git a/blog/loaders/extensions/BlogpostList/reviews.ts b/blog/loaders/extensions/BlogpostList/reviews.ts new file mode 100644 index 000000000..911fd860f --- /dev/null +++ b/blog/loaders/extensions/BlogpostList/reviews.ts @@ -0,0 +1,40 @@ +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { BlogPost, Ignore } from "../../../types.ts"; +import { getReviews } from "../../../core/records.ts"; + +interface Props { + /** + * @description Ignore specific reviews + */ + ignoreReviews?: Ignore; + /** + * @description Order By + */ + orderBy?: "date_asc" | "date_desc"; +} + +/** + * @title ExtensionOf BlogPost list: Reviews + * @description It can harm performance. Use wisely + */ +export default function reviewsExt( + { ignoreReviews, orderBy }: Props, + _req: Request, + ctx: AppContext, +): ExtensionOf { + return async (posts: BlogPost[] | null) => { + if (posts?.length === 0 || !posts) { + return null; + } + + const postsWithReviews = await Promise.all( + posts.map(async (post) => { + const reviews = await getReviews({ post, ctx, ignoreReviews, orderBy }); + return { ...post, ...reviews }; + }), + ); + + return postsWithReviews; + }; +} diff --git a/blog/loaders/extensions/BlogpostListing.ts b/blog/loaders/extensions/BlogpostListing.ts new file mode 100644 index 000000000..6b10238d4 --- /dev/null +++ b/blog/loaders/extensions/BlogpostListing.ts @@ -0,0 +1,16 @@ +import { + default as extend, + Props, +} from "../../../website/loaders/extension.ts"; +import { BlogPostListingPage } from "../../types.ts"; + +/** + * @title Extend your Blogpost Listing Page + */ +export default function ProductDetailsExt( + props: Props, +): Promise { + return extend(props); +} + +export const cache = "no-cache"; diff --git a/blog/loaders/extensions/BlogpostListing/ratings.ts b/blog/loaders/extensions/BlogpostListing/ratings.ts new file mode 100644 index 000000000..700f2774e --- /dev/null +++ b/blog/loaders/extensions/BlogpostListing/ratings.ts @@ -0,0 +1,48 @@ +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { BlogPostListingPage, Ignore } from "../../../types.ts"; +import { getRatings } from "../../../core/records.ts"; + +interface Props { + /** + * @description Ignore ratings in the aggregateRating calc + */ + ignoreRatings?: Ignore; + /** + * @description Return only aggregate rating object + */ + onlyAggregate?: boolean; +} + +/** + * @title ExtensionOf BlogPostListing: Ratings + * @description It can harm performance. Use wisely + */ +export default function ratingsExt( + { ignoreRatings, onlyAggregate }: Props, + _req: Request, + ctx: AppContext, +): ExtensionOf { + return async (blogpostListingPage: BlogPostListingPage | null) => { + if (!blogpostListingPage) { + return null; + } + + const posts = await Promise.all( + blogpostListingPage.posts.map(async (post) => { + const ratings = await getRatings({ + post, + ctx, + onlyAggregate, + ignoreRatings, + }); + return { ...post, ...ratings }; + }), + ); + + return { + ...blogpostListingPage, + posts, + }; + }; +} diff --git a/blog/loaders/extensions/BlogpostListing/reviews.ts b/blog/loaders/extensions/BlogpostListing/reviews.ts new file mode 100644 index 000000000..5549fab7e --- /dev/null +++ b/blog/loaders/extensions/BlogpostListing/reviews.ts @@ -0,0 +1,43 @@ +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { BlogPostListingPage, Ignore } from "../../../types.ts"; +import { getReviews } from "../../../core/records.ts"; + +interface Props { + /** + * @description Ignore specific reviews + */ + ignoreReviews?: Ignore; + /** + * @description Order By + */ + orderBy?: "date_asc" | "date_desc"; +} + +/** + * @title ExtensionOf BlogPostListing: Reviews + * @description It can harm performance. Use wisely + */ +export default function reviewsExt( + { ignoreReviews, orderBy }: Props, + _req: Request, + ctx: AppContext, +): ExtensionOf { + return async (blogpostListingPage: BlogPostListingPage | null) => { + if (!blogpostListingPage) { + return null; + } + + const posts = await Promise.all( + blogpostListingPage.posts.map(async (post) => { + const reviews = await getReviews({ post, ctx, ignoreReviews, orderBy }); + return { ...post, ...reviews }; + }), + ); + + return { + ...blogpostListingPage, + posts, + }; + }; +} diff --git a/blog/loaders/extensions/BlogpostPage.ts b/blog/loaders/extensions/BlogpostPage.ts new file mode 100644 index 000000000..80888014e --- /dev/null +++ b/blog/loaders/extensions/BlogpostPage.ts @@ -0,0 +1,16 @@ +import { + default as extend, + Props, +} from "../../../website/loaders/extension.ts"; +import { BlogPostPage } from "../../types.ts"; + +/** + * @title Extend your Blogpost Page + */ +export default function ProductDetailsExt( + props: Props, +): Promise { + return extend(props); +} + +export const cache = "no-cache"; diff --git a/blog/loaders/extensions/BlogpostPage/ratings.ts b/blog/loaders/extensions/BlogpostPage/ratings.ts new file mode 100644 index 000000000..37703aa53 --- /dev/null +++ b/blog/loaders/extensions/BlogpostPage/ratings.ts @@ -0,0 +1,33 @@ +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { BlogPostPage, Ignore } from "../../../types.ts"; +import { getRatings } from "../../../core/records.ts"; + +interface Props { + /** + * @description Ignore ratings in the aggregateRating calc + */ + ignoreRatings?: Ignore; +} + +/** + * @title ExtensionOf BlogPostPage: Ratings + * @description It can harm performance. Use wisely + */ +export default function ratingsExt( + { ignoreRatings }: Props, + _req: Request, + ctx: AppContext, +): ExtensionOf { + return async (blogpostPage: BlogPostPage | null) => { + if (!blogpostPage) { + return null; + } + const post = await getRatings({ + post: blogpostPage.post, + ctx, + ignoreRatings, + }); + return { ...blogpostPage, post }; + }; +} diff --git a/blog/loaders/extensions/BlogpostPage/reviews.ts b/blog/loaders/extensions/BlogpostPage/reviews.ts new file mode 100644 index 000000000..6e2a48f49 --- /dev/null +++ b/blog/loaders/extensions/BlogpostPage/reviews.ts @@ -0,0 +1,38 @@ +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { BlogPostPage, Ignore } from "../../../types.ts"; +import { getReviews } from "../../../core/records.ts"; + +interface Props { + /** + * @description Ignore specific reviews + */ + ignoreReviews?: Ignore; + /** + * @description Order By + */ + orderBy?: "date_asc" | "date_desc"; +} + +/** + * @title ExtensionOf BlogPostPage: Reviews + * @description It can harm performance. Use wisely + */ +export default function reviewsExt( + { ignoreReviews, orderBy }: Props, + _req: Request, + ctx: AppContext, +): ExtensionOf { + return async (blogpostPage: BlogPostPage | null) => { + if (!blogpostPage) { + return null; + } + const post = await getReviews({ + post: blogpostPage.post, + ctx, + ignoreReviews, + orderBy, + }); + return { ...blogpostPage, post }; + }; +} diff --git a/blog/manifest.gen.ts b/blog/manifest.gen.ts new file mode 100644 index 000000000..ce8f6fe2b --- /dev/null +++ b/blog/manifest.gen.ts @@ -0,0 +1,67 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/submitRating.ts"; +import * as $$$$$$$$$1 from "./actions/submitReview.ts"; +import * as $$$$$$$$$2 from "./actions/submitView.ts"; +import * as $$$0 from "./loaders/Author.ts"; +import * as $$$4 from "./loaders/Blogpost.ts"; +import * as $$$1 from "./loaders/BlogPostItem.ts"; +import * as $$$5 from "./loaders/BlogpostList.ts"; +import * as $$$6 from "./loaders/BlogpostListing.ts"; +import * as $$$2 from "./loaders/BlogPostPage.ts"; +import * as $$$3 from "./loaders/BlogRelatedPosts.ts"; +import * as $$$7 from "./loaders/Category.ts"; +import * as $$$9 from "./loaders/extensions/BlogpostList.ts"; +import * as $$$10 from "./loaders/extensions/BlogpostList/ratings.ts"; +import * as $$$11 from "./loaders/extensions/BlogpostList/reviews.ts"; +import * as $$$12 from "./loaders/extensions/BlogpostListing.ts"; +import * as $$$13 from "./loaders/extensions/BlogpostListing/ratings.ts"; +import * as $$$14 from "./loaders/extensions/BlogpostListing/reviews.ts"; +import * as $$$15 from "./loaders/extensions/BlogpostPage.ts"; +import * as $$$16 from "./loaders/extensions/BlogpostPage/ratings.ts"; +import * as $$$17 from "./loaders/extensions/BlogpostPage/reviews.ts"; +import * as $$$8 from "./loaders/GetCategories.ts"; +import * as $$$$$$0 from "./sections/Seo/SeoBlogPost.tsx"; +import * as $$$$$$1 from "./sections/Seo/SeoBlogPostListing.tsx"; +import * as $$$$$$2 from "./sections/Template.tsx"; + +const manifest = { + "loaders": { + "blog/loaders/Author.ts": $$$0, + "blog/loaders/Blogpost.ts": $$$4, + "blog/loaders/BlogPostItem.ts": $$$1, + "blog/loaders/BlogpostList.ts": $$$5, + "blog/loaders/BlogpostListing.ts": $$$6, + "blog/loaders/BlogPostPage.ts": $$$2, + "blog/loaders/BlogRelatedPosts.ts": $$$3, + "blog/loaders/Category.ts": $$$7, + "blog/loaders/extensions/BlogpostList.ts": $$$9, + "blog/loaders/extensions/BlogpostList/ratings.ts": $$$10, + "blog/loaders/extensions/BlogpostList/reviews.ts": $$$11, + "blog/loaders/extensions/BlogpostListing.ts": $$$12, + "blog/loaders/extensions/BlogpostListing/ratings.ts": $$$13, + "blog/loaders/extensions/BlogpostListing/reviews.ts": $$$14, + "blog/loaders/extensions/BlogpostPage.ts": $$$15, + "blog/loaders/extensions/BlogpostPage/ratings.ts": $$$16, + "blog/loaders/extensions/BlogpostPage/reviews.ts": $$$17, + "blog/loaders/GetCategories.ts": $$$8, + }, + "sections": { + "blog/sections/Seo/SeoBlogPost.tsx": $$$$$$0, + "blog/sections/Seo/SeoBlogPostListing.tsx": $$$$$$1, + "blog/sections/Template.tsx": $$$$$$2, + }, + "actions": { + "blog/actions/submitRating.ts": $$$$$$$$$0, + "blog/actions/submitReview.ts": $$$$$$$$$1, + "blog/actions/submitView.ts": $$$$$$$$$2, + }, + "name": "blog", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/blog/mod.ts b/blog/mod.ts new file mode 100644 index 000000000..257937f83 --- /dev/null +++ b/blog/mod.ts @@ -0,0 +1,29 @@ +import manifest, { Manifest } from "./manifest.gen.ts"; +import { PreviewContainer } from "../utils/preview.tsx"; +import { type App, type FnContext } from "@deco/deco"; +// deno-lint-ignore no-explicit-any +export type State = any; +export type AppContext = FnContext; +/** + * @title Deco Blog + * @description Manage your posts. + * @category Tool + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png + */ +export default function App(state: State): App { + return { manifest, state }; +} +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Deco Blog", + owner: "deco.cx", + description: "Manage your posts, categories and authors.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png", + images: [], + tabs: [], + }, + }; +}; diff --git a/blog/sections/Seo/SeoBlogPost.tsx b/blog/sections/Seo/SeoBlogPost.tsx new file mode 100644 index 000000000..92b950e55 --- /dev/null +++ b/blog/sections/Seo/SeoBlogPost.tsx @@ -0,0 +1,62 @@ +import Seo from "../../../website/components/Seo.tsx"; +import { + renderTemplateString, + SEOSection, +} from "../../../website/components/Seo.tsx"; +import { BlogPostPage } from "../../types.ts"; +import { AppContext } from "../../mod.ts"; + +export interface Props { + /** @title Data Source */ + jsonLD: BlogPostPage | null; + /** @title Title Override */ + title?: string; + /** @title Description Override */ + description?: string; +} + +/** @title Blog Post details */ +export function loader(props: Props, _req: Request, ctx: AppContext) { + const { + titleTemplate = "%s", + descriptionTemplate = "%s", + ...seoSiteProps + } = ctx.seo ?? {}; + + const { title: titleProp, description: descriptionProp, jsonLD } = props; + + const title = renderTemplateString( + titleTemplate, + titleProp || jsonLD?.seo?.title || "", + ); + const description = renderTemplateString( + descriptionTemplate, + descriptionProp || jsonLD?.seo?.description || "", + ); + + const image = jsonLD?.post?.image; + const canonical = jsonLD?.seo?.canonical ? jsonLD?.seo?.canonical : undefined; + const noIndexing = !jsonLD || jsonLD.seo?.noIndexing; + + // Some HTML can break the meta tag + const jsonLDWithoutContent = { + ...jsonLD, + post: { ...jsonLD?.post, content: undefined }, + }; + + return { + ...seoSiteProps, + title, + description, + image, + canonical, + noIndexing, + jsonLDs: [jsonLDWithoutContent], + }; +} + +function Section(props: Props): SEOSection { + return ; +} + +export default Section; diff --git a/blog/sections/Seo/SeoBlogPostListing.tsx b/blog/sections/Seo/SeoBlogPostListing.tsx new file mode 100644 index 000000000..885da1cdd --- /dev/null +++ b/blog/sections/Seo/SeoBlogPostListing.tsx @@ -0,0 +1,60 @@ +import Seo from "../../../website/components/Seo.tsx"; +import { + renderTemplateString, + SEOSection, +} from "../../../website/components/Seo.tsx"; +import { BlogPostListingPage } from "../../types.ts"; +import { AppContext } from "../../mod.ts"; + +export interface Props { + /** @title Data Source */ + jsonLD: BlogPostListingPage | null; + /** @title Title Override */ + title?: string; + /** @title Description Override */ + description?: string; +} + +/** @title Blog Post details */ +export function loader(props: Props, _req: Request, ctx: AppContext) { + const { + titleTemplate = "%s", + descriptionTemplate = "%s", + ...seoSiteProps + } = ctx.seo ?? {}; + + const { title: titleProp, description: descriptionProp, jsonLD } = props; + + const title = renderTemplateString( + titleTemplate, + titleProp || jsonLD?.seo?.title || "", + ); + const description = renderTemplateString( + descriptionTemplate, + descriptionProp || jsonLD?.seo?.description || "", + ); + + const canonical = jsonLD?.seo?.canonical ? jsonLD?.seo?.canonical : undefined; + const noIndexing = !jsonLD || jsonLD.seo?.noIndexing; + + // Some HTML can break the meta tag + const jsonLDWithoutContent = { + ...jsonLD, + post: { ...jsonLD?.posts, content: undefined }, + }; + + return { + ...seoSiteProps, + title, + description, + canonical, + noIndexing, + jsonLDs: [jsonLDWithoutContent], + }; +} + +function Section(props: Props): SEOSection { + return ; +} + +export default Section; diff --git a/blog/sections/Template.tsx b/blog/sections/Template.tsx new file mode 100644 index 000000000..4ee094d3b --- /dev/null +++ b/blog/sections/Template.tsx @@ -0,0 +1,46 @@ +import { BlogPost } from "../types.ts"; +import { CSS } from "../static/css.ts"; + +export interface Props { + post: BlogPost | null; +} + +export default function Template({ post }: Props) { + if (!post) return null; + + const { + title = "Title", + content = "Content", + excerpt = "Excerpt", + date, + image, + alt, + } = post; + + return ( + <> + + + + ); +} diff --git a/data-for-seo/README.md b/data-for-seo/README.md new file mode 100644 index 000000000..ba05efa82 --- /dev/null +++ b/data-for-seo/README.md @@ -0,0 +1,105 @@ +# DataForSEO App + +This app provides integration with the DataForSEO API for comprehensive SEO data analysis. + +## Features + +- Keyword research with search volume and competition data +- SERP analysis (organic and paid results) +- Backlink analysis and domain metrics +- Traffic analytics and sources breakdown +- Advanced keyword difficulty analysis +- Domain comparison tools + +## Configuration + +To use this app, you need a DataForSEO account: + +1. Sign up for a DataForSEO account at https://dataforseo.com +2. Get your login (email) and password from your account +3. Add the credentials when installing the app in Deco + +The app uses Basic Authentication - your credentials are encoded and sent with each API request. + +## Available Loaders + +### Keywords Data +- `getSearchVolume` - Get search volume, CPC, and competition data for keywords +- `getRelatedKeywords` - Get keyword suggestions related to seed keywords +- `getAdsCompetition` - Get Google Ads competition data including CPC and bid estimates + +### SERP Analysis +- `getOrganicResults` - Get organic search results from Google SERP +- `getAdResults` - Get paid ads results from Google SERP +- `getMapsResults` - Get Google Maps/Local Pack results + +### Backlink Analysis +- `getBacklinksOverview` - Get an overview of backlinks data for a domain +- `getBacklinks` - Get a detailed list of backlinks for a domain or URL +- `getAnchors` - Get anchor text distribution analysis +- `getReferringDomains` - Get list of domains linking to target + +### Traffic Analytics +- `getTrafficOverview` - Get website traffic overview metrics +- `getTrafficBySources` - Get traffic breakdown by source (direct, organic, paid, referral, social) +- `getTrafficByCountry` - Get traffic distribution by country +- `getTrafficByPages` - Get traffic metrics for individual pages + +## Available Actions + +### Analysis Tools +- `analyzeKeywordDifficulty` - Analyze keyword difficulty based on competition and SERP analysis +- `compareDomainMetrics` - Compare traffic and backlink metrics between multiple domains +- `generateSEOAudit` - Comprehensive SEO audit with traffic, backlinks, and keyword analysis +- `analyzeLocalSEO` - Local SEO analysis for businesses with local presence +- `trackSERPFeatures` - Monitor and analyze SERP features for target keywords + +## API Behavior + +DataForSEO API works in two modes: + +1. **Task-based endpoints** (Keywords, SERP): + - You post a task and receive a task ID + - The loader automatically polls for results + - May take 10-60 seconds to complete + +2. **Live endpoints** (Backlinks, Traffic): + - Return results immediately + - No polling required + +## Usage Examples + +```typescript +// Get keyword search volume +const volumeData = await ctx.invoke.dataforseo.loaders.keywords.getSearchVolume({ + keywords: ["seo tools", "keyword research"], + language_name: "English", + location_name: "United States" +}); + +// Analyze keyword difficulty +const difficulty = await ctx.invoke.dataforseo.actions.analyzeKeywordDifficulty({ + keywords: ["digital marketing", "seo services"], + language_name: "English", + location_name: "United States" +}); + +// Compare domains +const comparison = await ctx.invoke.dataforseo.actions.compareDomainMetrics({ + domains: ["example.com", "competitor1.com", "competitor2.com"] +}); + +// Get backlinks overview +const backlinks = await ctx.invoke.dataforseo.loaders.backlinks.getBacklinksOverview({ + target: "example.com" +}); +``` + +## Rate Limits + +DataForSEO has rate limits based on your subscription plan. The loaders handle API responses but be aware of: +- Concurrent request limits +- Daily/monthly request quotas +- Cost per API call (varies by endpoint) + +Check your DataForSEO dashboard for current usage and limits. diff --git a/data-for-seo/actions/analyzeKeywordDifficulty.ts b/data-for-seo/actions/analyzeKeywordDifficulty.ts new file mode 100644 index 000000000..0493d7182 --- /dev/null +++ b/data-for-seo/actions/analyzeKeywordDifficulty.ts @@ -0,0 +1,309 @@ +import { AppContext } from "../mod.ts"; +import type { DataForSeoTaskResponse, KeywordData } from "../client.ts"; + +interface Props { + /** + * @title Keywords + * @description Keywords to analyze difficulty (max 10) + */ + keywords: string[]; + + /** + * @title Language + * @description Language name (e.g., "English", "Portuguese") + * @default English + */ + language_name?: string; + + /** + * @title Location + * @description Location name (e.g., "United States", "Brazil") + * @default United States + */ + location_name?: string; +} + +export interface KeywordDifficultyAnalysis { + keyword: string; + metrics: { + search_volume: number; + cpc: number; + competition: number; + }; + difficulty_score: number; + difficulty_level: "easy" | "medium" | "hard" | "very hard"; + top_competitors: Array<{ + domain: string; + position: number; + title: string; + }>; + recommendations: string[]; +} + +/** + * @title Analyze Keyword Difficulty + * @description Analyze keyword difficulty based on competition and SERP analysis + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + keywords, + language_name = "English", + location_name = "United States", + } = props; + + if (!keywords || keywords.length === 0) { + throw new Error("Please provide at least one keyword"); + } + + if (keywords.length > 10) { + throw new Error("Maximum 10 keywords allowed for difficulty analysis"); + } + + // Get search volume data + const volumeTaskResponse = await ctx.client + ["POST /keywords_data/google/search_volume/task_post"]( + {}, + { + body: [{ + keywords, + language_name, + location_name, + }], + }, + ); + + const volumeTaskData = await volumeTaskResponse + .json() as DataForSeoTaskResponse; + const volumeTaskId = volumeTaskData.tasks?.[0]?.id; + + if (!volumeTaskId) { + throw new Error("Failed to create search volume task"); + } + + // Get SERP data for each keyword + const serpTaskIds: { keyword: string; taskId: string }[] = []; + + for (const keyword of keywords) { + const serpTaskResponse = await ctx.client + ["POST /serp/google/organic/task_post"]( + {}, + { + body: [{ + keyword, + language_name, + location_name, + depth: 10, + }], + }, + ); + + const serpTaskData = await serpTaskResponse + .json() as DataForSeoTaskResponse; + const serpTaskId = serpTaskData.tasks?.[0]?.id; + + if (serpTaskId) { + serpTaskIds.push({ keyword, taskId: serpTaskId }); + } + } + + // Wait for volume data + let volumeData: KeywordData[] = []; + let attempts = 0; + const maxAttempts = 30; + const delay = 2000; + + while (attempts < maxAttempts) { + await new Promise((resolve) => setTimeout(resolve, delay)); + + const volumeResultResponse = await ctx.client + [`GET /keywords_data/google/search_volume/task_get/:id`]({ + id: volumeTaskId, + }); + + const volumeResultData = await volumeResultResponse + .json() as DataForSeoTaskResponse; + + if ( + volumeResultData.status_code === 20000 && + volumeResultData.tasks?.[0]?.result + ) { + const volumeResults = volumeResultData.tasks[0].result as Array<{ + keyword: string; + search_volume?: number; + cpc?: number; + competition?: number; + }>; + volumeData = volumeResults.map((item) => ({ + keyword: item.keyword, + search_volume: item.search_volume || 0, + cpc: item.cpc || 0, + competition: item.competition || 0, + competition_level: "medium" as string, + monthly_searches: [], + })); + break; + } + + attempts++; + } + + // Get SERP results for each keyword + const serpResults: Map< + string, + Array<{ domain: string; position: number; title: string }> + > = new Map(); + + for (const { keyword, taskId } of serpTaskIds) { + attempts = 0; + + while (attempts < maxAttempts) { + await new Promise((resolve) => setTimeout(resolve, delay)); + + const serpResultResponse = await ctx.client + [`GET /serp/google/organic/task_get/:id`]({ + id: taskId, + }); + + const serpResultData = await serpResultResponse + .json() as DataForSeoTaskResponse; + + if ( + serpResultData.status_code === 20000 && + serpResultData.tasks?.[0]?.result?.[0] + ) { + const result = serpResultData.tasks[0].result[0] as { + items?: Array<{ + type: string; + domain: string; + rank_absolute: number; + title: string; + }>; + }; + + if (result.items) { + const items = result.items + .filter((item) => item.type === "organic") + .slice(0, 10) + .map((item) => ({ + domain: item.domain, + position: item.rank_absolute, + title: item.title, + })); + + serpResults.set(keyword, items); + } + break; + } + + attempts++; + } + } + + // Analyze difficulty for each keyword + return keywords.map((keyword) => { + const metricsData = volumeData.find((v) => v.keyword === keyword); + const metrics = metricsData || { + search_volume: 0, + cpc: 0, + competition: 0, + } as { search_volume: number; cpc: number; competition: number }; + + const topCompetitors = (serpResults.get(keyword) || []).map((item) => ({ + domain: item.domain, + position: item.position, + title: item.title, + })); + + // Calculate difficulty score (0-100) + let difficultyScore = 0; + + // Factor 1: Competition level (0-1) = 30% + difficultyScore += metrics.competition * 30; + + // Factor 2: Top 10 domain authority approximation = 40% + const bigDomains = topCompetitors.filter((c) => + c.domain.includes("wikipedia") || + c.domain.includes("amazon") || + c.domain.includes("youtube") || + c.domain.includes("facebook") || + c.domain.includes("google") || + c.domain.includes("microsoft") || + c.domain.includes(".gov") || + c.domain.includes(".edu") + ).length; + difficultyScore += (bigDomains / 10) * 40; + + // Factor 3: Search volume impact = 20% + if (metrics.search_volume > 10000) { + difficultyScore += 20; + } else if (metrics.search_volume > 1000) { + difficultyScore += 10; + } else if (metrics.search_volume > 100) { + difficultyScore += 5; + } + + // Factor 4: CPC as indicator of commercial value = 10% + if (metrics.cpc > 5) { + difficultyScore += 10; + } else if (metrics.cpc > 2) { + difficultyScore += 5; + } + + // Determine difficulty level + let difficultyLevel: "easy" | "medium" | "hard" | "very hard"; + if (difficultyScore < 25) { + difficultyLevel = "easy"; + } else if (difficultyScore < 50) { + difficultyLevel = "medium"; + } else if (difficultyScore < 75) { + difficultyLevel = "hard"; + } else { + difficultyLevel = "very hard"; + } + + // Generate recommendations + const recommendations: string[] = []; + + if (difficultyLevel === "easy") { + recommendations.push("Low competition - good opportunity for quick wins"); + recommendations.push( + "Focus on creating comprehensive, high-quality content", + ); + } else if (difficultyLevel === "medium") { + recommendations.push( + "Moderate competition - requires solid SEO strategy", + ); + recommendations.push("Build topic authority with related content"); + recommendations.push("Focus on earning quality backlinks"); + } else if (difficultyLevel === "hard") { + recommendations.push("High competition - consider long-tail variations"); + recommendations.push("Requires significant link building efforts"); + recommendations.push("Create exceptional, unique content to stand out"); + } else { + recommendations.push( + "Very high competition - extremely challenging to rank", + ); + recommendations.push("Consider targeting less competitive variations"); + recommendations.push("Focus on building domain authority first"); + } + + if (metrics.search_volume < 100) { + recommendations.push( + "Low search volume - validate demand before investing heavily", + ); + } + + return { + keyword, + metrics: metricsData || metrics, + difficulty_score: Math.round(difficultyScore), + difficulty_level: difficultyLevel, + top_competitors: topCompetitors.slice(0, 5), + recommendations, + }; + }); +} diff --git a/data-for-seo/actions/analyzeLocalSEO.ts b/data-for-seo/actions/analyzeLocalSEO.ts new file mode 100644 index 000000000..814a86468 --- /dev/null +++ b/data-for-seo/actions/analyzeLocalSEO.ts @@ -0,0 +1,442 @@ +import { AppContext } from "../mod.ts"; +import type { MapsResult, SerpItem } from "../client.ts"; + +export interface Props { + /** + * @title Business Name + * @description Name of the business to analyze + */ + businessName: string; + + /** + * @title Location + * @description City or region for local analysis + */ + location: string; + + /** + * @title Category Keywords + * @description Keywords related to business category (e.g., "restaurant", "dentist") + */ + categoryKeywords: string[]; + + /** + * @title Competitor Names + * @description Names of local competitors + * @default [] + */ + competitors?: string[]; + + /** + * @title Language Name + * @description Language for search + * @default English + */ + language_name?: string; +} + +export interface LocalSEOAnalysis { + business: { + name: string; + location: string; + visibility_score: number; + local_pack_appearances: number; + avg_position: number; + }; + local_rankings: Array<{ + keyword: string; + maps_position: number | null; + organic_position: number | null; + has_local_pack: boolean; + competitors_in_pack: string[]; + }>; + competitor_analysis: Array<{ + name: string; + appearances: number; + avg_rating: number; + review_count: number; + keywords_dominated: string[]; + }>; + opportunities: { + missing_keywords: Array<{ + keyword: string; + search_volume_estimate: string; + competition: "low" | "medium" | "high"; + current_leaders: string[]; + }>; + review_gap: { + your_reviews: number; + competitor_avg: number; + reviews_needed: number; + }; + }; + recommendations: { + immediate: string[]; + optimization_tips: string[]; + content_ideas: string[]; + }; +} + +/** + * @title Analyze Local SEO + * @description Comprehensive local SEO analysis for businesses with local presence + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + businessName, + location, + categoryKeywords, + competitors = [], + language_name = "English", + } = props; + + const localRankings: LocalSEOAnalysis["local_rankings"] = []; + const competitorData = new Map(); + + let totalPosition = 0; + let rankedCount = 0; + let localPackAppearances = 0; + + // Initialize competitor tracking + competitors.forEach((comp) => { + competitorData.set(comp.toLowerCase(), { + appearances: 0, + ratings: [], + reviews: [], + keywords: [], + }); + }); + + // Analyze each keyword + for (const keyword of categoryKeywords) { + const searchQuery = `${keyword} ${location}`; + + try { + // Get Maps results + const mapsResponse = await ctx.client["POST /serp/google/maps/task_post"]( + {}, + { + body: [{ + keyword: searchQuery, + language_name, + location_name: location, + }], + }, + ); + + const mapsData = await mapsResponse.json(); + const mapsTaskId = mapsData.tasks?.[0]?.id; + + // Get Organic results + const organicResponse = await ctx.client + ["POST /serp/google/organic/task_post"]( + {}, + { + body: [{ + keyword: searchQuery, + language_name, + location_name: location, + }], + }, + ); + + const organicData = await organicResponse.json(); + const organicTaskId = organicData.tasks?.[0]?.id; + + // Wait for processing + await new Promise((resolve) => setTimeout(resolve, 3000)); + + let mapsPosition: number | null = null; + let organicPosition: number | null = null; + let hasLocalPack = false; + const competitorsInPack: string[] = []; + + // Process Maps results + if (mapsTaskId) { + const mapsResultResp = await ctx.client + [`GET /serp/google/organic/task_get/:id`]({ + "id": mapsTaskId, + }); + + const mapsResultData = await mapsResultResp.json(); + const mapsResult = mapsResultData.tasks?.[0]?.result?.[0] as { + items?: MapsResult[]; + } | undefined; + const mapsItems = mapsResult?.items; + + if (mapsItems && mapsItems.length > 0) { + hasLocalPack = true; + + mapsItems.forEach((item, index) => { + const itemName = item.title.toLowerCase(); + + // Check if it's our business + if (itemName.includes(businessName.toLowerCase())) { + mapsPosition = index + 1; + localPackAppearances++; + totalPosition += mapsPosition; + rankedCount++; + } + + // Track competitors + competitors.forEach((comp) => { + if (itemName.includes(comp.toLowerCase())) { + competitorsInPack.push(comp); + const data = competitorData.get(comp.toLowerCase())!; + data.appearances++; + data.keywords.push(keyword); + if (item.rating) { + data.ratings.push(item.rating.value); + data.reviews.push(item.rating.votes_count); + } + } + }); + }); + } + } + + // Process Organic results + if (organicTaskId) { + const organicResultResp = await ctx.client + [`GET /serp/google/organic/task_get/:id`]({ + "id": organicTaskId, + }); + + const organicResultData = await organicResultResp.json(); + const organicResult = organicResultData.tasks?.[0]?.result?.[0] as { + items?: SerpItem[]; + } | undefined; + const organicItems = organicResult?.items; + + if (organicItems) { + const position = organicItems.findIndex((item) => + item.title.toLowerCase().includes(businessName.toLowerCase()) || + item.domain.toLowerCase().includes(businessName.toLowerCase()) + ); + + if (position >= 0) { + organicPosition = position + 1; + if (!mapsPosition) { + totalPosition += organicPosition; + rankedCount++; + } + } + } + } + + localRankings.push({ + keyword, + maps_position: mapsPosition, + organic_position: organicPosition, + has_local_pack: hasLocalPack, + competitors_in_pack: competitorsInPack, + }); + } catch (error) { + console.error(`Error analyzing keyword ${keyword}:`, error); + } + } + + // Calculate metrics + const avgPosition = rankedCount > 0 ? totalPosition / rankedCount : 0; + const visibilityScore = calculateLocalVisibilityScore( + localRankings, + localPackAppearances, + ); + + // Process competitor data + const competitorAnalysis = Array.from(competitorData.entries()).map(( + [name, data], + ) => ({ + name: competitors.find((c) => c.toLowerCase() === name) || name, + appearances: data.appearances, + avg_rating: data.ratings.length > 0 + ? data.ratings.reduce((a, b) => a + b, 0) / data.ratings.length + : 0, + review_count: data.reviews.length > 0 + ? Math.round( + data.reviews.reduce((a, b) => a + b, 0) / data.reviews.length, + ) + : 0, + keywords_dominated: data.keywords, + })); + + // Identify opportunities + const opportunities = identifyLocalOpportunities( + localRankings, + competitorAnalysis, + categoryKeywords, + ); + + // Generate recommendations + const recommendations = generateLocalRecommendations( + localRankings, + competitorAnalysis, + opportunities, + ); + + return { + business: { + name: businessName, + location, + visibility_score: visibilityScore, + local_pack_appearances: localPackAppearances, + avg_position: Math.round(avgPosition * 10) / 10, + }, + local_rankings: localRankings, + competitor_analysis: competitorAnalysis, + opportunities, + recommendations, + }; +} + +function calculateLocalVisibilityScore( + rankings: LocalSEOAnalysis["local_rankings"], + packAppearances: number, +): number { + let score = 0; + + // Base score from local pack appearances + score += packAppearances * 15; + + // Additional points for top positions + rankings.forEach((ranking) => { + if (ranking.maps_position && ranking.maps_position <= 3) { + score += 10; + } else if (ranking.maps_position && ranking.maps_position <= 5) { + score += 5; + } + + if (ranking.organic_position && ranking.organic_position <= 5) { + score += 5; + } + }); + + // Normalize to 0-100 + return Math.min(100, score); +} + +function identifyLocalOpportunities( + rankings: LocalSEOAnalysis["local_rankings"], + competitors: LocalSEOAnalysis["competitor_analysis"], + keywords: string[], +): LocalSEOAnalysis["opportunities"] { + // Find keywords where we're not ranking but competitors are + const missingKeywords = rankings + .filter((r) => !r.maps_position && r.competitors_in_pack.length > 0) + .map((r) => ({ + keyword: keywords.find((k) => r.keyword.includes(k)) || r.keyword, + search_volume_estimate: estimateLocalVolume(r.keyword), + competition: r.competitors_in_pack.length > 2 + ? "high" as const + : r.competitors_in_pack.length > 0 + ? "medium" as const + : "low" as const, + current_leaders: r.competitors_in_pack, + })); + + // Calculate review gap + const competitorAvgReviews = competitors.length > 0 + ? competitors.reduce((sum, c) => sum + c.review_count, 0) / + competitors.length + : 100; + + const yourReviews = 50; // Placeholder - would need actual data + const reviewGap = { + your_reviews: yourReviews, + competitor_avg: Math.round(competitorAvgReviews), + reviews_needed: Math.max( + 0, + Math.round(competitorAvgReviews * 1.2 - yourReviews), + ), + }; + + return { + missing_keywords: missingKeywords, + review_gap: reviewGap, + }; +} + +function estimateLocalVolume(keyword: string): string { + // Simplified volume estimation based on keyword type + if (keyword.includes("near me")) return "1K-5K"; + if (keyword.includes("best")) return "500-1K"; + if (keyword.length > 30) return "100-500"; + return "500-2K"; +} + +function generateLocalRecommendations( + rankings: LocalSEOAnalysis["local_rankings"], + competitors: LocalSEOAnalysis["competitor_analysis"], + opportunities: LocalSEOAnalysis["opportunities"], +): LocalSEOAnalysis["recommendations"] { + const immediate = []; + const optimizationTips = []; + const contentIdeas = []; + + // Review recommendations + if (opportunities.review_gap.reviews_needed > 0) { + immediate.push( + `Generate ${opportunities.review_gap.reviews_needed} new reviews to match competitor average`, + ); + } + + // Local pack optimization + const notInPack = + rankings.filter((r) => r.has_local_pack && !r.maps_position).length; + if (notInPack > 0) { + immediate.push( + `Optimize Google Business Profile for ${notInPack} keywords with local pack`, + ); + } + + // Optimization tips + optimizationTips.push( + "Ensure NAP (Name, Address, Phone) consistency across all directories", + ); + optimizationTips.push( + "Add high-quality photos to Google Business Profile weekly", + ); + optimizationTips.push("Respond to all reviews within 24-48 hours"); + + if (opportunities.missing_keywords.length > 0) { + optimizationTips.push( + "Update business description with missing category keywords", + ); + } + + // Content ideas + rankings.forEach((ranking) => { + if (!ranking.organic_position || ranking.organic_position > 10) { + contentIdeas.push(`Create location page for "${ranking.keyword}"`); + } + }); + + contentIdeas.push("Publish monthly local community involvement posts"); + contentIdeas.push( + "Create area-specific service pages with local schema markup", + ); + + // Top competitors to monitor + const topCompetitor = + competitors.sort((a, b) => b.appearances - a.appearances)[0]; + if (topCompetitor) { + immediate.push( + `Monitor and analyze ${topCompetitor.name}'s local SEO strategy`, + ); + } + + return { + immediate: immediate.slice(0, 5), + optimization_tips: optimizationTips.slice(0, 5), + content_ideas: contentIdeas.slice(0, 5), + }; +} diff --git a/data-for-seo/actions/async/createAdsCompetitionTask.ts b/data-for-seo/actions/async/createAdsCompetitionTask.ts new file mode 100644 index 000000000..e83c7ed3c --- /dev/null +++ b/data-for-seo/actions/async/createAdsCompetitionTask.ts @@ -0,0 +1,46 @@ +import { AppContext } from "../../mod.ts"; +import { handleTaskCreationResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keywords + * @description List of keywords to analyze Google Ads competition + */ + keywords: string[]; + + /** + * @title Language Name + * @description Language of the keywords (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location (e.g., "United States", "Brazil") + */ + location_name?: string; +} + +/** + * @name CREATE_ADS_COMPETITION_TASK + * @title Create Ads Competition Task + * @description Create a task to analyze Google Ads competition data for keywords + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client + ["POST /keywords_data/google/ads_competition/task_post"]( + {}, + { + body: [{ + keywords: props.keywords, + language_name: props.language_name, + location_name: props.location_name, + }], + }, + ); + return await handleTaskCreationResponse(response, "Competição de Anúncios"); +} diff --git a/data-for-seo/actions/async/createAdsSerpTask.ts b/data-for-seo/actions/async/createAdsSerpTask.ts new file mode 100644 index 000000000..4a75e0343 --- /dev/null +++ b/data-for-seo/actions/async/createAdsSerpTask.ts @@ -0,0 +1,52 @@ +import { AppContext } from "../../mod.ts"; +import { handleTaskCreationResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keyword + * @description The keyword to search for ads + */ + keyword: string; + + /** + * @title Language Name + * @description Search language (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Location for the search (e.g., "United States", "Brazil") + */ + location_name?: string; + + /** + * @title Device + * @description Device type for search results + */ + device?: "desktop" | "mobile"; +} + +/** + * @name CREATE_ADS_SERP_TASK + * @title Create Ads SERP Task + * @description Create a task to analyze paid ads results from Google + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /serp/google/ads/task_post"]( + {}, + { + body: [{ + keyword: props.keyword, + language_name: props.language_name, + location_name: props.location_name, + device: props.device, + }], + }, + ); + return await handleTaskCreationResponse(response, "Anúncios do Google"); +} diff --git a/data-for-seo/actions/async/createMapsSerpTask.ts b/data-for-seo/actions/async/createMapsSerpTask.ts new file mode 100644 index 000000000..ba569b005 --- /dev/null +++ b/data-for-seo/actions/async/createMapsSerpTask.ts @@ -0,0 +1,52 @@ +import { AppContext } from "../../mod.ts"; +import { handleTaskCreationResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keyword + * @description The search query for Google Maps + */ + keyword: string; + + /** + * @title Language Name + * @description Language for the search (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location (e.g., "New York", "São Paulo") + */ + location_name?: string; + + /** + * @title Device + * @description Device type for the search + */ + device?: "desktop" | "mobile"; +} + +/** + * @name CREATE_MAPS_SERP_TASK + * @title Create Maps SERP Task + * @description Create a task to analyze Google Maps local results + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /serp/google/maps/task_post"]( + {}, + { + body: [{ + keyword: props.keyword, + language_name: props.language_name, + location_name: props.location_name, + device: props.device, + }], + }, + ); + return await handleTaskCreationResponse(response, "Google Maps Local"); +} diff --git a/data-for-seo/actions/async/createOrganicSerpTask.ts b/data-for-seo/actions/async/createOrganicSerpTask.ts new file mode 100644 index 000000000..ab2bf2b07 --- /dev/null +++ b/data-for-seo/actions/async/createOrganicSerpTask.ts @@ -0,0 +1,59 @@ +import { AppContext } from "../../mod.ts"; +import { handleTaskCreationResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keyword + * @description The keyword to search for + */ + keyword: string; + + /** + * @title Language Name + * @description Search language (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Location for the search (e.g., "United States", "Brazil") + */ + location_name?: string; + + /** + * @title Device + * @description Device type for search results + */ + device?: "desktop" | "mobile"; + + /** + * @title Depth + * @description Number of results to return + */ + depth?: number; +} + +/** + * @name CREATE_ORGANIC_SERP_TASK + * @title Create Organic SERP Task + * @description Create a task to analyze organic search results from Google + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /serp/google/organic/task_post"]( + {}, + { + body: [{ + keyword: props.keyword, + language_name: props.language_name, + location_name: props.location_name, + device: props.device, + depth: props.depth, + }], + }, + ); + return await handleTaskCreationResponse(response, "Resultados Orgânicos"); +} diff --git a/data-for-seo/actions/async/createRelatedKeywordsTask.ts b/data-for-seo/actions/async/createRelatedKeywordsTask.ts new file mode 100644 index 000000000..5bf9afd6e --- /dev/null +++ b/data-for-seo/actions/async/createRelatedKeywordsTask.ts @@ -0,0 +1,60 @@ +import { AppContext } from "../../mod.ts"; +import { handleTaskCreationResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keywords + * @description Seed keywords to get related suggestions + */ + keywords: string[]; + + /** + * @title Language Name + * @description Language for the keywords (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Location for keyword data (e.g., "United States", "Brazil") + */ + location_name?: string; + + /** + * @title Limit + * @description Maximum number of related keywords to return + */ + limit?: number; + + /** + * @title Include Seed Keyword + * @description Include seed keywords in results + */ + include_seed_keyword?: boolean; +} + +/** + * @name CREATE_RELATED_KEYWORDS_TASK + * @title Create Related Keywords Task + * @description Create a task to find keyword suggestions related to seed keywords + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client + ["POST /keywords_data/google/related_keywords/task_post"]( + {}, + { + body: [{ + keywords: props.keywords, + language_name: props.language_name, + location_name: props.location_name, + limit: props.limit, + include_seed_keyword: props.include_seed_keyword, + }], + }, + ); + return await handleTaskCreationResponse(response, "Palavras Relacionadas"); +} diff --git a/data-for-seo/actions/async/createSearchVolumeTask.ts b/data-for-seo/actions/async/createSearchVolumeTask.ts new file mode 100644 index 000000000..1c0d0bf63 --- /dev/null +++ b/data-for-seo/actions/async/createSearchVolumeTask.ts @@ -0,0 +1,46 @@ +import { AppContext } from "../../mod.ts"; +import { handleTaskCreationResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keywords + * @description List of keywords to analyze + */ + keywords: string[]; + + /** + * @title Language Name + * @description Language for the search (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Location for the search (e.g., "United States", "Brazil") + */ + location_name?: string; +} + +/** + * @name CREATE_SEARCH_VOLUME_TASK + * @title Create Search Volume Task + * @description Create a task to analyze search volume data for keywords + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client + ["POST /keywords_data/google/search_volume/task_post"]( + {}, + { + body: [{ + keywords: props.keywords, + language_name: props.language_name, + location_name: props.location_name, + }], + }, + ); + return await handleTaskCreationResponse(response, "Volume de Busca"); +} diff --git a/data-for-seo/actions/compareDomainMetrics.ts b/data-for-seo/actions/compareDomainMetrics.ts new file mode 100644 index 000000000..0400da18f --- /dev/null +++ b/data-for-seo/actions/compareDomainMetrics.ts @@ -0,0 +1,260 @@ +import { AppContext } from "../mod.ts"; +import type { + BacklinksOverview, + DataForSeoTaskResponse, + TrafficOverview, +} from "../client.ts"; + +interface Props { + /** + * @title Domains + * @description List of domains to compare (2-5 domains) + */ + domains: string[]; +} + +export interface DomainComparison { + domain: string; + traffic: { + visits: number; + unique_visitors: number; + bounce_rate: number; + pages_per_visit: number; + avg_visit_duration: number; + }; + backlinks: { + total_backlinks: number; + referring_domains: number; + dofollow_percentage: number; + domain_rank: number; + }; + performance_score: number; +} + +export interface ComparisonResult { + domains: DomainComparison[]; + winner: { + traffic: string; + backlinks: string; + overall: string; + }; + insights: string[]; +} + +/** + * @title Compare Domain Metrics + * @description Compare traffic and backlink metrics between multiple domains + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { domains } = props; + + if (!domains || domains.length < 2) { + throw new Error("Please provide at least 2 domains to compare"); + } + + if (domains.length > 5) { + throw new Error("Maximum 5 domains allowed for comparison"); + } + + // Fetch traffic and backlinks data for all domains + const domainData: DomainComparison[] = []; + + for (const domain of domains) { + try { + // Get traffic data + const trafficResponse = await ctx.client + ["POST /traffic_analytics/overview/live"]( + {}, + { + body: [{ target: domain }], + }, + ); + const trafficData = await trafficResponse + .json() as DataForSeoTaskResponse; + const traffic = trafficData.tasks?.[0]?.result?.[0] as TrafficOverview || + { + visits: 0, + unique_visitors: 0, + bounce_rate: 0, + pages_per_visit: 0, + avg_visit_duration: 0, + }; + + // Get backlinks data + const backlinksResponse = await ctx.client + ["POST /backlinks/domain_info/live"]( + {}, + { + body: [{ target: domain }], + }, + ); + const backlinksData = await backlinksResponse + .json() as DataForSeoTaskResponse; + const backlinks = + backlinksData.tasks?.[0]?.result?.[0] as BacklinksOverview || { + total_backlinks: 0, + referring_domains: 0, + dofollow: 0, + nofollow: 0, + rank: 0, + }; + + // Calculate performance score + let performanceScore = 0; + + // Traffic metrics (50%) + if (traffic.visits > 0) { + performanceScore += Math.min(traffic.visits / 100000, 1) * 20; // Visits score + performanceScore += Math.min(traffic.pages_per_visit / 5, 1) * 10; // Engagement + performanceScore += Math.max(1 - traffic.bounce_rate / 100, 0) * 10; // Low bounce rate + performanceScore += Math.min(traffic.avg_visit_duration / 300, 1) * 10; // Time on site + } + + // Backlink metrics (50%) + if (backlinks.total_backlinks > 0) { + performanceScore += Math.min(backlinks.referring_domains / 1000, 1) * + 20; // Domain diversity + const dofollow_percentage = backlinks.dofollow / + backlinks.total_backlinks; + performanceScore += dofollow_percentage * 15; // Quality links + performanceScore += Math.min(backlinks.rank / 100, 1) * 15; // Domain rank + } + + domainData.push({ + domain, + traffic: { + visits: traffic.visits || 0, + unique_visitors: traffic.unique_visitors || 0, + bounce_rate: traffic.bounce_rate || 0, + pages_per_visit: traffic.pages_per_visit || 0, + avg_visit_duration: traffic.avg_visit_duration || 0, + }, + backlinks: { + total_backlinks: backlinks.total_backlinks || 0, + referring_domains: backlinks.referring_domains || 0, + dofollow_percentage: backlinks.total_backlinks > 0 + ? (backlinks.dofollow / backlinks.total_backlinks) * 100 + : 0, + domain_rank: backlinks.rank || 0, + }, + performance_score: Math.round(performanceScore), + }); + } catch (error) { + console.error(`Error fetching data for ${domain}:`, error); + domainData.push({ + domain, + traffic: { + visits: 0, + unique_visitors: 0, + bounce_rate: 0, + pages_per_visit: 0, + avg_visit_duration: 0, + }, + backlinks: { + total_backlinks: 0, + referring_domains: 0, + dofollow_percentage: 0, + domain_rank: 0, + }, + performance_score: 0, + }); + } + } + + // Determine winners + const trafficWinner = + domainData.reduce((a, b) => a.traffic.visits > b.traffic.visits ? a : b) + .domain; + + const backlinksWinner = + domainData.reduce((a, b) => + a.backlinks.referring_domains > b.backlinks.referring_domains ? a : b + ).domain; + + const overallWinner = + domainData.reduce((a, b) => + a.performance_score > b.performance_score ? a : b + ).domain; + + // Generate insights + const insights: string[] = []; + + // Traffic insights + const avgTraffic = domainData.reduce((sum, d) => sum + d.traffic.visits, 0) / + domainData.length; + const highTrafficDomains = domainData.filter((d) => + d.traffic.visits > avgTraffic * 2 + ); + if (highTrafficDomains.length > 0) { + insights.push( + `${ + highTrafficDomains.map((d) => d.domain).join(", ") + } have significantly higher traffic than average`, + ); + } + + // Engagement insights + const bestEngagement = domainData.reduce((a, b) => + a.traffic.pages_per_visit > b.traffic.pages_per_visit ? a : b + ); + if (bestEngagement.traffic.pages_per_visit > 3) { + insights.push( + `${bestEngagement.domain} has excellent user engagement with ${ + bestEngagement.traffic.pages_per_visit.toFixed(1) + } pages per visit`, + ); + } + + // Backlink insights + const avgReferringDomains = + domainData.reduce((sum, d) => sum + d.backlinks.referring_domains, 0) / + domainData.length; + const strongBacklinkProfiles = domainData.filter((d) => + d.backlinks.referring_domains > avgReferringDomains * 2 + ); + if (strongBacklinkProfiles.length > 0) { + insights.push( + `${ + strongBacklinkProfiles.map((d) => d.domain).join(", ") + } have strong backlink profiles`, + ); + } + + // Quality insights + const highQualityDomains = domainData.filter((d) => + d.backlinks.dofollow_percentage > 70 + ); + if (highQualityDomains.length > 0) { + insights.push( + `${ + highQualityDomains.map((d) => d.domain).join(", ") + } have high-quality backlink profiles (>70% dofollow)`, + ); + } + + // Weakness insights + const weakDomains = domainData.filter((d) => d.performance_score < 30); + if (weakDomains.length > 0) { + insights.push( + `${ + weakDomains.map((d) => d.domain).join(", ") + } need significant improvements in both traffic and backlinks`, + ); + } + + return { + domains: domainData.sort((a, b) => + b.performance_score - a.performance_score + ), + winner: { + traffic: trafficWinner, + backlinks: backlinksWinner, + overall: overallWinner, + }, + insights, + }; +} diff --git a/data-for-seo/actions/createAdsCompetitionTask.ts b/data-for-seo/actions/createAdsCompetitionTask.ts new file mode 100644 index 000000000..d7aa11bf4 --- /dev/null +++ b/data-for-seo/actions/createAdsCompetitionTask.ts @@ -0,0 +1,46 @@ +import { AppContext } from "../mod.ts"; +import { handleDataForSeoResponse } from "../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keywords + * @description List of keywords to analyze Google Ads competition + */ + keywords: string[]; + + /** + * @title Language Name + * @description Language of the keywords (e.g., "English", "Portuguese") + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location (e.g., "United States", "Brazil") + */ + location_name?: string; +} + +/** + * @name CREATE_ADS_COMPETITION_TASK + * @title Create Ads Competition Task + * @description Create a task to analyze Google Ads competition data for keywords + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client + ["POST /keywords_data/google/ads_competition/task_post"]( + {}, + { + body: [{ + keywords: props.keywords, + language_name: props.language_name, + location_name: props.location_name, + }], + }, + ); + return await handleDataForSeoResponse(response, "Ads Competition POST"); +} diff --git a/data-for-seo/actions/generateSEOAudit.ts b/data-for-seo/actions/generateSEOAudit.ts new file mode 100644 index 000000000..0e2d0de95 --- /dev/null +++ b/data-for-seo/actions/generateSEOAudit.ts @@ -0,0 +1,489 @@ +import { AppContext } from "../mod.ts"; +import type { + BacklinksOverview, + SerpItem, + TrafficOverview, +} from "../client.ts"; + +export interface Props { + /** + * @title Domain + * @description Domain to audit + */ + domain: string; + + /** + * @title Primary Keywords + * @description Main keywords to analyze SERP positions + */ + keywords: string[]; + + /** + * @title Competitors + * @description Competitor domains for comparison + * @default [] + */ + competitors?: string[]; + + /** + * @title Language Name + * @description Language for keyword analysis + * @default English + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location + * @default United States + */ + location_name?: string; +} + +export interface SEOAuditReport { + domain: string; + audit_date: string; + overview: { + overall_score: number; + traffic_metrics: { + monthly_visits: number; + unique_visitors: number; + bounce_rate: number; + pages_per_visit: number; + }; + backlink_metrics: { + total_backlinks: number; + referring_domains: number; + domain_rank: number; + dofollow_ratio: number; + }; + keyword_visibility: { + tracked_keywords: number; + top_3_positions: number; + top_10_positions: number; + avg_position: number; + }; + }; + issues: { + critical: Array<{ + type: string; + description: string; + impact: string; + recommendation: string; + }>; + warnings: Array<{ + type: string; + description: string; + impact: string; + recommendation: string; + }>; + opportunities: Array<{ + type: string; + description: string; + potential_impact: string; + effort: "low" | "medium" | "high"; + }>; + }; + competitor_analysis?: { + domain_comparison: Array<{ + domain: string; + traffic: number; + backlinks: number; + domain_rank: number; + }>; + keyword_gaps: Array<{ + keyword: string; + competitor_positions: Record; + search_volume: number; + }>; + }; + action_plan: { + immediate: string[]; + short_term: string[]; + long_term: string[]; + }; +} + +/** + * @title Generate SEO Audit + * @description Comprehensive SEO audit with traffic, backlinks, and keyword analysis + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + domain, + keywords, + competitors = [], + language_name = "English", + location_name = "United States", + } = props; + + // Fetch traffic overview + const trafficResponse = await ctx.client + ["POST /traffic_analytics/overview/live"]( + {}, + { body: [{ target: domain }] }, + ); + const trafficData = await trafficResponse.json(); + const traffic = trafficData.tasks?.[0]?.result?.[0] as + | TrafficOverview + | undefined; + + // Fetch backlinks overview + const backlinksResponse = await ctx.client + ["POST /backlinks/domain_info/live"]( + {}, + { body: [{ target: domain }] }, + ); + const backlinksData = await backlinksResponse.json(); + const backlinks = backlinksData.tasks?.[0]?.result?.[0] as + | BacklinksOverview + | undefined; + + // Analyze keyword positions + const keywordPositions: Record = {}; + let totalPosition = 0; + let trackedCount = 0; + + for (const keyword of keywords) { + try { + const serpResponse = await ctx.client + ["POST /serp/google/organic/task_post"]( + {}, + { + body: [{ + keyword, + language_name, + location_name, + }], + }, + ); + + const serpData = await serpResponse.json(); + const taskId = serpData.tasks?.[0]?.id; + + if (taskId) { + // Wait for processing + await new Promise((resolve) => setTimeout(resolve, 2000)); + + const resultResponse = await ctx.client + [`GET /serp/google/organic/task_get/:id`]({ + "id": taskId, + }); + + const resultData = await resultResponse.json(); + const result = resultData.tasks?.[0]?.result?.[0] as { + items?: SerpItem[]; + } | undefined; + const items = result?.items; + + if (items) { + const position = items.findIndex((item) => + item.domain.includes(domain) + ) + 1; + if (position > 0) { + keywordPositions[keyword] = position; + totalPosition += position; + trackedCount++; + } + } + } + } catch (error) { + console.error(`Error analyzing keyword ${keyword}:`, error); + } + } + + // Calculate metrics + const avgPosition = trackedCount > 0 ? totalPosition / trackedCount : 0; + const top3Count = + Object.values(keywordPositions).filter((p) => p <= 3).length; + const top10Count = + Object.values(keywordPositions).filter((p) => p <= 10).length; + + // Generate issues and recommendations + const issues = analyzeIssues(traffic, backlinks, keywordPositions); + + // Competitor analysis + let competitorAnalysis; + if (competitors.length > 0) { + competitorAnalysis = await analyzeCompetitors( + domain, + competitors, + keywords, + ctx, + language_name, + location_name, + ); + } + + // Calculate overall score + const overallScore = calculateSEOScore(traffic, backlinks, avgPosition); + + // Generate action plan + const actionPlan = generateActionPlan(issues, competitorAnalysis); + + return { + domain, + audit_date: new Date().toISOString(), + overview: { + overall_score: overallScore, + traffic_metrics: { + monthly_visits: traffic?.visits || 0, + unique_visitors: traffic?.unique_visitors || 0, + bounce_rate: traffic?.bounce_rate || 0, + pages_per_visit: traffic?.pages_per_visit || 0, + }, + backlink_metrics: { + total_backlinks: backlinks?.total_backlinks || 0, + referring_domains: backlinks?.referring_domains || 0, + domain_rank: backlinks?.rank || 0, + dofollow_ratio: backlinks && backlinks.total_backlinks > 0 + ? (backlinks.dofollow / backlinks.total_backlinks) * 100 + : 0, + }, + keyword_visibility: { + tracked_keywords: keywords.length, + top_3_positions: top3Count, + top_10_positions: top10Count, + avg_position: Math.round(avgPosition * 10) / 10, + }, + }, + issues, + competitor_analysis: competitorAnalysis, + action_plan: actionPlan, + }; +} + +function analyzeIssues( + traffic: TrafficOverview | undefined, + backlinks: BacklinksOverview | undefined, + keywordPositions: Record, +): SEOAuditReport["issues"] { + const critical = []; + const warnings = []; + const opportunities: SEOAuditReport["issues"]["opportunities"] = []; + + // Traffic issues + if (!traffic || traffic.visits < 1000) { + critical.push({ + type: "Low Traffic", + description: "Monthly visits are below 1,000", + impact: "Limited organic visibility and conversions", + recommendation: "Focus on content creation and keyword targeting", + }); + } + + if (traffic && traffic.bounce_rate > 70) { + warnings.push({ + type: "High Bounce Rate", + description: `Bounce rate is ${traffic.bounce_rate}% (above 70%)`, + impact: "Users leaving without engagement", + recommendation: "Improve page load speed and content relevance", + }); + } + + // Backlink issues + if (!backlinks || backlinks.referring_domains < 50) { + critical.push({ + type: "Weak Backlink Profile", + description: "Less than 50 referring domains", + impact: "Limited domain authority and ranking potential", + recommendation: "Implement link building campaign", + }); + } + + if (backlinks && backlinks.dofollow / backlinks.total_backlinks < 0.5) { + warnings.push({ + type: "Low Dofollow Ratio", + description: "Less than 50% of backlinks are dofollow", + impact: "Reduced link equity transfer", + recommendation: "Focus on acquiring high-quality dofollow links", + }); + } + + // Keyword issues + const trackedCount = Object.keys(keywordPositions).length; + if (trackedCount === 0) { + critical.push({ + type: "No Keyword Rankings", + description: "Not ranking for any tracked keywords", + impact: "No organic search visibility", + recommendation: "Create targeted content for primary keywords", + }); + } + + // Opportunities + if (traffic && traffic.pages_per_visit < 2) { + opportunities.push({ + type: "Improve Internal Linking", + description: "Low pages per visit indicates poor internal navigation", + potential_impact: "20-30% increase in page views", + effort: "medium", + }); + } + + const notRankingKeywords = Object.entries(keywordPositions).filter(( + [_, pos], + ) => pos > 10); + if (notRankingKeywords.length > 0) { + opportunities.push({ + type: "Quick Win Keywords", + description: `${notRankingKeywords.length} keywords ranking on page 2-3`, + potential_impact: "50% traffic increase potential", + effort: "low", + }); + } + + return { critical, warnings, opportunities }; +} + +async function analyzeCompetitors( + _domain: string, + competitors: string[], + keywords: string[], + ctx: AppContext, + _language_name: string, + _location_name: string, +): Promise { + const domainComparison = []; + const keywordGaps: NonNullable< + SEOAuditReport["competitor_analysis"] + >["keyword_gaps"] = []; + + // Get competitor metrics + for (const competitor of competitors.slice(0, 3)) { + try { + const trafficResp = await ctx.client + ["POST /traffic_analytics/overview/live"]( + {}, + { body: [{ target: competitor }] }, + ); + const trafficData = await trafficResp.json(); + const traffic = trafficData.tasks?.[0]?.result?.[0] as + | TrafficOverview + | undefined; + + const backlinksResp = await ctx.client + ["POST /backlinks/domain_info/live"]( + {}, + { body: [{ target: competitor }] }, + ); + const backlinksData = await backlinksResp.json(); + const backlinks = backlinksData.tasks?.[0]?.result?.[0] as + | BacklinksOverview + | undefined; + + domainComparison.push({ + domain: competitor, + traffic: traffic?.visits || 0, + backlinks: backlinks?.total_backlinks || 0, + domain_rank: backlinks?.rank || 0, + }); + } catch (error) { + console.error(`Error analyzing competitor ${competitor}:`, error); + } + } + + // Analyze keyword gaps (simplified) + for (const keyword of keywords.slice(0, 10)) { + const positions: Record = {}; + + // Add placeholder data - in real implementation would check each competitor's position + competitors.forEach((comp) => { + positions[comp] = Math.floor(Math.random() * 20) + 1; + }); + + keywordGaps.push({ + keyword, + competitor_positions: positions, + search_volume: Math.floor(Math.random() * 5000) + 100, + }); + } + + return { + domain_comparison: domainComparison, + keyword_gaps: keywordGaps, + }; +} + +function calculateSEOScore( + traffic: TrafficOverview | undefined, + backlinks: BacklinksOverview | undefined, + avgPosition: number, +): number { + let score = 0; + + // Traffic score (30 points) + if (traffic) { + if (traffic.visits > 10000) score += 30; + else if (traffic.visits > 5000) score += 20; + else if (traffic.visits > 1000) score += 10; + + if (traffic.bounce_rate < 50) score += 10; + else if (traffic.bounce_rate < 70) score += 5; + } + + // Backlinks score (30 points) + if (backlinks) { + if (backlinks.referring_domains > 500) score += 20; + else if (backlinks.referring_domains > 100) score += 15; + else if (backlinks.referring_domains > 50) score += 10; + + if (backlinks.rank > 70) score += 10; + else if (backlinks.rank > 50) score += 5; + } + + // Keyword score (30 points) + if (avgPosition > 0 && avgPosition <= 3) score += 30; + else if (avgPosition <= 10) score += 20; + else if (avgPosition <= 20) score += 10; + + return Math.min(100, score); +} + +function generateActionPlan( + issues: SEOAuditReport["issues"], + competitorAnalysis?: SEOAuditReport["competitor_analysis"], +): SEOAuditReport["action_plan"] { + const immediate: string[] = []; + const shortTerm: string[] = []; + const longTerm: string[] = []; + + // Based on critical issues + issues.critical.forEach((issue) => { + immediate.push(issue.recommendation); + }); + + // Based on warnings + issues.warnings.forEach((issue) => { + shortTerm.push(issue.recommendation); + }); + + // Based on opportunities + issues.opportunities.forEach((opp) => { + if (opp.effort === "low") { + immediate.push(opp.description); + } else if (opp.effort === "medium") { + shortTerm.push(opp.description); + } else { + longTerm.push(opp.description); + } + }); + + // Competitor insights + if (competitorAnalysis) { + longTerm.push("Analyze and replicate successful competitor strategies"); + if (competitorAnalysis.keyword_gaps) { + longTerm.push("Target competitor keyword gaps for content creation"); + } + } + + return { + immediate: immediate.slice(0, 5), + short_term: shortTerm.slice(0, 5), + long_term: longTerm.slice(0, 5), + }; +} diff --git a/data-for-seo/actions/trackSERPFeatures.ts b/data-for-seo/actions/trackSERPFeatures.ts new file mode 100644 index 000000000..a57a94b10 --- /dev/null +++ b/data-for-seo/actions/trackSERPFeatures.ts @@ -0,0 +1,570 @@ +import { AppContext } from "../mod.ts"; +import type { SerpItem } from "../client.ts"; + +export interface Props { + /** + * @title Keywords + * @description Keywords to track SERP features for + */ + keywords: string[]; + + /** + * @title Domain + * @description Your domain to check feature ownership + */ + domain: string; + + /** + * @title Language Name + * @description Language for search + * @default English + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location + * @default United States + */ + location_name?: string; + + /** + * @title Device + * @description Device type for search + * @default desktop + * @enum ["desktop", "mobile"] + */ + device?: "desktop" | "mobile"; +} + +export interface SERPFeature { + type: + | "featured_snippet" + | "people_also_ask" + | "knowledge_panel" + | "local_pack" + | "video_carousel" + | "image_pack" + | "top_stories" + | "site_links" + | "faq" + | "how_to"; + owned_by_you: boolean; + owner_domain?: string; + content_preview?: string; +} + +export interface KeywordSERPAnalysis { + keyword: string; + search_volume_estimate: string; + features_present: SERPFeature[]; + your_organic_position: number | null; + opportunities: string[]; + difficulty_estimate: "easy" | "medium" | "hard"; +} + +export interface SERPFeaturesReport { + summary: { + total_keywords: number; + keywords_with_features: number; + features_owned: number; + features_available: number; + avg_features_per_serp: number; + }; + feature_distribution: Record; + keyword_analysis: KeywordSERPAnalysis[]; + opportunities: { + featured_snippets: Array<{ + keyword: string; + current_owner: string; + suggested_approach: string; + }>; + people_also_ask: Array<{ + keyword: string; + questions: string[]; + content_gap: boolean; + }>; + other_features: Array<{ + feature_type: string; + keywords: string[]; + implementation_guide: string; + }>; + }; + recommendations: { + content_optimization: string[]; + technical_implementation: string[]; + monitoring_alerts: string[]; + }; +} + +/** + * @title Track SERP Features + * @description Monitor and analyze SERP features for target keywords + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + keywords, + domain, + language_name = "English", + location_name = "United States", + device = "desktop", + } = props; + + const keywordAnalyses: KeywordSERPAnalysis[] = []; + const featureOccurrences = new Map< + string, + { total: number; owned: number } + >(); + let totalFeaturesFound = 0; + let featuresOwned = 0; + + // Analyze each keyword + for (const keyword of keywords) { + try { + // Post SERP task + const response = await ctx.client["POST /serp/google/organic/task_post"]( + {}, + { + body: [{ + keyword, + language_name, + location_name, + device, + depth: 100, + }], + }, + ); + + const data = await response.json(); + const taskId = data.tasks?.[0]?.id; + + if (!taskId) continue; + + // Wait for processing + await new Promise((resolve) => setTimeout(resolve, 3000)); + + // Get results + const resultResponse = await ctx.client + [`GET /serp/google/organic/task_get/:id`]({ + "id": taskId, + }); + + const resultData = await resultResponse.json(); + const result = resultData.tasks?.[0]?.result?.[0] as { + items?: SerpItem[]; + } | undefined; + const items = result?.items; + + if (!items) continue; + + // Extract SERP features + const features = extractSERPFeatures(items, domain); + let organicPosition: number | null = null; + + // Find organic position + items.forEach((item, index) => { + if (item.type === "organic" && item.domain.includes(domain)) { + organicPosition = index + 1; + } + }); + + // Count features + features.forEach((feature) => { + totalFeaturesFound++; + if (feature.owned_by_you) featuresOwned++; + + const current = featureOccurrences.get(feature.type) || + { total: 0, owned: 0 }; + current.total++; + if (feature.owned_by_you) current.owned++; + featureOccurrences.set(feature.type, current); + }); + + // Identify opportunities + const opportunities = identifyFeatureOpportunities( + features, + organicPosition, + ); + + keywordAnalyses.push({ + keyword, + search_volume_estimate: estimateSearchVolume(keyword), + features_present: features, + your_organic_position: organicPosition, + opportunities, + difficulty_estimate: estimateDifficulty(features, organicPosition), + }); + } catch (error) { + console.error(`Error analyzing keyword ${keyword}:`, error); + } + } + + // Calculate summary metrics + const keywordsWithFeatures = + keywordAnalyses.filter((k) => k.features_present.length > 0).length; + const avgFeaturesPerSerp = totalFeaturesFound / keywords.length; + + // Generate feature distribution + const featureDistribution: SERPFeaturesReport["feature_distribution"] = {}; + featureOccurrences.forEach((stats, featureType) => { + featureDistribution[featureType] = { + total_occurrences: stats.total, + owned_by_you: stats.owned, + ownership_rate: stats.total > 0 ? (stats.owned / stats.total) * 100 : 0, + }; + }); + + // Identify opportunities + const opportunities = identifyGlobalOpportunities(keywordAnalyses); + + // Generate recommendations + const recommendations = generateFeatureRecommendations( + featureDistribution, + keywordAnalyses, + opportunities, + ); + + return { + summary: { + total_keywords: keywords.length, + keywords_with_features: keywordsWithFeatures, + features_owned: featuresOwned, + features_available: totalFeaturesFound - featuresOwned, + avg_features_per_serp: Math.round(avgFeaturesPerSerp * 10) / 10, + }, + feature_distribution: featureDistribution, + keyword_analysis: keywordAnalyses, + opportunities, + recommendations, + }; +} + +function extractSERPFeatures(items: SerpItem[], domain: string): SERPFeature[] { + const features: SERPFeature[] = []; + + items.forEach((item) => { + let feature: SERPFeature | null = null; + + switch (item.type) { + case "featured_snippet": + feature = { + type: "featured_snippet", + owned_by_you: item.domain.includes(domain), + owner_domain: item.domain, + content_preview: item.description?.substring(0, 150), + }; + break; + + case "people_also_ask": + feature = { + type: "people_also_ask", + owned_by_you: false, // PAA doesn't have direct ownership + content_preview: item.title, + }; + break; + + case "knowledge_graph": + case "knowledge_panel": + feature = { + type: "knowledge_panel", + owned_by_you: item.domain?.includes(domain) || false, + owner_domain: item.domain, + }; + break; + + case "local_pack": + feature = { + type: "local_pack", + owned_by_you: item.title?.toLowerCase().includes(domain) || false, + }; + break; + + case "video": + case "video_carousel": + feature = { + type: "video_carousel", + owned_by_you: item.domain?.includes(domain) || false, + owner_domain: item.domain, + }; + break; + + case "images": + case "images_pack": + feature = { + type: "image_pack", + owned_by_you: false, // Hard to determine ownership + }; + break; + + case "news": + case "top_stories": + feature = { + type: "top_stories", + owned_by_you: item.domain?.includes(domain) || false, + owner_domain: item.domain, + }; + break; + + case "site_links": + if (item.domain?.includes(domain)) { + feature = { + type: "site_links", + owned_by_you: true, + owner_domain: domain, + }; + } + break; + + case "faq": + feature = { + type: "faq", + owned_by_you: item.domain?.includes(domain) || false, + owner_domain: item.domain, + }; + break; + + case "how_to": + feature = { + type: "how_to", + owned_by_you: item.domain?.includes(domain) || false, + owner_domain: item.domain, + }; + break; + } + + if (feature) { + features.push(feature); + } + }); + + return features; +} + +function identifyFeatureOpportunities( + features: SERPFeature[], + organicPosition: number | null, +): string[] { + const opportunities: string[] = []; + + // Featured snippet opportunity + const hasFeaturedSnippet = features.some((f) => + f.type === "featured_snippet" + ); + const ownsFeaturedSnippet = features.some((f) => + f.type === "featured_snippet" && f.owned_by_you + ); + + if ( + hasFeaturedSnippet && !ownsFeaturedSnippet && organicPosition && + organicPosition <= 10 + ) { + opportunities.push("Target featured snippet - you rank in top 10"); + } + + // PAA opportunity + const hasPAA = features.some((f) => f.type === "people_also_ask"); + if (hasPAA) { + opportunities.push( + "Create FAQ content targeting People Also Ask questions", + ); + } + + // Video opportunity + const hasVideo = features.some((f) => f.type === "video_carousel"); + const ownsVideo = features.some((f) => + f.type === "video_carousel" && f.owned_by_you + ); + if (hasVideo && !ownsVideo) { + opportunities.push("Create video content to capture video carousel"); + } + + // Site links opportunity + if (organicPosition === 1 && !features.some((f) => f.type === "site_links")) { + opportunities.push("Optimize for sitelinks with clear site structure"); + } + + return opportunities; +} + +function estimateSearchVolume(keyword: string): string { + // Simplified estimation based on keyword characteristics + const wordCount = keyword.split(" ").length; + + if (wordCount === 1) return "10K-50K"; + if (wordCount === 2) return "5K-20K"; + if (wordCount === 3) return "1K-10K"; + if (keyword.includes("how") || keyword.includes("what")) return "1K-5K"; + return "500-5K"; +} + +function estimateDifficulty( + features: SERPFeature[], + position: number | null, +): "easy" | "medium" | "hard" { + const featureCount = features.length; + + if (featureCount >= 5) return "hard"; + if (featureCount >= 3) return "medium"; + if (position && position <= 5) return "easy"; + if (position && position <= 20) return "medium"; + return "hard"; +} + +function identifyGlobalOpportunities( + analyses: KeywordSERPAnalysis[], +): SERPFeaturesReport["opportunities"] { + const featuredSnippets = analyses + .filter((a) => + a.features_present.some((f) => + f.type === "featured_snippet" && !f.owned_by_you + ) && + a.your_organic_position && a.your_organic_position <= 10 + ) + .map((a) => { + const snippet = a.features_present.find((f) => + f.type === "featured_snippet" + )!; + return { + keyword: a.keyword, + current_owner: snippet.owner_domain || "unknown", + suggested_approach: generateSnippetStrategy(a), + }; + }); + + const paaOpportunities = analyses + .filter((a) => a.features_present.some((f) => f.type === "people_also_ask")) + .map((a) => ({ + keyword: a.keyword, + questions: a.features_present + .filter((f) => f.type === "people_also_ask") + .map((f) => f.content_preview || "") + .filter((q) => q.length > 0), + content_gap: !a.your_organic_position || a.your_organic_position > 10, + })); + + // Group other features + const otherFeatures: Map = new Map(); + analyses.forEach((a) => { + a.features_present.forEach((f) => { + if ( + !["featured_snippet", "people_also_ask"].includes(f.type) && + !f.owned_by_you + ) { + const keywords = otherFeatures.get(f.type) || []; + keywords.push(a.keyword); + otherFeatures.set(f.type, keywords); + } + }); + }); + + const otherFeatureOpps = Array.from(otherFeatures.entries()).map(( + [type, keywords], + ) => ({ + feature_type: type, + keywords: [...new Set(keywords)].slice(0, 5), + implementation_guide: getImplementationGuide(type), + })); + + return { + featured_snippets: featuredSnippets.slice(0, 10), + people_also_ask: paaOpportunities.slice(0, 10), + other_features: otherFeatureOpps, + }; +} + +function generateSnippetStrategy(analysis: KeywordSERPAnalysis): string { + if (analysis.your_organic_position && analysis.your_organic_position <= 3) { + return "Optimize existing content with definition paragraph, bullet points, or table"; + } else if ( + analysis.your_organic_position && analysis.your_organic_position <= 10 + ) { + return "Improve content comprehensiveness and add structured snippet-friendly format"; + } + return "Create new comprehensive content targeting this keyword"; +} + +function getImplementationGuide(featureType: string): string { + const guides: Record = { + video_carousel: + "Create and optimize YouTube videos with target keywords in title and description", + image_pack: + "Add high-quality, optimized images with descriptive alt text and captions", + local_pack: "Optimize Google Business Profile and build local citations", + top_stories: + "Publish timely, newsworthy content with proper news schema markup", + faq: "Implement FAQ schema markup on relevant pages", + how_to: "Create step-by-step guides with HowTo schema markup", + site_links: "Improve site structure, internal linking, and page titles", + }; + + return guides[featureType] || "Optimize content for this SERP feature"; +} + +function generateFeatureRecommendations( + distribution: SERPFeaturesReport["feature_distribution"], + analyses: KeywordSERPAnalysis[], + opportunities: SERPFeaturesReport["opportunities"], +): SERPFeaturesReport["recommendations"] { + const contentOptimization = []; + const technicalImplementation = []; + const monitoringAlerts = []; + + // Content recommendations + if (opportunities.featured_snippets.length > 5) { + contentOptimization.push( + "Create snippet-optimized content blocks (40-60 words) for high-volume keywords", + ); + } + + if (opportunities.people_also_ask.length > 5) { + contentOptimization.push( + "Develop comprehensive FAQ sections addressing PAA questions", + ); + } + + const noRankingKeywords = + analyses.filter((a) => !a.your_organic_position).length; + if (noRankingKeywords > analyses.length * 0.3) { + contentOptimization.push( + "Create new content targeting keywords where you don't currently rank", + ); + } + + // Technical recommendations + if (distribution.faq && distribution.faq.ownership_rate < 50) { + technicalImplementation.push( + "Implement FAQ schema markup across relevant pages", + ); + } + + if (distribution.how_to && distribution.how_to.ownership_rate < 50) { + technicalImplementation.push("Add HowTo schema markup to tutorial content"); + } + + if (!distribution.site_links || distribution.site_links.owned_by_you === 0) { + technicalImplementation.push( + "Optimize site architecture and internal linking for sitelinks eligibility", + ); + } + + // Monitoring recommendations + monitoringAlerts.push( + "Set up weekly SERP feature tracking for top 20 keywords", + ); + monitoringAlerts.push("Monitor competitor featured snippet wins/losses"); + monitoringAlerts.push("Track new SERP features appearing for your keywords"); + + return { + content_optimization: contentOptimization, + technical_implementation: technicalImplementation, + monitoring_alerts: monitoringAlerts, + }; +} diff --git a/data-for-seo/client.ts b/data-for-seo/client.ts new file mode 100644 index 000000000..c713852fe --- /dev/null +++ b/data-for-seo/client.ts @@ -0,0 +1,665 @@ +// Keywords Data Types +export interface KeywordData { + keyword: string; + search_volume: number; + cpc: number; + competition: number; + competition_level: string; + monthly_searches: Array<{ + year: number; + month: number; + search_volume: number; + }>; +} + +export interface RelatedKeyword { + keyword: string; + search_volume: number; + cpc: number; + competition: number; + keyword_difficulty: number; + relevance: number; +} + +// SERP Types +export interface MapsResult { + type: string; + rank_group: number; + rank_absolute: number; + title: string; + rating?: { + value: number; + votes_count: number; + rating_max: number; + }; + price_level?: string; + category?: string; + phone?: string; + address?: string; + website?: string; + domain?: string; + place_id: string; + cid: string; + latitude: number; + longitude: number; + is_closed?: boolean; + is_temporarily_closed?: boolean; + is_claimed?: boolean; + work_hours?: { + monday?: { open: string; close: string }; + tuesday?: { open: string; close: string }; + wednesday?: { open: string; close: string }; + thursday?: { open: string; close: string }; + friday?: { open: string; close: string }; + saturday?: { open: string; close: string }; + sunday?: { open: string; close: string }; + }; +} + +export interface SerpItem { + type: string; + rank_group: number; + rank_absolute: number; + position: string; + url: string; + domain: string; + title: string; + description: string; + breadcrumb?: string; + is_paid?: boolean; + rating?: { + value: number; + votes_count: number; + }; +} + +export interface GoogleAd { + type: string; + rank_group: number; + rank_absolute: number; + advertiser_id: string; + creative_id: string; + title: string; + description: string; + url: string; + domain: string; + breadcrumb: string; + is_mobile: boolean; + phone?: string; +} + +export interface FeaturedSnippet { + type: string; + rank_group: number; + rank_absolute: number; + position: string; + url: string; + domain: string; + title: string; + description: string; + featured_snippet_type: string; +} + +// Backlinks Types +export interface BacklinksOverview { + target: string; + total_backlinks: number; + total_pages: number; + total_domains: number; + broken_backlinks: number; + broken_pages: number; + referring_domains: number; + referring_main_domains: number; + referring_ips: number; + referring_subnets: number; + referring_pages: number; + dofollow: number; + nofollow: number; + gov_domains: number; + edu_domains: number; + rank: number; + main_domain_rank: number; + last_updated_time: string; +} + +export interface Backlink { + type: string; + domain_from: string; + url_from: string; + url_from_https: boolean; + domain_to: string; + url_to: string; + url_to_https: boolean; + tld_from: string; + is_new: boolean; + is_lost: boolean; + backlink_spam_score: number; + rank: number; + page_from_rank: number; + domain_from_rank: number; + domain_from_external_links: number; + domain_from_internal_links: number; + page_from_external_links: number; + page_from_internal_links: number; + page_from_size: number; + page_from_encoding: string; + page_from_language: string; + page_from_title: string; + page_from_status_code: number; + first_seen: string; + prev_seen: string; + last_seen: string; + item_type: string; + dofollow: boolean; + anchor?: string; + text_from?: string; + alt?: string; + image_url?: string; +} + +export interface AnchorText { + anchor: string; + total: number; + dofollow: number; + referring_domains: number; + referring_domains_dofollow: number; + referring_main_domains: number; + referring_main_domains_dofollow: number; + referring_pages: number; + referring_pages_dofollow: number; + rank: number; +} + +export interface ReferringDomain { + type: string; + domain: string; + rank: number; + backlinks: number; + dofollow: number; + first_seen: string; + lost_date?: string; + backlinks_spam_score: number; + broken_backlinks: number; + broken_pages: number; + referring_domains: number; + referring_domains_dofollow: number; + referring_main_domains: number; + referring_main_domains_dofollow: number; + referring_pages: number; + referring_pages_dofollow: number; +} + +// Traffic Analytics Types +export interface TrafficOverview { + target: string; + date: string; + rank: number; + visits: number; + unique_visitors: number; + pages_per_visit: number; + avg_visit_duration: number; + bounce_rate: number; + users_expected_visits_rate: number; +} + +// Task Management Types +export interface TaskInfo { + id: string; + status_code: number; + status_message: string; + time: string; + cost: number; + result_count: number; + path: string[]; + data: unknown; + tag?: string; +} + +export interface TasksReadyResponse { + version: string; + status_code: number; + status_message: string; + time: string; + cost: number; + tasks_count: number; + tasks_error: number; + tasks: TaskInfo[]; +} + +// News Result Types +export interface NewsResult { + type: string; + rank_group: number; + rank_absolute: number; + position: string; + title: string; + url: string; + source: string; + domain: string; + snippet: string; + timestamp: string; + time_ago?: string; + amp_version?: boolean; + rating?: { + value: number; + votes_count: number; + }; + highlighted?: string[]; +} + +// Events Result Types +export interface EventResult { + type: string; + rank_group: number; + rank_absolute: number; + position: string; + title: string; + description: string; + url: string; + image_url?: string; + event_dates?: { + start_datetime?: string; + end_datetime?: string; + displayed_dates?: string; + }; + location_info?: { + name?: string; + address?: string; + url?: string; + cid?: string; + latitude?: number; + longitude?: number; + }; + ticket_info?: { + price?: string; + price_range?: string; + price_currency?: string; + source?: string; + url?: string; + }; +} + +// Dataset Search Result Types +export interface DatasetResult { + type: string; + rank_group: number; + rank_absolute: number; + position: string; + dataset_id: string; + title: string; + snippet: string; + provider_name: string; + formats?: string[]; + authors?: string[]; + licenses?: string[]; + updated_date?: string; + area_covered?: string[]; + dataset_description?: { + text?: string; + links?: Array<{ + text: string; + url: string; + }>; + }; + links?: Array<{ + text: string; + url: string; + }>; +} + +export interface TrafficBySource { + direct: number; + search_organic: number; + search_paid: number; + referral: number; + social: number; + mail: number; + display_ad: number; +} + +export interface TrafficByCountry { + country: string; + country_code: string; + visits: number; + visits_percentage: number; +} + +export interface TrafficByPage { + page: string; + visits: number; + visits_percentage: number; + unique_visitors: number; + page_views: number; + avg_time_on_page: number; + bounce_rate: number; + exit_rate: number; +} + +// API Request/Response Types +export interface DataForSeoTaskRequest { + id?: string; + data?: unknown; + postback_url?: string; + pingback_url?: string; + tag?: string; +} + +export interface DataForSeoTaskResponse { + version: string; + status_code: number; + status_message: string; + time: string; + cost: number; + tasks_count: number; + tasks_error: number; + tasks: Array<{ + id: string; + status_code: number; + status_message: string; + time: string; + cost: number; + result_count: number; + path: string[]; + data: unknown; + result?: unknown[]; + }>; +} + +// Client Interface +export interface DataForSeoClient { + // Keywords Data API + "POST /keywords_data/google/search_volume/task_post": { + body: Array<{ + keywords: string[]; + language_name?: string; + location_name?: string; + language_code?: string; + location_code?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /keywords_data/google/related_keywords/task_post": { + body: Array<{ + keywords: string[]; + language_name?: string; + location_name?: string; + language_code?: string; + location_code?: number; + depth?: number; + include_seed_keyword?: boolean; + include_serp_info?: boolean; + limit?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /keywords_data/google/ads_competition/task_post": { + body: Array<{ + keywords: string[]; + language_name?: string; + location_name?: string; + language_code?: string; + location_code?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + // SERP API + "POST /serp/google/organic/task_post": { + body: Array<{ + keyword: string; + language_name?: string; + location_name?: string; + language_code?: string; + location_code?: number; + device?: "desktop" | "mobile"; + os?: string; + depth?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /serp/google/organic/live/advanced": { + body: Array<{ + keyword: string; + language_code?: string; + location_code?: number; + device?: "desktop" | "mobile"; + os?: "windows" | "macos"; + depth?: number; + load_serp_features?: boolean; + calculate_rectangles?: boolean; + browser_screen_width?: number; + browser_screen_height?: number; + browser_screen_resolution_ratio?: number; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /serp/google/ads/task_post": { + body: Array<{ + keyword: string; + language_name?: string; + location_name?: string; + language_code?: string; + location_code?: number; + device?: "desktop" | "mobile"; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /serp/google/maps/task_post": { + body: Array<{ + keyword: string; + language_name?: string; + location_name?: string; + language_code?: string; + location_code?: number; + device?: "desktop" | "mobile"; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + // Backlinks API + "POST /backlinks/domain_info/live": { + body: Array<{ + target: string; + limit?: number; + offset?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /backlinks/backlinks/live": { + body: Array<{ + target: string; + limit?: number; + offset?: number; + filters?: string[]; + order_by?: string[]; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /backlinks/anchors/live": { + body: Array<{ + target: string; + limit?: number; + offset?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /backlinks/referring_domains/live": { + body: Array<{ + target: string; + limit?: number; + offset?: number; + filters?: string[]; + order_by?: string[]; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + // Traffic Analytics API + "POST /traffic_analytics/overview/live": { + body: Array<{ + target: string; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /traffic_analytics/by_source/live": { + body: Array<{ + target: string; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /traffic_analytics/by_country/live": { + body: Array<{ + target: string; + limit?: number; + offset?: number; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /traffic_analytics/by_pages/live": { + body: Array<{ + target: string; + limit?: number; + offset?: number; + filters?: string[]; + order_by?: string[]; + tag?: string; + }>; + response: DataForSeoTaskResponse; + }; + + // Task Result Endpoints + "GET /keywords_data/google/search_volume/task_get/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /keywords_data/google/related_keywords/task_get/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /keywords_data/google/ads_competition/task_get/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /serp/google/organic/task_get/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /serp/google/ads/task_get/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /serp/google/maps/task_get/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + // Task Management Endpoints + "GET /serp/google/organic/tasks_ready": { + response: TasksReadyResponse; + }; + + "GET /serp/google/organic/tasks_fixed": { + response: TasksReadyResponse; + }; + + "GET /serp/google/organic/task_get/regular/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /serp/google/organic/task_get/advanced/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + "GET /serp/google/organic/task_get/html/:id": { + response: DataForSeoTaskResponse; + "id": string; + }; + + // News, Events and Dataset Search Endpoints + "POST /serp/google/news/live/advanced": { + body: Array<{ + keyword: string; + language_code?: string; + location_code?: number; + device?: "desktop" | "mobile"; + os?: "windows" | "macos"; + depth?: number; + sort_by?: "relevance" | "date"; + time_range?: "all" | "1h" | "1d" | "1w" | "1m" | "1y"; + load_serp_features?: boolean; + calculate_rectangles?: boolean; + browser_screen_width?: number; + browser_screen_height?: number; + browser_screen_resolution_ratio?: number; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /serp/google/events/live/advanced": { + body: Array<{ + keyword: string; + location_name?: string; + location_coordinate?: string; + language_code?: string; + date_range?: string; + os?: "windows" | "macos"; + depth?: number; + load_serp_features?: boolean; + calculate_rectangles?: boolean; + browser_screen_width?: number; + browser_screen_height?: number; + browser_screen_resolution_ratio?: number; + }>; + response: DataForSeoTaskResponse; + }; + + "POST /serp/google/dataset_search/live/advanced": { + body: Array<{ + keyword: string; + last_updated?: string; + file_formats?: string[]; + usage_rights?: string; + is_free?: boolean; + topics?: string[]; + language_code?: string; + depth?: number; + load_serp_features?: boolean; + calculate_rectangles?: boolean; + browser_screen_width?: number; + browser_screen_height?: number; + browser_screen_resolution_ratio?: number; + }>; + response: DataForSeoTaskResponse; + }; +} diff --git a/data-for-seo/loaders/async/getAdsCompetitionResult.ts b/data-for-seo/loaders/async/getAdsCompetitionResult.ts new file mode 100644 index 000000000..29bc47c00 --- /dev/null +++ b/data-for-seo/loaders/async/getAdsCompetitionResult.ts @@ -0,0 +1,35 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Task ID + * @description The task ID returned from the ads competition post request + */ + task_id: string; +} + +/** + * @name KEYWORDS_ADS_COMPETITION_GET + * @title Get Ads Competition Result (Async - Step 2) + * @description Get the result of an ads competition task. ⚠️ REQUIRES: First create a task using 'Create Ads Competition Task' action to get a task_id + * @workflow 1) Create task with createAdsCompetitionTask → 2) Wait 3-5 seconds → 3) Use this loader with the task_id + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + try { + const response = await ctx.client + ["GET /keywords_data/google/ads_competition/task_get/:id"]({ + id: props.task_id, + }); + return await handleDataForSeoResponse(response, "Ads Competition Result"); + } catch (error) { + return { + status: "error", + message: error instanceof Error ? error.message : "Erro desconhecido", + }; + } +} diff --git a/data-for-seo/loaders/async/getMapsResultsResult.ts b/data-for-seo/loaders/async/getMapsResultsResult.ts new file mode 100644 index 000000000..bea3a26f5 --- /dev/null +++ b/data-for-seo/loaders/async/getMapsResultsResult.ts @@ -0,0 +1,34 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Task ID + * @description The task ID returned from the maps SERP post request + */ + task_id: string; +} + +/** + * @name SERP_GOOGLE_MAPS_GET + * @title Get Maps SERP Result (Async - Step 2) + * @description Get the result of a maps SERP task. ⚠️ REQUIRES: First create a task using 'Create Maps SERP Task' action to get a task_id + * @workflow 1) Create task with createMapsSerpTask → 2) Wait 3-5 seconds → 3) Use this loader with the task_id + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + try { + const response = await ctx.client["GET /serp/google/maps/task_get/:id"]({ + id: props.task_id, + }); + return await handleDataForSeoResponse(response, "Maps Results Result"); + } catch (error) { + return { + status: "error", + message: error instanceof Error ? error.message : "Erro desconhecido", + }; + } +} diff --git a/data-for-seo/loaders/async/getRelatedKeywordsResult.ts b/data-for-seo/loaders/async/getRelatedKeywordsResult.ts new file mode 100644 index 000000000..396c75b72 --- /dev/null +++ b/data-for-seo/loaders/async/getRelatedKeywordsResult.ts @@ -0,0 +1,36 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Task ID + * @description The task ID returned from the related keywords post request + */ + task_id: string; +} + +/** + * @name KEYWORDS_RELATED_KEYWORDS_GET + * @title Get Related Keywords Result (Async - Step 2) + * @description Get the result of a related keywords task. ⚠️ REQUIRES: First create a task using 'Create Related Keywords Task' action to get a task_id + * @workflow 1) Create task with createRelatedKeywordsTask → 2) Wait 3-5 seconds → 3) Use this loader with the task_id + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + try { + const response = await ctx.client + ["GET /keywords_data/google/related_keywords/task_get/:id"]({ + id: props.task_id, + }); + + return await handleDataForSeoResponse(response, "Related Keywords Result"); + } catch (error) { + return { + status: "error", + message: error instanceof Error ? error.message : "Erro desconhecido", + }; + } +} diff --git a/data-for-seo/loaders/async/getSearchVolumeResult.ts b/data-for-seo/loaders/async/getSearchVolumeResult.ts new file mode 100644 index 000000000..a6c14b560 --- /dev/null +++ b/data-for-seo/loaders/async/getSearchVolumeResult.ts @@ -0,0 +1,35 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Task ID + * @description The task ID returned from the search volume post request + */ + task_id: string; +} + +/** + * @name KEYWORDS_SEARCH_VOLUME_GET + * @title Get Search Volume Result (Async - Step 2) + * @description Get the result of a search volume task. ⚠️ REQUIRES: First create a task using 'Create Search Volume Task' action to get a task_id + * @workflow 1) Create task with createSearchVolumeTask → 2) Wait 3-5 seconds → 3) Use this loader with the task_id + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + try { + const response = await ctx.client + ["GET /keywords_data/google/search_volume/task_get/:id"]({ + id: props.task_id, + }); + return await handleDataForSeoResponse(response, "Search Volume Result"); + } catch (error) { + return { + status: "error", + message: error instanceof Error ? error.message : "Erro desconhecido", + }; + } +} diff --git a/data-for-seo/loaders/backlinks/getAnchors.ts b/data-for-seo/loaders/backlinks/getAnchors.ts new file mode 100644 index 000000000..5638acf54 --- /dev/null +++ b/data-for-seo/loaders/backlinks/getAnchors.ts @@ -0,0 +1,62 @@ +import { AppContext } from "../../mod.ts"; +import { AnchorText, DataForSeoTaskResponse } from "../../client.ts"; + +export interface Props { + /** + * @title Target + * @description Domain or URL to analyze anchor texts + */ + target: string; + + /** + * @title Limit + * @description Maximum number of anchors to return + * @default 100 + */ + limit?: number; + + /** + * @title Offset + * @description Offset for pagination + * @default 0 + */ + offset?: number; +} + +/** + * @title DataForSEO - Backlinks Anchors + * @description Get anchor text distribution for a domain's backlink profile + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { target, limit = 100, offset = 0 } = props; + + const response = await ctx.client["POST /backlinks/anchors/live"]( + {}, + { + body: [{ + target, + limit, + offset, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000) { + throw new Error(`DataForSEO API Error: ${data.status_message}`); + } + + if (data.tasks?.[0]?.result?.[0]) { + const result = data.tasks[0].result[0] as { items?: AnchorText[] }; + return result.items || []; + } + + return []; +}; + +export default loader; diff --git a/data-for-seo/loaders/backlinks/getBacklinks.ts b/data-for-seo/loaders/backlinks/getBacklinks.ts new file mode 100644 index 000000000..96abc40e0 --- /dev/null +++ b/data-for-seo/loaders/backlinks/getBacklinks.ts @@ -0,0 +1,146 @@ +import { AppContext } from "../../mod.ts"; +import type { Backlink, DataForSeoTaskResponse } from "../../client.ts"; + +interface Props { + /** + * @title Target + * @description Target domain or URL to retrieve backlinks for + */ + target: string; + + /** + * @title Limit + * @description Maximum number of backlinks to return + * @default 100 + */ + limit?: number; + + /** + * @title Offset + * @description Starting position for pagination + * @default 0 + */ + offset?: number; + + /** + * @title Order By + * @description Sort order (e.g., "rank desc", "backlinks desc") + * @default rank desc + */ + order_by?: string; +} + +/** + * @title Get Backlinks + * @description Get a detailed list of backlinks for a domain or URL + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + target, + limit = 100, + offset = 0, + order_by = "rank desc", + } = props; + + if (!target) { + throw new Error("Target domain or URL is required"); + } + + const response = await ctx.client["POST /backlinks/backlinks/live"]( + {}, + { + body: [{ + target, + limit, + offset, + order_by: [order_by], + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000 || !data.tasks?.[0]?.result?.[0]) { + throw new Error(data.status_message || "Failed to fetch backlinks"); + } + + const result = data.tasks[0].result[0] as { + items?: Array<{ + type: string; + domain_from: string; + url_from: string; + url_from_https?: boolean; + domain_to: string; + url_to: string; + url_to_https?: boolean; + tld_from: string; + is_new?: boolean; + is_lost?: boolean; + backlink_spam_score?: number; + rank?: number; + page_from_rank?: number; + domain_from_rank?: number; + domain_from_external_links?: number; + domain_from_internal_links?: number; + page_from_external_links?: number; + page_from_internal_links?: number; + page_from_size?: number; + page_from_encoding?: string; + page_from_language?: string; + page_from_title?: string; + page_from_status_code?: number; + first_seen?: string; + prev_seen?: string; + last_seen?: string; + item_type?: string; + dofollow?: boolean; + anchor?: string; + text_from?: string; + alt?: string; + image_url?: string; + }>; + }; + + if (!result.items || result.items.length === 0) { + return []; + } + + return result.items.map((item) => ({ + type: item.type, + domain_from: item.domain_from, + url_from: item.url_from, + url_from_https: item.url_from_https || false, + domain_to: item.domain_to, + url_to: item.url_to, + url_to_https: item.url_to_https || false, + tld_from: item.tld_from, + is_new: item.is_new || false, + is_lost: item.is_lost || false, + backlink_spam_score: item.backlink_spam_score || 0, + rank: item.rank || 0, + page_from_rank: item.page_from_rank || 0, + domain_from_rank: item.domain_from_rank || 0, + domain_from_external_links: item.domain_from_external_links || 0, + domain_from_internal_links: item.domain_from_internal_links || 0, + page_from_external_links: item.page_from_external_links || 0, + page_from_internal_links: item.page_from_internal_links || 0, + page_from_size: item.page_from_size || 0, + page_from_encoding: item.page_from_encoding || "", + page_from_language: item.page_from_language || "", + page_from_title: item.page_from_title || "", + page_from_status_code: item.page_from_status_code || 0, + first_seen: item.first_seen || "", + prev_seen: item.prev_seen || "", + last_seen: item.last_seen || "", + item_type: item.item_type || "", + dofollow: item.dofollow || false, + anchor: item.anchor, + text_from: item.text_from, + alt: item.alt, + image_url: item.image_url, + })); +} diff --git a/data-for-seo/loaders/backlinks/getBacklinksOverview.ts b/data-for-seo/loaders/backlinks/getBacklinksOverview.ts new file mode 100644 index 000000000..25512af80 --- /dev/null +++ b/data-for-seo/loaders/backlinks/getBacklinksOverview.ts @@ -0,0 +1,88 @@ +import { AppContext } from "../../mod.ts"; +import type { + BacklinksOverview, + DataForSeoTaskResponse, +} from "../../client.ts"; + +interface Props { + /** + * @title Target + * @description Target domain or URL to analyze + */ + target: string; +} + +/** + * @title Get Backlinks Overview + * @description Get an overview of backlinks data for a domain + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { target } = props; + + if (!target) { + throw new Error("Target domain or URL is required"); + } + + const response = await ctx.client["POST /backlinks/domain_info/live"]( + {}, + { + body: [{ + target, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000 || !data.tasks?.[0]?.result?.[0]) { + throw new Error( + data.status_message || "Failed to fetch backlinks overview", + ); + } + + const result = data.tasks[0].result[0] as { + target: string; + total_backlinks?: number; + total_pages?: number; + total_domains?: number; + broken_backlinks?: number; + broken_pages?: number; + referring_domains?: number; + referring_main_domains?: number; + referring_ips?: number; + referring_subnets?: number; + referring_pages?: number; + dofollow?: number; + nofollow?: number; + gov_domains?: number; + edu_domains?: number; + rank?: number; + main_domain_rank?: number; + last_updated_time?: string; + }; + + return { + target: result.target, + total_backlinks: result.total_backlinks || 0, + total_pages: result.total_pages || 0, + total_domains: result.total_domains || 0, + broken_backlinks: result.broken_backlinks || 0, + broken_pages: result.broken_pages || 0, + referring_domains: result.referring_domains || 0, + referring_main_domains: result.referring_main_domains || 0, + referring_ips: result.referring_ips || 0, + referring_subnets: result.referring_subnets || 0, + referring_pages: result.referring_pages || 0, + dofollow: result.dofollow || 0, + nofollow: result.nofollow || 0, + gov_domains: result.gov_domains || 0, + edu_domains: result.edu_domains || 0, + rank: result.rank || 0, + main_domain_rank: result.main_domain_rank || 0, + last_updated_time: result.last_updated_time || new Date().toISOString(), + }; +} diff --git a/data-for-seo/loaders/backlinks/getReferringDomains.ts b/data-for-seo/loaders/backlinks/getReferringDomains.ts new file mode 100644 index 000000000..1949ba6fa --- /dev/null +++ b/data-for-seo/loaders/backlinks/getReferringDomains.ts @@ -0,0 +1,81 @@ +import { AppContext } from "../../mod.ts"; +import { DataForSeoTaskResponse, ReferringDomain } from "../../client.ts"; + +export interface Props { + /** + * @title Target + * @description Domain or URL to analyze referring domains + */ + target: string; + + /** + * @title Limit + * @description Maximum number of domains to return + * @default 100 + */ + limit?: number; + + /** + * @title Offset + * @description Offset for pagination + * @default 0 + */ + offset?: number; + + /** + * @title Order By + * @description Sort results by specific metric + * @enum ["rank desc", "rank asc", "backlinks desc", "backlinks asc", "first_seen desc", "first_seen asc"] + */ + orderBy?: string; + + /** + * @title Filter by Quality + * @description Filter by minimum domain rank (0-1000) + * @default 0 + */ + minRank?: number; +} + +/** + * @title DataForSEO - Referring Domains + * @description Get list of domains linking to the target with detailed metrics + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { target, limit = 100, offset = 0, orderBy, minRank = 0 } = props; + + const filters = minRank > 0 ? [`rank,>,${minRank}`] : undefined; + const order_by = orderBy ? [orderBy] : undefined; + + const response = await ctx.client["POST /backlinks/referring_domains/live"]( + {}, + { + body: [{ + target, + limit, + offset, + filters, + order_by, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000) { + throw new Error(`DataForSEO API Error: ${data.status_message}`); + } + + if (data.tasks?.[0]?.result?.[0]) { + const result = data.tasks[0].result[0] as { items?: ReferringDomain[] }; + return result.items || []; + } + + return []; +}; + +export default loader; diff --git a/data-for-seo/loaders/keywords/getAdsCompetition.ts b/data-for-seo/loaders/keywords/getAdsCompetition.ts new file mode 100644 index 000000000..c2f63ee25 --- /dev/null +++ b/data-for-seo/loaders/keywords/getAdsCompetition.ts @@ -0,0 +1,114 @@ +import { AppContext } from "../../mod.ts"; +import { DataForSeoTaskResponse } from "../../client.ts"; + +export interface Props { + /** + * @title Keywords + * @description List of keywords to analyze Google Ads competition + */ + keywords: string[]; + + /** + * @title Language Name + * @description Language of the keywords (e.g., 'English', 'Portuguese') + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location (e.g., 'United States', 'Brazil') + */ + location_name?: string; +} + +export interface AdsCompetitionData { + keyword: string; + competition: number; + competition_level: "low" | "medium" | "high"; + cpc: number; + search_volume: number; + advertisers_count: number; + bid_high: number; + bid_low: number; + top_of_page_bid_high: number; + top_of_page_bid_low: number; +} + +/** + * @title DataForSEO - Google Ads Competition + * @description Get Google Ads competition data for keywords including CPC, competition level, and bid estimates + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { keywords, language_name, location_name } = props; + + // Post the task + const taskResponse = await ctx.client + ["POST /keywords_data/google/ads_competition/task_post"]( + {}, + { + body: [{ + keywords, + language_name, + location_name, + }], + }, + ); + + const taskData = await taskResponse.json() as DataForSeoTaskResponse; + + if (taskData.status_code !== 20000 || !taskData.tasks?.[0]?.id) { + throw new Error(`DataForSEO API Error: ${taskData.status_message}`); + } + + const taskId = taskData.tasks[0].id; + + // Wait a bit for processing + await new Promise((resolve) => setTimeout(resolve, 2000)); + + // Get results (simplified polling) + const resultResponse = await ctx.client + [`GET /keywords_data/google/search_volume/task_get/:id`]({ + "id": taskId, + }); + + const resultData = await resultResponse.json() as DataForSeoTaskResponse; + + if (resultData.status_code === 20000 && resultData.tasks?.[0]?.result) { + const results = resultData.tasks[0].result as Array<{ + keyword: string; + competition?: number; + competition_level?: string; + cpc?: number; + search_volume?: number; + advertisers_count?: number; + bid_high?: number; + bid_low?: number; + top_of_page_bid_high?: number; + top_of_page_bid_low?: number; + }>; + + return results.map((item) => ({ + keyword: item.keyword, + competition: item.competition || 0, + competition_level: (item.competition_level || "low") as + | "low" + | "medium" + | "high", + cpc: item.cpc || 0, + search_volume: item.search_volume || 0, + advertisers_count: item.advertisers_count || 0, + bid_high: item.bid_high || 0, + bid_low: item.bid_low || 0, + top_of_page_bid_high: item.top_of_page_bid_high || 0, + top_of_page_bid_low: item.top_of_page_bid_low || 0, + })); + } else { + throw new Error(`DataForSEO API Error: ${resultData.status_message}`); + } +}; + +export default loader; diff --git a/data-for-seo/loaders/keywords/getRelatedKeywords.ts b/data-for-seo/loaders/keywords/getRelatedKeywords.ts new file mode 100644 index 000000000..2deea8c6d --- /dev/null +++ b/data-for-seo/loaders/keywords/getRelatedKeywords.ts @@ -0,0 +1,137 @@ +import { AppContext } from "../../mod.ts"; +import type { DataForSeoTaskResponse, RelatedKeyword } from "../../client.ts"; + +interface Props { + /** + * @title Keywords + * @description Seed keywords to get related suggestions + */ + keywords: string[]; + + /** + * @title Language + * @description Language name (e.g., "English", "Portuguese") + * @default English + */ + language_name?: string; + + /** + * @title Location + * @description Location name (e.g., "United States", "Brazil") + * @default United States + */ + location_name?: string; + + /** + * @title Limit + * @description Maximum number of related keywords to return + * @default 100 + */ + limit?: number; + + /** + * @title Include Seed + * @description Include seed keywords in results + * @default false + */ + include_seed_keyword?: boolean; +} + +/** + * @title Get Related Keywords + * @description Get keyword suggestions related to seed keywords + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + keywords, + language_name = "English", + location_name = "United States", + limit = 100, + include_seed_keyword = false, + } = props; + + if (!keywords || keywords.length === 0) { + throw new Error("Please provide at least one seed keyword"); + } + + // Post the task + const taskResponse = await ctx.client + ["POST /keywords_data/google/related_keywords/task_post"]( + {}, + { + body: [{ + keywords, + language_name, + location_name, + limit, + include_seed_keyword, + depth: 1, + }], + }, + ); + + const taskData = await taskResponse.json() as DataForSeoTaskResponse; + + if (taskData.status_code !== 20000 || !taskData.tasks?.[0]) { + throw new Error(taskData.status_message || "Failed to create task"); + } + + const taskId = taskData.tasks[0].id; + + // Wait for task completion + let attempts = 0; + const maxAttempts = 30; + const delay = 2000; + + while (attempts < maxAttempts) { + await new Promise((resolve) => setTimeout(resolve, delay)); + + const resultResponse = await ctx.client + [`GET /keywords_data/google/related_keywords/task_get/:id`]({ + id: taskId, + }); + + const resultData = await resultResponse.json() as DataForSeoTaskResponse; + + if (resultData.status_code === 20000 && resultData.tasks?.[0]?.result) { + const results = resultData.tasks[0].result as Array<{ + items?: Array<{ + keyword?: string; + search_volume?: number; + cpc?: number; + competition?: number; + keyword_difficulty?: number; + relevance?: number; + }>; + }>; + + // Flatten and transform results + const relatedKeywords: RelatedKeyword[] = []; + + for (const item of results) { + if (item.items) { + for (const keyword of item.items) { + relatedKeywords.push({ + keyword: keyword.keyword || "", + search_volume: keyword.search_volume || 0, + cpc: keyword.cpc || 0, + competition: keyword.competition || 0, + keyword_difficulty: keyword.keyword_difficulty || 0, + relevance: keyword.relevance || 0, + }); + } + } + } + + return relatedKeywords; + } + + attempts++; + } + + throw new Error("Task timeout - please try again later"); +} diff --git a/data-for-seo/loaders/keywords/getSearchVolume.ts b/data-for-seo/loaders/keywords/getSearchVolume.ts new file mode 100644 index 000000000..af7e3f3a6 --- /dev/null +++ b/data-for-seo/loaders/keywords/getSearchVolume.ts @@ -0,0 +1,112 @@ +import { AppContext } from "../../mod.ts"; +import type { DataForSeoTaskResponse, KeywordData } from "../../client.ts"; + +interface Props { + /** + * @title Keywords + * @description List of keywords to analyze (max 1000) + */ + keywords: string[]; + + /** + * @title Language + * @description Language name (e.g., "English", "Portuguese") + * @default English + */ + language_name?: string; + + /** + * @title Location + * @description Location name (e.g., "United States", "Brazil") + * @default United States + */ + location_name?: string; +} + +/** + * @title Get Search Volume + * @description Get search volume, CPC, and competition data for keywords + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + keywords, + language_name = "English", + location_name = "United States", + } = props; + + if (!keywords || keywords.length === 0) { + throw new Error("Please provide at least one keyword"); + } + + if (keywords.length > 1000) { + throw new Error("Maximum 1000 keywords allowed per request"); + } + + // Post the task + const taskResponse = await ctx.client + ["POST /keywords_data/google/search_volume/task_post"]( + {}, + { + body: [{ + keywords, + language_name, + location_name, + }], + }, + ); + + const taskData = await taskResponse.json() as DataForSeoTaskResponse; + + if (taskData.status_code !== 20000 || !taskData.tasks?.[0]) { + throw new Error(taskData.status_message || "Failed to create task"); + } + + const taskId = taskData.tasks[0].id; + + // Wait for task completion (polling) + let attempts = 0; + const maxAttempts = 30; + const delay = 2000; // 2 seconds + + while (attempts < maxAttempts) { + await new Promise((resolve) => setTimeout(resolve, delay)); + + const resultResponse = await ctx.client + [`GET /keywords_data/google/search_volume/task_get/:id`]({ + id: taskId, + }); + + const resultData = await resultResponse.json() as DataForSeoTaskResponse; + + if (resultData.status_code === 20000 && resultData.tasks?.[0]?.result) { + const results = resultData.tasks[0].result as Array<{ + keyword: string; + search_volume?: number; + cpc?: number; + competition?: number; + competition_level?: string; + monthly_searches?: Array< + { year: number; month: number; search_volume: number } + >; + }>; + + // Transform the results to match our KeywordData interface + return results.map((item) => ({ + keyword: item.keyword, + search_volume: item.search_volume || 0, + cpc: item.cpc || 0, + competition: item.competition || 0, + competition_level: item.competition_level || "low", + monthly_searches: item.monthly_searches || [], + })); + } + + attempts++; + } + + throw new Error("Task timeout - please try again later"); +} diff --git a/data-for-seo/loaders/live/getBacklinks.ts b/data-for-seo/loaders/live/getBacklinks.ts new file mode 100644 index 000000000..4c4cb48aa --- /dev/null +++ b/data-for-seo/loaders/live/getBacklinks.ts @@ -0,0 +1,52 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Target domain or URL to retrieve backlinks for + */ + target: string; + + /** + * @title Limit + * @description Maximum number of backlinks to return + */ + limit?: number; + + /** + * @title Offset + * @description Starting position for pagination + */ + offset?: number; + + /** + * @title Order By + * @description Sort order (e.g., "rank desc", "backlinks desc") + */ + order_by?: string; +} + +/** + * @name BACKLINKS_BACKLINKS_LIVE + * @title Get Backlinks List + * @description Get a detailed list of backlinks for a domain or URL + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /backlinks/backlinks/live"]( + {}, + { + body: [{ + target: props.target, + limit: props.limit, + offset: props.offset, + order_by: props.order_by ? [props.order_by] : undefined, + }], + }, + ); + return await handleDataForSeoResponse(response, "Backlinks List"); +} diff --git a/data-for-seo/loaders/live/getBacklinksOverview.ts b/data-for-seo/loaders/live/getBacklinksOverview.ts new file mode 100644 index 000000000..59061c674 --- /dev/null +++ b/data-for-seo/loaders/live/getBacklinksOverview.ts @@ -0,0 +1,31 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Target domain or URL to analyze backlinks + */ + target: string; +} + +/** + * @name BACKLINKS_DOMAIN_INFO + * @title Get Backlinks Domain Info + * @description Get backlinks overview data for a domain + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /backlinks/domain_info/live"]( + {}, + { + body: [{ + target: props.target, + }], + }, + ); + return await handleDataForSeoResponse(response, "Backlinks Overview"); +} diff --git a/data-for-seo/loaders/live/getGoogleDatasetSearchLiveAdvanced.ts b/data-for-seo/loaders/live/getGoogleDatasetSearchLiveAdvanced.ts new file mode 100644 index 000000000..cdead2dd6 --- /dev/null +++ b/data-for-seo/loaders/live/getGoogleDatasetSearchLiveAdvanced.ts @@ -0,0 +1,159 @@ +import type { AppContext } from "../../mod.ts"; +import type { DatasetResult } from "../../client.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @title Search Keyword + * @description The keyword to search for datasets (e.g., "water quality", "climate data") + */ + keyword: string; + + /** + * @title Last Updated + * @description Filter by when dataset was last updated (e.g., "1m", "3m", "6m", "1y", "2y", "3y") + */ + lastUpdated?: string; + + /** + * @title File Formats + * @description Filter by file formats (e.g., ["csv", "json", "xml", "archive", "image"]) + */ + fileFormats?: string[]; + + /** + * @title Usage Rights + * @description Filter by usage rights (e.g., "commercial", "noncommercial") + */ + usageRights?: string; + + /** + * @title Is Free + * @description Filter for free datasets only + * @default true + */ + isFree?: boolean; + + /** + * @title Topics + * @description Filter by dataset topics (e.g., ["natural_sciences", "geo", "social_sciences"]) + */ + topics?: string[]; + + /** + * @title Language Code + * @description Two-letter language code (e.g., "en", "pt") + * @default "en" + */ + languageCode?: string; + + /** + * @title Results Depth + * @description Number of results to return (max 700) + * @default 10 + */ + depth?: number; + + /** + * @title Load SERP Features + * @description Include additional SERP features in results + * @default false + */ + loadSerpFeatures?: boolean; +} + +export interface GoogleDatasetSearchResult { + keyword: string; + type: string; + se_domain: string; + language_code: string; + check_url: string; + datetime: string; + spell?: { + query: string; + type: string; + }; + item_types: string[]; + se_results_count: number; + items_count: number; + items: DatasetResult[]; +} + +/** + * @title Get Google Dataset Search - Live Advanced + * @description Search Google Dataset Search in real-time with advanced filters + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { + keyword, + lastUpdated, + fileFormats, + usageRights, + isFree = true, + topics, + languageCode = "en", + depth = 10, + loadSerpFeatures = false, + } = props; + + if (!keyword) { + throw new Error("Keyword is required"); + } + + try { + const requestBody: Parameters< + typeof ctx.client["POST /serp/google/dataset_search/live/advanced"] + >[1]["body"][0] = { + keyword, + language_code: languageCode, + depth, + load_serp_features: loadSerpFeatures, + ...(lastUpdated && { last_updated: lastUpdated }), + ...(fileFormats && fileFormats.length > 0 && + { file_formats: fileFormats }), + ...(usageRights && { usage_rights: usageRights }), + ...(typeof isFree === "boolean" && { is_free: isFree }), + ...(topics && topics.length > 0 && { topics }), + }; + + const body = [requestBody]; + + const response = await ctx.client + ["POST /serp/google/dataset_search/live/advanced"]({}, { body }); + + const result = await handleDataForSeoResponse( + response, + "Google Dataset Search Live", + ); + + // Validação robusta da estrutura de resposta + if ( + !result.tasks || !Array.isArray(result.tasks) || result.tasks.length === 0 + ) { + throw new Error("Invalid response structure: no tasks found"); + } + + const task = result.tasks[0]; + + if ( + !task.result || !Array.isArray(task.result) || task.result.length === 0 + ) { + throw new Error( + "Google Dataset Search completed but returned no results", + ); + } + + // Live endpoints sempre retornam apenas um resultado + return task.result[0] as GoogleDatasetSearchResult; + } catch (error) { + throw new Error( + `Failed to get Google Dataset Search results: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/live/getGoogleEventsLiveAdvanced.ts b/data-for-seo/loaders/live/getGoogleEventsLiveAdvanced.ts new file mode 100644 index 000000000..303b56a8c --- /dev/null +++ b/data-for-seo/loaders/live/getGoogleEventsLiveAdvanced.ts @@ -0,0 +1,153 @@ +import type { AppContext } from "../../mod.ts"; +import type { EventResult } from "../../client.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @title Search Keyword + * @description The keyword to search for events (e.g., "concerts", "conferences") + */ + keyword: string; + + /** + * @title Location Name + * @description Location for event search (e.g., "Los Angeles,California,United States") + */ + locationName?: string; + + /** + * @title Location Coordinate + * @description GPS coordinates for location-based search (e.g., "34.0522,-118.2437") + */ + locationCoordinate?: string; + + /** + * @title Language Code + * @description Two-letter language code (e.g., "en", "pt") + * @default "en" + */ + languageCode?: string; + + /** + * @title Date Range + * @description Filter events by date (e.g., "today", "tomorrow", "this_week", "next_week", "this_month", "next_month") + * @default "today" + */ + dateRange?: string; + + /** + * @title Operating System + * @description Operating system for search results + * @default "windows" + */ + os?: "windows" | "macos"; + + /** + * @title Results Depth + * @description Number of results to return (max 700) + * @default 10 + */ + depth?: number; + + /** + * @title Load SERP Features + * @description Include additional SERP features in results + * @default false + */ + loadSerpFeatures?: boolean; +} + +export interface GoogleEventsResult { + keyword: string; + type: string; + se_domain: string; + location_code?: number; + language_code: string; + check_url: string; + datetime: string; + spell?: { + query: string; + type: string; + }; + item_types: string[]; + se_results_count: number; + items_count: number; + items: EventResult[]; +} + +/** + * @title Get Google Events - Live Advanced + * @description Search Google Events in real-time with advanced parameters + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { + keyword, + locationName, + locationCoordinate, + languageCode = "en", + dateRange = "today", + os = "windows", + depth = 10, + loadSerpFeatures = false, + } = props; + + if (!keyword) { + throw new Error("Keyword is required"); + } + + try { + const requestBody: Parameters< + typeof ctx.client["POST /serp/google/events/live/advanced"] + >[1]["body"][0] = { + keyword, + language_code: languageCode, + date_range: dateRange, + os, + depth, + load_serp_features: loadSerpFeatures, + ...(locationName && { location_name: locationName }), + ...(locationCoordinate && !locationName && + { location_coordinate: locationCoordinate }), + }; + + const body = [requestBody]; + + const response = await ctx.client["POST /serp/google/events/live/advanced"]( + {}, + { body }, + ); + + const result = await handleDataForSeoResponse( + response, + "Google Events Live", + ); + + // Validação robusta da estrutura de resposta + if ( + !result.tasks || !Array.isArray(result.tasks) || result.tasks.length === 0 + ) { + throw new Error("Invalid response structure: no tasks found"); + } + + const task = result.tasks[0]; + + if ( + !task.result || !Array.isArray(task.result) || task.result.length === 0 + ) { + throw new Error("Google Events search completed but returned no results"); + } + + // Live endpoints sempre retornam apenas um resultado + return task.result[0] as GoogleEventsResult; + } catch (error) { + throw new Error( + `Failed to get Google Events results: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/live/getGoogleNewsLiveAdvanced.ts b/data-for-seo/loaders/live/getGoogleNewsLiveAdvanced.ts new file mode 100644 index 000000000..7cd2690ab --- /dev/null +++ b/data-for-seo/loaders/live/getGoogleNewsLiveAdvanced.ts @@ -0,0 +1,156 @@ +import type { AppContext } from "../../mod.ts"; +import type { NewsResult } from "../../client.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @title Search Keyword + * @description The keyword to search for in Google News + */ + keyword: string; + + /** + * @title Language Code + * @description Two-letter language code (e.g., "en", "pt") + * @default "en" + */ + languageCode?: string; + + /** + * @title Location Code + * @description Location code from DataForSEO locations list + * @default 2840 + */ + locationCode?: number; + + /** + * @title Device Type + * @description Device type for search results + * @default "desktop" + */ + device?: "desktop" | "mobile"; + + /** + * @title Operating System + * @description Operating system for search results + * @default "windows" + */ + os?: "windows" | "macos"; + + /** + * @title Results Depth + * @description Number of results to return (max 700) + * @default 10 + */ + depth?: number; + + /** + * @title Sort By + * @description Sort results by relevance or date + * @default "relevance" + */ + sortBy?: "relevance" | "date"; + + /** + * @title Time Range + * @description Filter results by time range + * @default "all" + */ + timeRange?: "all" | "1h" | "1d" | "1w" | "1m" | "1y"; + + /** + * @title Load SERP Features + * @description Include additional SERP features in results + * @default false + */ + loadSerpFeatures?: boolean; +} + +export interface GoogleNewsResult { + keyword: string; + type: string; + se_domain: string; + location_code: number; + language_code: string; + check_url: string; + datetime: string; + spell?: { + query: string; + type: string; + }; + item_types: string[]; + se_results_count: number; + items_count: number; + items: NewsResult[]; +} + +/** + * @title Get Google News - Live Advanced + * @description Search Google News in real-time with advanced parameters + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { + keyword, + languageCode = "en", + locationCode = 2840, + device = "desktop", + os = "windows", + depth = 10, + sortBy = "relevance", + timeRange = "all", + loadSerpFeatures = false, + } = props; + + if (!keyword) { + throw new Error("Keyword is required"); + } + + try { + const body = [{ + keyword, + language_code: languageCode, + location_code: locationCode, + device, + os, + depth, + sort_by: sortBy, + time_range: timeRange, + load_serp_features: loadSerpFeatures, + }]; + + const response = await ctx.client["POST /serp/google/news/live/advanced"]( + {}, + { body }, + ); + + const result = await handleDataForSeoResponse(response, "Google News Live"); + + // Validação robusta da estrutura de resposta + if ( + !result.tasks || !Array.isArray(result.tasks) || result.tasks.length === 0 + ) { + throw new Error("Invalid response structure: no tasks found"); + } + + const task = result.tasks[0]; + + if ( + !task.result || !Array.isArray(task.result) || task.result.length === 0 + ) { + throw new Error("Google News search completed but returned no results"); + } + + // Live endpoints sempre retornam apenas um resultado + return task.result[0] as GoogleNewsResult; + } catch (error) { + throw new Error( + `Failed to get Google News results: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/live/getOrganicSerpLiveAdvanced.ts b/data-for-seo/loaders/live/getOrganicSerpLiveAdvanced.ts new file mode 100644 index 000000000..b0b2c74be --- /dev/null +++ b/data-for-seo/loaders/live/getOrganicSerpLiveAdvanced.ts @@ -0,0 +1,74 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Keyword + * @description The keyword to search + */ + keyword: string; + + /** + * @title Location Code + * @description Location code (e.g., 2076 for Brazil, 2840 for United States) + */ + location_code?: number; + + /** + * @title Language Code + * @description Language code (e.g., "pt" for Portuguese, "en" for English) + */ + language_code?: string; + + /** + * @title Device + * @description Device type for search results + */ + device?: "desktop" | "mobile"; + + /** + * @title OS + * @description Operating system + */ + os?: "windows" | "macos"; + + /** + * @title Depth + * @description Number of results to return (max 700) + */ + depth?: number; + + /** + * @title Load Serp Features + * @description Include SERP features in response + */ + load_serp_features?: boolean; +} + +/** + * @name SERP_GOOGLE_ORGANIC_LIVE_ADVANCED + * @title Get Organic SERP Live Advanced (Instant) + * @description Get real-time organic search results from Google. ⚡ INSTANT RESPONSE - No task creation needed! + * @workflow Direct call - returns data immediately without creating tasks + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /serp/google/organic/live/advanced"]( + {}, + { + body: [{ + keyword: props.keyword, + location_code: props.location_code || 2076, // Default Brazil + language_code: props.language_code || "pt", + device: props.device || "desktop", + os: props.os || "windows", + depth: props.depth || 100, + load_serp_features: props.load_serp_features !== false, + }], + }, + ); + return await handleDataForSeoResponse(response, "Organic SERP Live Advanced"); +} diff --git a/data-for-seo/loaders/live/getReferringDomains.ts b/data-for-seo/loaders/live/getReferringDomains.ts new file mode 100644 index 000000000..40dd3bde5 --- /dev/null +++ b/data-for-seo/loaders/live/getReferringDomains.ts @@ -0,0 +1,52 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Domain or URL to analyze referring domains + */ + target: string; + + /** + * @title Limit + * @description Maximum number of domains to return + */ + limit?: number; + + /** + * @title Offset + * @description Offset for pagination + */ + offset?: number; + + /** + * @title Order By + * @description Sort results by specific metric + */ + order_by?: string; +} + +/** + * @name BACKLINKS_REFERRING_DOMAINS_LIVE + * @title Get Referring Domains + * @description Get list of domains linking to the target + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /backlinks/referring_domains/live"]( + {}, + { + body: [{ + target: props.target, + limit: props.limit, + offset: props.offset, + order_by: props.order_by ? [props.order_by] : undefined, + }], + }, + ); + return await handleDataForSeoResponse(response, "Referring Domains"); +} diff --git a/data-for-seo/loaders/live/getTrafficByCountry.ts b/data-for-seo/loaders/live/getTrafficByCountry.ts new file mode 100644 index 000000000..5690aaf3c --- /dev/null +++ b/data-for-seo/loaders/live/getTrafficByCountry.ts @@ -0,0 +1,31 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Domain to analyze traffic by country + */ + target: string; +} + +/** + * @name TRAFFIC_ANALYTICS_BY_COUNTRY_LIVE + * @title Get Traffic By Country + * @description Get website traffic data broken down by countries + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /traffic_analytics/by_country/live"]( + {}, + { + body: [{ + target: props.target, + }], + }, + ); + return await handleDataForSeoResponse(response, "Traffic By Country"); +} diff --git a/data-for-seo/loaders/live/getTrafficByPages.ts b/data-for-seo/loaders/live/getTrafficByPages.ts new file mode 100644 index 000000000..10d973c7e --- /dev/null +++ b/data-for-seo/loaders/live/getTrafficByPages.ts @@ -0,0 +1,45 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Domain to analyze traffic by pages + */ + target: string; + + /** + * @title Limit + * @description Maximum number of pages to return + */ + limit?: number; + + /** + * @title Offset + * @description Offset for pagination + */ + offset?: number; +} + +/** + * @name TRAFFIC_ANALYTICS_BY_PAGES_LIVE + * @title Get Traffic By Pages + * @description Get website traffic data broken down by pages + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /traffic_analytics/by_pages/live"]( + {}, + { + body: [{ + target: props.target, + limit: props.limit, + offset: props.offset, + }], + }, + ); + return await handleDataForSeoResponse(response, "Traffic By Pages"); +} diff --git a/data-for-seo/loaders/live/getTrafficBySources.ts b/data-for-seo/loaders/live/getTrafficBySources.ts new file mode 100644 index 000000000..7ecd179a9 --- /dev/null +++ b/data-for-seo/loaders/live/getTrafficBySources.ts @@ -0,0 +1,31 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Domain to analyze traffic sources + */ + target: string; +} + +/** + * @name TRAFFIC_ANALYTICS_BY_SOURCE_LIVE + * @title Get Traffic By Sources + * @description Get website traffic data broken down by traffic sources + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /traffic_analytics/by_source/live"]( + {}, + { + body: [{ + target: props.target, + }], + }, + ); + return await handleDataForSeoResponse(response, "Traffic By Sources"); +} diff --git a/data-for-seo/loaders/live/getTrafficOverview.ts b/data-for-seo/loaders/live/getTrafficOverview.ts new file mode 100644 index 000000000..3f88110d4 --- /dev/null +++ b/data-for-seo/loaders/live/getTrafficOverview.ts @@ -0,0 +1,31 @@ +import { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +interface Props { + /** + * @title Target + * @description Domain to analyze traffic + */ + target: string; +} + +/** + * @name TRAFFIC_ANALYTICS_OVERVIEW + * @title Get Traffic Analytics Overview + * @description Get website traffic overview metrics + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const response = await ctx.client["POST /traffic_analytics/overview/live"]( + {}, + { + body: [{ + target: props.target, + }], + }, + ); + return await handleDataForSeoResponse(response, "Traffic Analytics Overview"); +} diff --git a/data-for-seo/loaders/serp/getAdResults.ts b/data-for-seo/loaders/serp/getAdResults.ts new file mode 100644 index 000000000..e69ff7001 --- /dev/null +++ b/data-for-seo/loaders/serp/getAdResults.ts @@ -0,0 +1,148 @@ +import { AppContext } from "../../mod.ts"; +import type { DataForSeoTaskResponse, GoogleAd } from "../../client.ts"; + +interface Props { + /** + * @title Keyword + * @description The keyword to retrieve ads for + */ + keyword: string; + + /** + * @title Language + * @description Search language (e.g., "English", "Portuguese") + * @default English + */ + language_name?: string; + + /** + * @title Location + * @description Location for the SERP ads + * @default United States + */ + location_name?: string; + + /** + * @title Device + * @description Device type for search results + * @default desktop + * @enum ["desktop", "mobile"] + */ + device?: "desktop" | "mobile"; +} + +/** + * @title Get Ad Results + * @description Get paid ads results from Google SERP + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + keyword, + language_name = "English", + location_name = "United States", + device = "desktop", + } = props; + + if (!keyword) { + throw new Error("Keyword is required"); + } + + // Post the task + const taskResponse = await ctx.client["POST /serp/google/ads/task_post"]( + {}, + { + body: [{ + keyword, + language_name, + location_name, + device, + }], + }, + ); + + const taskData = await taskResponse.json() as DataForSeoTaskResponse; + + if (taskData.status_code !== 20000 || !taskData.tasks?.[0]) { + throw new Error(taskData.status_message || "Failed to create task"); + } + + const taskId = taskData.tasks[0].id; + + // Wait for task completion + let attempts = 0; + const maxAttempts = 30; + const delay = 2000; + + while (attempts < maxAttempts) { + await new Promise((resolve) => setTimeout(resolve, delay)); + + const resultResponse = await ctx.client + [`GET /serp/google/ads/task_get/:id`]({ + id: taskId, + }); + + const resultData = await resultResponse.json() as DataForSeoTaskResponse; + + if (resultData.status_code === 20000 && resultData.tasks?.[0]?.result) { + const result = resultData.tasks[0].result[0] as { + items?: Array<{ + type: string; + rank_group: number; + rank_absolute: number; + advertiser_id?: string; + creative_id?: string; + title: string; + description: string; + url: string; + domain: string; + breadcrumb: string; + phone?: string; + }>; + }; + + if (result && result.items) { + // Filter only paid ads + return result.items + .filter((item: { type: string }) => + item.type === "paid" || item.type === "shopping" + ) + .map((item: { + type: string; + rank_group: number; + rank_absolute: number; + advertiser_id?: string; + creative_id?: string; + title: string; + description: string; + url: string; + domain: string; + breadcrumb: string; + phone?: string; + }) => ({ + type: item.type, + rank_group: item.rank_group, + rank_absolute: item.rank_absolute, + advertiser_id: item.advertiser_id || "", + creative_id: item.creative_id || "", + title: item.title, + description: item.description, + url: item.url, + domain: item.domain, + breadcrumb: item.breadcrumb, + is_mobile: device === "mobile", + phone: item.phone, + })); + } + + return []; + } + + attempts++; + } + + throw new Error("Task timeout - please try again later"); +} diff --git a/data-for-seo/loaders/serp/getMapsResults.ts b/data-for-seo/loaders/serp/getMapsResults.ts new file mode 100644 index 000000000..171d8e0aa --- /dev/null +++ b/data-for-seo/loaders/serp/getMapsResults.ts @@ -0,0 +1,130 @@ +import { AppContext } from "../../mod.ts"; +import { DataForSeoTaskResponse } from "../../client.ts"; + +export interface Props { + /** + * @title Keyword + * @description The search query for Google Maps + */ + keyword: string; + + /** + * @title Language Name + * @description Language for the search (e.g., 'English', 'Portuguese') + */ + language_name?: string; + + /** + * @title Location Name + * @description Geographic location (e.g., 'New York', 'São Paulo') + */ + location_name?: string; + + /** + * @title Device + * @description Device type for the search + * @default desktop + * @enum ["desktop", "mobile"] + */ + device?: "desktop" | "mobile"; +} + +export interface MapsResult { + type: string; + rank_group: number; + rank_absolute: number; + title: string; + rating?: { + value: number; + votes_count: number; + rating_max: number; + }; + price_level?: string; + category?: string; + phone?: string; + address?: string; + website?: string; + domain?: string; + place_id: string; + cid: string; + latitude: number; + longitude: number; + is_closed?: boolean; + is_temporarily_closed?: boolean; + is_claimed?: boolean; + work_hours?: { + monday?: { open: string; close: string }; + tuesday?: { open: string; close: string }; + wednesday?: { open: string; close: string }; + thursday?: { open: string; close: string }; + friday?: { open: string; close: string }; + saturday?: { open: string; close: string }; + sunday?: { open: string; close: string }; + }; +} + +/** + * @title DataForSEO - Google Maps Results + * @description Get Google Maps local search results including business information, ratings, and location data + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { keyword, language_name, location_name, device = "desktop" } = props; + + // Post the task + const taskResponse = await ctx.client["POST /serp/google/maps/task_post"]( + {}, + { + body: [{ + keyword, + language_name, + location_name, + device, + }], + }, + ); + + const taskData = await taskResponse.json() as DataForSeoTaskResponse; + + if (taskData.status_code !== 20000 || !taskData.tasks?.[0]?.id) { + throw new Error(`DataForSEO API Error: ${taskData.status_message}`); + } + + const taskId = taskData.tasks[0].id; + + // Wait a bit for processing + await new Promise((resolve) => setTimeout(resolve, 3000)); + + // Get results (simplified polling) + const resultResponse = await ctx.client + [`GET /serp/google/organic/task_get/:id`]( + { + "id": taskId, + }, + ); + + const resultData = await resultResponse.json() as DataForSeoTaskResponse; + + if (resultData.status_code === 20000 && resultData.tasks?.[0]?.result) { + const taskResult = resultData.tasks[0].result[0] as { + items?: MapsResult[]; + }; + + if (taskResult?.items) { + return taskResult.items.filter((item) => + item.type === "maps_search" || + item.type === "local_pack" || + item.type === "maps_paid_item" + ); + } + } + + throw new Error( + `DataForSEO API Error: ${resultData.status_message || "No results found"}`, + ); +}; + +export default loader; diff --git a/data-for-seo/loaders/serp/getOrganicResults.ts b/data-for-seo/loaders/serp/getOrganicResults.ts new file mode 100644 index 000000000..d98c76744 --- /dev/null +++ b/data-for-seo/loaders/serp/getOrganicResults.ts @@ -0,0 +1,152 @@ +import { AppContext } from "../../mod.ts"; +import type { DataForSeoTaskResponse, SerpItem } from "../../client.ts"; + +interface Props { + /** + * @title Keyword + * @description The keyword to retrieve SERP results for + */ + keyword: string; + + /** + * @title Language + * @description Search language (e.g., "English", "Portuguese") + * @default English + */ + language_name?: string; + + /** + * @title Location + * @description Location for the SERP results + * @default United States + */ + location_name?: string; + + /** + * @title Device + * @description Device type for search results + * @default desktop + * @enum ["desktop", "mobile"] + */ + device?: "desktop" | "mobile"; + + /** + * @title Depth + * @description Number of results to return (max 100) + * @default 100 + */ + depth?: number; +} + +/** + * @title Get Organic Results + * @description Get organic search results from Google SERP + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { + keyword, + language_name = "English", + location_name = "United States", + device = "desktop", + depth = 100, + } = props; + + if (!keyword) { + throw new Error("Keyword is required"); + } + + // Post the task + const taskResponse = await ctx.client["POST /serp/google/organic/task_post"]( + {}, + { + body: [{ + keyword, + language_name, + location_name, + device, + depth, + }], + }, + ); + + const taskData = await taskResponse.json() as DataForSeoTaskResponse; + + if (taskData.status_code !== 20000 || !taskData.tasks?.[0]) { + throw new Error(taskData.status_message || "Failed to create task"); + } + + const taskId = taskData.tasks[0].id; + + // Wait for task completion + let attempts = 0; + const maxAttempts = 30; + const delay = 2000; + + while (attempts < maxAttempts) { + await new Promise((resolve) => setTimeout(resolve, delay)); + + const resultResponse = await ctx.client + [`GET /serp/google/organic/task_get/:id`]({ + id: taskId, + }); + + const resultData = await resultResponse.json() as DataForSeoTaskResponse; + + if (resultData.status_code === 20000 && resultData.tasks?.[0]?.result) { + const result = resultData.tasks[0].result[0] as { + items?: Array<{ + type: string; + rank_group: number; + rank_absolute: number; + position: string; + url: string; + domain: string; + title: string; + description: string; + breadcrumb?: string; + rating?: { value: number; votes_count: number }; + }>; + }; + + if (result && result.items) { + // Filter only organic results + return result.items + .filter((item: { type: string }) => item.type === "organic") + .map((item: { + type: string; + rank_group: number; + rank_absolute: number; + position: string; + url: string; + domain: string; + title: string; + description: string; + breadcrumb?: string; + rating?: { value: number; votes_count: number }; + }) => ({ + type: item.type, + rank_group: item.rank_group, + rank_absolute: item.rank_absolute, + position: item.position, + url: item.url, + domain: item.domain, + title: item.title, + description: item.description, + breadcrumb: item.breadcrumb, + is_paid: false, + rating: item.rating, + })); + } + + return []; + } + + attempts++; + } + + throw new Error("Task timeout - please try again later"); +} diff --git a/data-for-seo/loaders/tasks/getTaskResultAdvanced.ts b/data-for-seo/loaders/tasks/getTaskResultAdvanced.ts new file mode 100644 index 000000000..15821f959 --- /dev/null +++ b/data-for-seo/loaders/tasks/getTaskResultAdvanced.ts @@ -0,0 +1,99 @@ +import type { AppContext } from "../../mod.ts"; +import type { SerpItem } from "../../client.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @title Task ID + * @description The ID of the task to retrieve advanced results for + */ + taskId: string; +} + +export interface AdvancedTaskResult { + keyword: string; + type: string; + se_domain: string; + location_code: number; + language_code: string; + check_url: string; + datetime: string; + spell?: { + query: string; + type: string; + }; + refinement_chips?: Array<{ + type: string; + title: string; + url: string; + domain: string; + options?: Array<{ + type: string; + title: string; + url: string; + domain: string; + }>; + }>; + item_types: string[]; + se_results_count: number; + items_count: number; + items: Array>; // Advanced results include various SERP features + related_searches?: Array<{ + query: string; + url: string; + }>; + credits_used?: number; + serp_screenshot?: string; +} + +/** + * @title Get Task Result - Advanced + * @description Retrieves advanced SERP results with additional features for a specific task ID + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { taskId } = props; + + if (!taskId) { + throw new Error("Task ID is required"); + } + + try { + const response = await ctx.client + ["GET /serp/google/organic/task_get/advanced/:id"]({ + id: taskId, + }); + + const result = await handleDataForSeoResponse( + response, + "Task Result Advanced", + ); + + // Validação mais robusta da estrutura de resposta + if ( + !result.tasks || !Array.isArray(result.tasks) || result.tasks.length === 0 + ) { + throw new Error("Invalid response structure: no tasks found"); + } + + const task = result.tasks[0]; + + if ( + !task.result || !Array.isArray(task.result) || task.result.length === 0 + ) { + throw new Error(`Task ${taskId} completed but returned no results`); + } + + // DataForSEO sempre retorna apenas um resultado para task_get endpoints + return task.result[0] as AdvancedTaskResult; + } catch (error) { + throw new Error( + `Failed to get advanced task result: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/tasks/getTaskResultHtml.ts b/data-for-seo/loaders/tasks/getTaskResultHtml.ts new file mode 100644 index 000000000..ffdf428ec --- /dev/null +++ b/data-for-seo/loaders/tasks/getTaskResultHtml.ts @@ -0,0 +1,73 @@ +import type { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @title Task ID + * @description The ID of the task to retrieve HTML results for + */ + taskId: string; +} + +export interface HtmlTaskResult { + keyword: string; + type: string; + se_domain: string; + location_code: number; + language_code: string; + datetime: string; + items_count: number; + items: Array<{ + page: number; + html: string; + }>; +} + +/** + * @title Get Task Result - HTML + * @description Retrieves the raw HTML of SERP results for a specific task ID + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { taskId } = props; + + if (!taskId) { + throw new Error("Task ID is required"); + } + + try { + const response = await ctx.client + ["GET /serp/google/organic/task_get/html/:id"]({ + id: taskId, + }); + + const result = await handleDataForSeoResponse(response, "Task Result HTML"); + + // Validação mais robusta da estrutura de resposta + if ( + !result.tasks || !Array.isArray(result.tasks) || result.tasks.length === 0 + ) { + throw new Error("Invalid response structure: no tasks found"); + } + + const task = result.tasks[0]; + + if ( + !task.result || !Array.isArray(task.result) || task.result.length === 0 + ) { + throw new Error(`Task ${taskId} completed but returned no results`); + } + + // DataForSEO sempre retorna apenas um resultado para task_get endpoints + return task.result[0] as HtmlTaskResult; + } catch (error) { + throw new Error( + `Failed to get HTML task result: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/tasks/getTaskResultRegular.ts b/data-for-seo/loaders/tasks/getTaskResultRegular.ts new file mode 100644 index 000000000..88e197ada --- /dev/null +++ b/data-for-seo/loaders/tasks/getTaskResultRegular.ts @@ -0,0 +1,81 @@ +import type { AppContext } from "../../mod.ts"; +import type { SerpItem } from "../../client.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @title Task ID + * @description The ID of the task to retrieve results for + */ + taskId: string; +} + +export interface RegularTaskResult { + keyword: string; + type: string; + se_domain: string; + location_code: number; + language_code: string; + check_url: string; + datetime: string; + spell?: { + query: string; + type: string; + }; + item_types: string[]; + se_results_count: number; + items_count: number; + items: SerpItem[]; +} + +/** + * @title Get Task Result - Regular + * @description Retrieves regular SERP results for a specific task ID + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +) { + const { taskId } = props; + + if (!taskId) { + throw new Error("Task ID is required"); + } + + try { + const response = await ctx.client + ["GET /serp/google/organic/task_get/regular/:id"]({ + id: taskId, + }); + + const result = await handleDataForSeoResponse( + response, + "Task Result Regular", + ); + + // Validação mais robusta da estrutura de resposta + if ( + !result.tasks || !Array.isArray(result.tasks) || result.tasks.length === 0 + ) { + throw new Error("Invalid response structure: no tasks found"); + } + + const task = result.tasks[0]; + + if ( + !task.result || !Array.isArray(task.result) || task.result.length === 0 + ) { + throw new Error(`Task ${taskId} completed but returned no results`); + } + + // DataForSEO sempre retorna apenas um resultado para task_get endpoints + return task.result[0] as RegularTaskResult; + } catch (error) { + throw new Error( + `Failed to get regular task result: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/tasks/getTasksFixed.ts b/data-for-seo/loaders/tasks/getTasksFixed.ts new file mode 100644 index 000000000..bedd01b54 --- /dev/null +++ b/data-for-seo/loaders/tasks/getTasksFixed.ts @@ -0,0 +1,33 @@ +import type { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @hidden + */ + _dummy?: never; +} + +/** + * @title Get Tasks Fixed + * @description Returns the list of tasks that have been fixed after an error + */ +export default async function loader( + _props: Props, + _req: Request, + ctx: AppContext, +) { + try { + const response = await ctx.client["GET /serp/google/organic/tasks_fixed"]( + {}, + ); + + return await handleDataForSeoResponse(response, "Tasks Fixed"); + } catch (error) { + throw new Error( + `Failed to get fixed tasks: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/tasks/getTasksReady.ts b/data-for-seo/loaders/tasks/getTasksReady.ts new file mode 100644 index 000000000..9a5d69359 --- /dev/null +++ b/data-for-seo/loaders/tasks/getTasksReady.ts @@ -0,0 +1,33 @@ +import type { AppContext } from "../../mod.ts"; +import { handleDataForSeoResponse } from "../../utils/handleResponse.ts"; + +export interface Props { + /** + * @hidden + */ + _dummy?: never; +} + +/** + * @title Get Tasks Ready + * @description Returns the list of completed SERP tasks for Google Organic search + */ +export default async function loader( + _props: Props, + _req: Request, + ctx: AppContext, +) { + try { + const response = await ctx.client["GET /serp/google/organic/tasks_ready"]( + {}, + ); + + return await handleDataForSeoResponse(response, "Tasks Ready"); + } catch (error) { + throw new Error( + `Failed to get tasks ready: ${ + error instanceof Error ? error.message : String(error) + }`, + ); + } +} diff --git a/data-for-seo/loaders/traffic/getTrafficByCountry.ts b/data-for-seo/loaders/traffic/getTrafficByCountry.ts new file mode 100644 index 000000000..31bd03f9a --- /dev/null +++ b/data-for-seo/loaders/traffic/getTrafficByCountry.ts @@ -0,0 +1,62 @@ +import { AppContext } from "../../mod.ts"; +import { DataForSeoTaskResponse, TrafficByCountry } from "../../client.ts"; + +export interface Props { + /** + * @title Target + * @description Domain to analyze traffic by country + */ + target: string; + + /** + * @title Limit + * @description Maximum number of countries to return + * @default 50 + */ + limit?: number; + + /** + * @title Offset + * @description Offset for pagination + * @default 0 + */ + offset?: number; +} + +/** + * @title DataForSEO - Traffic by Country + * @description Get traffic distribution by country for a domain + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { target, limit = 50, offset = 0 } = props; + + const response = await ctx.client["POST /traffic_analytics/by_country/live"]( + {}, + { + body: [{ + target, + limit, + offset, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000) { + throw new Error(`DataForSEO API Error: ${data.status_message}`); + } + + if (data.tasks?.[0]?.result?.[0]) { + const result = data.tasks[0].result[0] as { items?: TrafficByCountry[] }; + return result.items || []; + } + + return []; +}; + +export default loader; diff --git a/data-for-seo/loaders/traffic/getTrafficByPages.ts b/data-for-seo/loaders/traffic/getTrafficByPages.ts new file mode 100644 index 000000000..6b6d705e6 --- /dev/null +++ b/data-for-seo/loaders/traffic/getTrafficByPages.ts @@ -0,0 +1,81 @@ +import { AppContext } from "../../mod.ts"; +import { DataForSeoTaskResponse, TrafficByPage } from "../../client.ts"; + +export interface Props { + /** + * @title Target + * @description Domain to analyze traffic by pages + */ + target: string; + + /** + * @title Limit + * @description Maximum number of pages to return + * @default 100 + */ + limit?: number; + + /** + * @title Offset + * @description Offset for pagination + * @default 0 + */ + offset?: number; + + /** + * @title Order By + * @description Sort results by specific metric + * @enum ["visits desc", "visits asc", "bounce_rate desc", "bounce_rate asc", "avg_time_on_page desc", "avg_time_on_page asc"] + */ + orderBy?: string; + + /** + * @title Min Visits + * @description Filter pages by minimum visits + * @default 0 + */ + minVisits?: number; +} + +/** + * @title DataForSEO - Traffic by Pages + * @description Get traffic metrics for individual pages of a domain + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { target, limit = 100, offset = 0, orderBy, minVisits = 0 } = props; + + const filters = minVisits > 0 ? [`visits,>,${minVisits}`] : undefined; + const order_by = orderBy ? [orderBy] : undefined; + + const response = await ctx.client["POST /traffic_analytics/by_pages/live"]( + {}, + { + body: [{ + target, + limit, + offset, + filters, + order_by, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000) { + throw new Error(`DataForSEO API Error: ${data.status_message}`); + } + + if (data.tasks?.[0]?.result?.[0]) { + const result = data.tasks[0].result[0] as { items?: TrafficByPage[] }; + return result.items || []; + } + + return []; +}; + +export default loader; diff --git a/data-for-seo/loaders/traffic/getTrafficBySources.ts b/data-for-seo/loaders/traffic/getTrafficBySources.ts new file mode 100644 index 000000000..daf560492 --- /dev/null +++ b/data-for-seo/loaders/traffic/getTrafficBySources.ts @@ -0,0 +1,63 @@ +import { AppContext } from "../../mod.ts"; +import type { DataForSeoTaskResponse, TrafficBySource } from "../../client.ts"; + +interface Props { + /** + * @title Target + * @description Domain to analyze traffic sources + */ + target: string; +} + +/** + * @title Get Traffic by Sources + * @description Get traffic breakdown by source (direct, organic, paid, referral, social) + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { target } = props; + + if (!target) { + throw new Error("Target domain is required"); + } + + const response = await ctx.client["POST /traffic_analytics/by_source/live"]( + {}, + { + body: [{ + target, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000 || !data.tasks?.[0]?.result?.[0]) { + throw new Error( + data.status_message || "Failed to fetch traffic by sources", + ); + } + + const result = data.tasks[0].result[0] as { + direct?: number; + search_organic?: number; + search_paid?: number; + referral?: number; + social?: number; + mail?: number; + display_ad?: number; + }; + + return { + direct: result.direct || 0, + search_organic: result.search_organic || 0, + search_paid: result.search_paid || 0, + referral: result.referral || 0, + social: result.social || 0, + mail: result.mail || 0, + display_ad: result.display_ad || 0, + }; +} diff --git a/data-for-seo/loaders/traffic/getTrafficOverview.ts b/data-for-seo/loaders/traffic/getTrafficOverview.ts new file mode 100644 index 000000000..91874b893 --- /dev/null +++ b/data-for-seo/loaders/traffic/getTrafficOverview.ts @@ -0,0 +1,65 @@ +import { AppContext } from "../../mod.ts"; +import type { DataForSeoTaskResponse, TrafficOverview } from "../../client.ts"; + +interface Props { + /** + * @title Target + * @description Domain to analyze traffic + */ + target: string; +} + +/** + * @title Get Traffic Overview + * @description Get website traffic overview metrics + */ +export default async function loader( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { target } = props; + + if (!target) { + throw new Error("Target domain is required"); + } + + const response = await ctx.client["POST /traffic_analytics/overview/live"]( + {}, + { + body: [{ + target, + }], + }, + ); + + const data = await response.json() as DataForSeoTaskResponse; + + if (data.status_code !== 20000 || !data.tasks?.[0]?.result?.[0]) { + throw new Error(data.status_message || "Failed to fetch traffic overview"); + } + + const result = data.tasks[0].result[0] as { + target: string; + date?: string; + rank?: number; + visits?: number; + unique_visitors?: number; + pages_per_visit?: number; + avg_visit_duration?: number; + bounce_rate?: number; + users_expected_visits_rate?: number; + }; + + return { + target: result.target, + date: result.date || new Date().toISOString(), + rank: result.rank || 0, + visits: result.visits || 0, + unique_visitors: result.unique_visitors || 0, + pages_per_visit: result.pages_per_visit || 0, + avg_visit_duration: result.avg_visit_duration || 0, + bounce_rate: result.bounce_rate || 0, + users_expected_visits_rate: result.users_expected_visits_rate || 0, + }; +} diff --git a/data-for-seo/manifest.gen.ts b/data-for-seo/manifest.gen.ts new file mode 100644 index 000000000..70bf2e28d --- /dev/null +++ b/data-for-seo/manifest.gen.ts @@ -0,0 +1,109 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/analyzeKeywordDifficulty.ts"; +import * as $$$$$$$$$1 from "./actions/analyzeLocalSEO.ts"; +import * as $$$$$$$$$2 from "./actions/async/createAdsCompetitionTask.ts"; +import * as $$$$$$$$$3 from "./actions/async/createAdsSerpTask.ts"; +import * as $$$$$$$$$4 from "./actions/async/createMapsSerpTask.ts"; +import * as $$$$$$$$$5 from "./actions/async/createOrganicSerpTask.ts"; +import * as $$$$$$$$$6 from "./actions/async/createRelatedKeywordsTask.ts"; +import * as $$$$$$$$$7 from "./actions/async/createSearchVolumeTask.ts"; +import * as $$$$$$$$$8 from "./actions/compareDomainMetrics.ts"; +import * as $$$$$$$$$9 from "./actions/createAdsCompetitionTask.ts"; +import * as $$$$$$$$$10 from "./actions/generateSEOAudit.ts"; +import * as $$$$$$$$$11 from "./actions/trackSERPFeatures.ts"; +import * as $$$0 from "./loaders/async/getAdsCompetitionResult.ts"; +import * as $$$1 from "./loaders/async/getMapsResultsResult.ts"; +import * as $$$2 from "./loaders/async/getRelatedKeywordsResult.ts"; +import * as $$$3 from "./loaders/async/getSearchVolumeResult.ts"; +import * as $$$4 from "./loaders/backlinks/getAnchors.ts"; +import * as $$$5 from "./loaders/backlinks/getBacklinks.ts"; +import * as $$$6 from "./loaders/backlinks/getBacklinksOverview.ts"; +import * as $$$7 from "./loaders/backlinks/getReferringDomains.ts"; +import * as $$$8 from "./loaders/keywords/getAdsCompetition.ts"; +import * as $$$9 from "./loaders/keywords/getRelatedKeywords.ts"; +import * as $$$10 from "./loaders/keywords/getSearchVolume.ts"; +import * as $$$11 from "./loaders/live/getBacklinks.ts"; +import * as $$$12 from "./loaders/live/getBacklinksOverview.ts"; +import * as $$$13 from "./loaders/live/getGoogleDatasetSearchLiveAdvanced.ts"; +import * as $$$14 from "./loaders/live/getGoogleEventsLiveAdvanced.ts"; +import * as $$$15 from "./loaders/live/getGoogleNewsLiveAdvanced.ts"; +import * as $$$16 from "./loaders/live/getOrganicSerpLiveAdvanced.ts"; +import * as $$$17 from "./loaders/live/getReferringDomains.ts"; +import * as $$$18 from "./loaders/live/getTrafficByCountry.ts"; +import * as $$$19 from "./loaders/live/getTrafficByPages.ts"; +import * as $$$20 from "./loaders/live/getTrafficBySources.ts"; +import * as $$$21 from "./loaders/live/getTrafficOverview.ts"; +import * as $$$22 from "./loaders/serp/getAdResults.ts"; +import * as $$$23 from "./loaders/serp/getMapsResults.ts"; +import * as $$$24 from "./loaders/serp/getOrganicResults.ts"; +import * as $$$25 from "./loaders/tasks/getTaskResultAdvanced.ts"; +import * as $$$26 from "./loaders/tasks/getTaskResultHtml.ts"; +import * as $$$27 from "./loaders/tasks/getTaskResultRegular.ts"; +import * as $$$28 from "./loaders/tasks/getTasksFixed.ts"; +import * as $$$29 from "./loaders/tasks/getTasksReady.ts"; +import * as $$$30 from "./loaders/traffic/getTrafficByCountry.ts"; +import * as $$$31 from "./loaders/traffic/getTrafficByPages.ts"; +import * as $$$32 from "./loaders/traffic/getTrafficBySources.ts"; +import * as $$$33 from "./loaders/traffic/getTrafficOverview.ts"; + +const manifest = { + "loaders": { + "data-for-seo/loaders/async/getAdsCompetitionResult.ts": $$$0, + "data-for-seo/loaders/async/getMapsResultsResult.ts": $$$1, + "data-for-seo/loaders/async/getRelatedKeywordsResult.ts": $$$2, + "data-for-seo/loaders/async/getSearchVolumeResult.ts": $$$3, + "data-for-seo/loaders/backlinks/getAnchors.ts": $$$4, + "data-for-seo/loaders/backlinks/getBacklinks.ts": $$$5, + "data-for-seo/loaders/backlinks/getBacklinksOverview.ts": $$$6, + "data-for-seo/loaders/backlinks/getReferringDomains.ts": $$$7, + "data-for-seo/loaders/keywords/getAdsCompetition.ts": $$$8, + "data-for-seo/loaders/keywords/getRelatedKeywords.ts": $$$9, + "data-for-seo/loaders/keywords/getSearchVolume.ts": $$$10, + "data-for-seo/loaders/live/getBacklinks.ts": $$$11, + "data-for-seo/loaders/live/getBacklinksOverview.ts": $$$12, + "data-for-seo/loaders/live/getGoogleDatasetSearchLiveAdvanced.ts": $$$13, + "data-for-seo/loaders/live/getGoogleEventsLiveAdvanced.ts": $$$14, + "data-for-seo/loaders/live/getGoogleNewsLiveAdvanced.ts": $$$15, + "data-for-seo/loaders/live/getOrganicSerpLiveAdvanced.ts": $$$16, + "data-for-seo/loaders/live/getReferringDomains.ts": $$$17, + "data-for-seo/loaders/live/getTrafficByCountry.ts": $$$18, + "data-for-seo/loaders/live/getTrafficByPages.ts": $$$19, + "data-for-seo/loaders/live/getTrafficBySources.ts": $$$20, + "data-for-seo/loaders/live/getTrafficOverview.ts": $$$21, + "data-for-seo/loaders/serp/getAdResults.ts": $$$22, + "data-for-seo/loaders/serp/getMapsResults.ts": $$$23, + "data-for-seo/loaders/serp/getOrganicResults.ts": $$$24, + "data-for-seo/loaders/tasks/getTaskResultAdvanced.ts": $$$25, + "data-for-seo/loaders/tasks/getTaskResultHtml.ts": $$$26, + "data-for-seo/loaders/tasks/getTaskResultRegular.ts": $$$27, + "data-for-seo/loaders/tasks/getTasksFixed.ts": $$$28, + "data-for-seo/loaders/tasks/getTasksReady.ts": $$$29, + "data-for-seo/loaders/traffic/getTrafficByCountry.ts": $$$30, + "data-for-seo/loaders/traffic/getTrafficByPages.ts": $$$31, + "data-for-seo/loaders/traffic/getTrafficBySources.ts": $$$32, + "data-for-seo/loaders/traffic/getTrafficOverview.ts": $$$33, + }, + "actions": { + "data-for-seo/actions/analyzeKeywordDifficulty.ts": $$$$$$$$$0, + "data-for-seo/actions/analyzeLocalSEO.ts": $$$$$$$$$1, + "data-for-seo/actions/async/createAdsCompetitionTask.ts": $$$$$$$$$2, + "data-for-seo/actions/async/createAdsSerpTask.ts": $$$$$$$$$3, + "data-for-seo/actions/async/createMapsSerpTask.ts": $$$$$$$$$4, + "data-for-seo/actions/async/createOrganicSerpTask.ts": $$$$$$$$$5, + "data-for-seo/actions/async/createRelatedKeywordsTask.ts": $$$$$$$$$6, + "data-for-seo/actions/async/createSearchVolumeTask.ts": $$$$$$$$$7, + "data-for-seo/actions/compareDomainMetrics.ts": $$$$$$$$$8, + "data-for-seo/actions/createAdsCompetitionTask.ts": $$$$$$$$$9, + "data-for-seo/actions/generateSEOAudit.ts": $$$$$$$$$10, + "data-for-seo/actions/trackSERPFeatures.ts": $$$$$$$$$11, + }, + "name": "data-for-seo", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/data-for-seo/mod.ts b/data-for-seo/mod.ts new file mode 100644 index 000000000..ee8982f89 --- /dev/null +++ b/data-for-seo/mod.ts @@ -0,0 +1,57 @@ +import type { App, FnContext } from "@deco/deco"; +import { fetchSafe } from "../utils/fetch.ts"; +import { createHttpClient } from "../utils/http.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import type { DataForSeoClient } from "./client.ts"; + +export interface Props { + /** + * @title Login (Email) + * @description Your DataForSEO account email + * @minValue 1 + */ + login: string; + + /** + * @title Password + * @description Your DataForSEO account password + * @minValue 1 + */ + password: string; +} + +export interface State extends Props { + client: ReturnType>; +} + +export type AppContext = FnContext; + +/** + * @title DataForSEO + * @appName dataforseo + * @description Access DataForSEO data including keywords, SERP analysis, backlinks, and traffic analytics. + * @category Analytics + * @logo https://dataforseo.com/wp-content/uploads/2022/04/cropped-favicon_512.png + */ +export default function App(props: Props): App { + const { login, password } = props; + + // Create Basic Auth header + const basicAuth = btoa(`${login}:${password}`); + + const client = createHttpClient({ + base: "https://api.dataforseo.com/v3", + headers: new Headers({ + "Authorization": `Basic ${basicAuth}`, + "Content-Type": "application/json", + }), + fetcher: fetchSafe, + }); + + const state = { ...props, client }; + + return { + state, + manifest, + }; +} diff --git a/data-for-seo/utils/handleResponse.ts b/data-for-seo/utils/handleResponse.ts new file mode 100644 index 000000000..35b5f6f9d --- /dev/null +++ b/data-for-seo/utils/handleResponse.ts @@ -0,0 +1,235 @@ +import { HttpError } from "../../utils/http.ts"; + +export async function handleDataForSeoResponse( + response: Response, + toolName: string, +) { + let data; + + try { + data = await response.json(); + } catch (error) { + // Se não conseguiu fazer parse do JSON + throw new HttpError( + 500, + JSON.stringify({ + status: "error", + message: + `❌ Erro ao processar resposta de ${toolName}. A API não retornou um JSON válido.`, + details: error instanceof Error ? error.message : "Erro desconhecido", + }), + ); + } + + // Verifica se data é null ou undefined + if (!data) { + throw new HttpError( + 500, + JSON.stringify({ + status: "error", + message: + `❌ API retornou resposta vazia para ${toolName}. Tente novamente ou verifique se os parâmetros estão corretos.`, + response_was_null: true, + }), + ); + } + + // Success + if (data.status_code === 20000) { + // Verifica se tem dados válidos nos tasks + if (data.tasks && data.tasks.length > 0) { + const task = data.tasks[0]; + + // Se é um GET result e retornou null no result + if (task.result === null && task.status_message === "Task In Queue") { + throw new HttpError( + 202, + JSON.stringify({ + status: "processing", + message: + `⏳ Tarefa de ${toolName} ainda está sendo processada. Por favor, aguarde mais alguns segundos e tente novamente.`, + retry_after: 5, + task_id: task.id, + }), + ); + } + + // Se tem result mas está vazio + if (task.result && task.result.length === 0) { + return { + status: "success", + message: + `✅ Consulta concluída para ${toolName}, mas não foram encontrados dados.`, + empty_result: true, + data: data, + }; + } + } + + return data; + } + + const statusMessage = data.status_message || "Erro desconhecido da API."; + const statusCode = data.status_code; + + switch (statusCode) { + case 40602: // Task In Queue + throw new HttpError( + 202, + JSON.stringify({ + status: "processing", + message: + `⏳ Tarefa de ${toolName} está sendo processada. Por favor, aguarde alguns segundos e tente novamente.`, + retry_after: 3, + }), + ); + + case 40501: // Invalid Field + if (statusMessage.includes("'location_name'")) { + throw new HttpError( + 400, + JSON.stringify({ + status: "error", + message: + `❌ Campo inválido: 'location_name'. 💡 Dica: Use 'location_code' ao invés de 'location_name'. Exemplos: 🇺🇸 United States = 2840, 🇧🇷 Brazil = 2076, 🇬🇧 United Kingdom = 2826, 🇵🇹 Portugal = 2620.`, + }), + ); + } + throw new HttpError( + 400, + JSON.stringify({ + status: "error", + message: + `❌ Erro de campo inválido na API ${toolName}: ${statusMessage}`, + }), + ); + + case 40402: // Invalid Path + throw new HttpError( + 501, + JSON.stringify({ + status: "error", + message: + `❌ Endpoint de ${toolName} não disponível. Este recurso pode ter sido descontinuado ou requer assinatura especial.`, + }), + ); + + case 40204: // Access denied + throw new HttpError( + 403, + JSON.stringify({ + status: "error", + message: + `🔒 Acesso negado para ${toolName}. Este recurso requer assinatura ativa. Visite: https://app.dataforseo.com/backlinks-subscription`, + }), + ); + + case 40100: // Unauthorized + throw new HttpError( + 401, + JSON.stringify({ + status: "error", + message: + `🔒 Não autorizado para ${toolName}. Verifique suas credenciais de API em https://app.dataforseo.com/api-access.`, + }), + ); + + case 40106: // Rate limit exceeded + throw new HttpError( + 429, + JSON.stringify({ + status: "error", + message: + `⏱️ Limite de requisições excedido para ${toolName}. Aguarde alguns minutos antes de tentar novamente.`, + }), + ); + + case 40601: // Task not found + throw new HttpError( + 404, + JSON.stringify({ + status: "error", + message: + `❌ Task não encontrada para ${toolName}. Verifique se o task_id está correto ou se a task não expirou.`, + }), + ); + + default: + throw new HttpError( + response.status || 500, + JSON.stringify({ + status: "error", + message: + `🚨 Erro inesperado da API ${toolName}: ${statusMessage} (Código: ${statusCode})`, + status_code: statusCode, + status_message: statusMessage, + }), + ); + } +} + +// Função específica para actions que criam tasks +export async function handleTaskCreationResponse( + response: Response, + taskType: string, +) { + let data; + + try { + data = await response.json(); + } catch (error) { + throw new HttpError( + 500, + JSON.stringify({ + status: "error", + message: + `❌ Erro ao criar task de ${taskType}. A API não retornou um JSON válido.`, + details: error instanceof Error ? error.message : "Erro desconhecido", + }), + ); + } + + // Verifica se data é null + if (!data) { + throw new HttpError( + 500, + JSON.stringify({ + status: "error", + message: `❌ API retornou resposta vazia ao criar task de ${taskType}.`, + response_was_null: true, + }), + ); + } + + if (data.status_code === 20000) { + const taskInfo = data.tasks?.[0]; + if (taskInfo) { + return { + status: "success", + message: `✅ Task de ${taskType} criada com sucesso!`, + task_id: taskInfo.id, + cost: taskInfo.cost, + status_code: taskInfo.status_code, + path: taskInfo.path, + data: taskInfo.data, + result_url: taskInfo.result_url, + instructions: + `⏱️ Aguarde 3-5 segundos e use o loader correspondente com o task_id: ${taskInfo.id}`, + }; + } + + // Se não tem task info + throw new HttpError( + 500, + JSON.stringify({ + status: "error", + message: + `❌ Task de ${taskType} foi criada mas não retornou informações da task.`, + raw_response: data, + }), + ); + } + + // Se não foi sucesso, usa o handler padrão + return handleDataForSeoResponse(response, taskType); +} diff --git a/deco.ts b/deco.ts index 4a7c750db..e7f8018eb 100644 --- a/deco.ts +++ b/deco.ts @@ -10,26 +10,92 @@ const compatibilityApps = [{ const config = { apps: [ + app("data-for-seo"), + app("discord-user"), + app("discord-bot"), + app("pncp"), + app("google-calendar"), + app("apify"), + app("google-docs"), + app("google-drive"), + app("google-youtube"), + app("barte"), + app("hubspot"), + app("pinecone-assistant"), + app("shopify-mcp"), + app("superfrete"), + app("google-gmail"), + app("github"), + app("turso-db"), + app("discohook"), + app("tiny"), + app("js-bundler"), + app("jira"), + app("deno-deploy"), + app("exa"), + app("figma"), + app("unsplash"), + app("reflect"), + app("grain"), + app("slack"), + app("serper"), + app("sienge"), + app("vertex"), + app("google-sheets"), + app("posthog"), + app("decopilot-app"), + app("smarthint"), + app("ra-trustvox"), + app("anthropic"), + app("resend"), + app("emailjs"), + app("aws"), + app("konfidency"), + app("mailchimp"), + app("ai-assistants"), + app("airtable"), + app("files"), + app("openai"), + app("perplexity"), + app("brand-assistant"), + app("implementation"), app("weather"), - { - dir: "admin", - name: "deco-sites/admin", - }, + app("blog"), app("analytics"), + app("sourei"), app("typesense"), app("algolia"), - app("handlebars"), app("vtex"), app("vnda"), app("wake"), + app("wap"), app("linx"), + app("linx-impulse"), app("shopify"), + app("stability"), + app("elevenlabs"), + app("vidu"), + app("nuvemshop"), + app("streamshop"), + app("brasilapi"), + app("readwise"), + app("rd-station-marketing"), app("website"), app("commerce"), app("workflows"), app("verified-reviews"), app("power-reviews"), + app("crux"), app("decohub"), + app("htmx"), + app("querido-diario"), + app("sap"), + app("tiptap-cloud"), + app("browser-use"), + app("clearsale"), + app("spotify"), + app("google-slides"), + app("google-sites"), ...compatibilityApps, ], }; diff --git a/decohub/apps/admin.ts b/decohub/apps/admin.ts deleted file mode 100644 index d7c20ecd0..000000000 --- a/decohub/apps/admin.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "../../admin/mod.ts"; diff --git a/decohub/apps/ai-assistants.ts b/decohub/apps/ai-assistants.ts new file mode 100644 index 000000000..02d3e519d --- /dev/null +++ b/decohub/apps/ai-assistants.ts @@ -0,0 +1 @@ +export { default } from "../../ai-assistants/mod.ts"; diff --git a/decohub/apps/algolia.ts b/decohub/apps/algolia.ts index d3513a9f6..780f10fc6 100644 --- a/decohub/apps/algolia.ts +++ b/decohub/apps/algolia.ts @@ -1,7 +1 @@ -import { Markdown } from "../components/Markdown.tsx"; - -export { default } from "../../algolia/mod.ts"; - -export const Preview = await Markdown( - new URL("../../algolia/README.md", import.meta.url).href, -); +export { default, preview } from "../../algolia/mod.ts"; diff --git a/decohub/apps/anthropic.ts b/decohub/apps/anthropic.ts new file mode 100644 index 000000000..125be545f --- /dev/null +++ b/decohub/apps/anthropic.ts @@ -0,0 +1 @@ +export { default } from "../../anthropic/mod.ts"; diff --git a/decohub/apps/blog.ts b/decohub/apps/blog.ts new file mode 100644 index 000000000..94a7db900 --- /dev/null +++ b/decohub/apps/blog.ts @@ -0,0 +1 @@ +export { default } from "../../blog/mod.ts"; diff --git a/decohub/apps/brand-assistant.ts b/decohub/apps/brand-assistant.ts new file mode 100644 index 000000000..0514804b5 --- /dev/null +++ b/decohub/apps/brand-assistant.ts @@ -0,0 +1 @@ +export { default } from "../../brand-assistant/mod.ts"; diff --git a/decohub/apps/crux.ts b/decohub/apps/crux.ts new file mode 100644 index 000000000..7d4d5531f --- /dev/null +++ b/decohub/apps/crux.ts @@ -0,0 +1 @@ +export { default, Preview } from "../../crux/mod.ts"; diff --git a/decohub/apps/emailjs.ts b/decohub/apps/emailjs.ts new file mode 100644 index 000000000..e43c37d38 --- /dev/null +++ b/decohub/apps/emailjs.ts @@ -0,0 +1 @@ +export { default, preview } from "../../emailjs/mod.ts"; diff --git a/decohub/apps/handlebars.ts b/decohub/apps/handlebars.ts deleted file mode 100644 index 21aafaac0..000000000 --- a/decohub/apps/handlebars.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from "../../handlebars/mod.ts"; diff --git a/decohub/apps/htmx.ts b/decohub/apps/htmx.ts new file mode 100644 index 000000000..b0f57112b --- /dev/null +++ b/decohub/apps/htmx.ts @@ -0,0 +1 @@ +export { default, preview } from "../../htmx/mod.ts"; diff --git a/decohub/apps/implementation.ts b/decohub/apps/implementation.ts new file mode 100644 index 000000000..ee33cec16 --- /dev/null +++ b/decohub/apps/implementation.ts @@ -0,0 +1 @@ +export { default, preview } from "../../implementation/mod.ts"; diff --git a/decohub/apps/konfidency.ts b/decohub/apps/konfidency.ts new file mode 100644 index 000000000..eff6eb05a --- /dev/null +++ b/decohub/apps/konfidency.ts @@ -0,0 +1 @@ +export { default, preview } from "../../konfidency/mod.ts"; diff --git a/decohub/apps/linx-impulse.ts b/decohub/apps/linx-impulse.ts new file mode 100644 index 000000000..9b70b2888 --- /dev/null +++ b/decohub/apps/linx-impulse.ts @@ -0,0 +1 @@ +export { default } from "../../linx-impulse/mod.ts"; diff --git a/decohub/apps/linx.ts b/decohub/apps/linx.ts index 38ce09dce..4f983ceab 100644 --- a/decohub/apps/linx.ts +++ b/decohub/apps/linx.ts @@ -1,7 +1 @@ -import { Markdown } from "../components/Markdown.tsx"; - -export { default } from "../../linx/mod.ts"; - -export const Preview = await Markdown( - new URL("../../linx/README.md", import.meta.url).href, -); +export { default, preview } from "../../linx/mod.ts"; diff --git a/decohub/apps/mailchimp.ts b/decohub/apps/mailchimp.ts new file mode 100644 index 000000000..a470fd9a3 --- /dev/null +++ b/decohub/apps/mailchimp.ts @@ -0,0 +1 @@ +export { default, preview } from "../../mailchimp/mod.ts"; diff --git a/decohub/apps/nuvemshop.ts b/decohub/apps/nuvemshop.ts new file mode 100644 index 000000000..ed6f5b479 --- /dev/null +++ b/decohub/apps/nuvemshop.ts @@ -0,0 +1 @@ +export { default, preview } from "../../nuvemshop/mod.ts"; diff --git a/decohub/apps/posthog.ts b/decohub/apps/posthog.ts new file mode 100644 index 000000000..c4cf74803 --- /dev/null +++ b/decohub/apps/posthog.ts @@ -0,0 +1 @@ +export { default, preview } from "../../posthog/mod.ts"; diff --git a/decohub/apps/ra-trustvox.ts b/decohub/apps/ra-trustvox.ts new file mode 100644 index 000000000..488ad8448 --- /dev/null +++ b/decohub/apps/ra-trustvox.ts @@ -0,0 +1 @@ +export { default } from "../../ra-trustvox/mod.ts"; diff --git a/decohub/apps/resend.ts b/decohub/apps/resend.ts new file mode 100644 index 000000000..b85fea41e --- /dev/null +++ b/decohub/apps/resend.ts @@ -0,0 +1 @@ +export { default, preview } from "../../resend/mod.ts"; diff --git a/decohub/apps/shopify.ts b/decohub/apps/shopify.ts index dacbdcb3a..963ab1d19 100644 --- a/decohub/apps/shopify.ts +++ b/decohub/apps/shopify.ts @@ -1,7 +1 @@ -import { Markdown } from "../components/Markdown.tsx"; - -export { default } from "../../shopify/mod.ts"; - -export const Preview = await Markdown( - new URL("../../shopify/README.md", import.meta.url).href, -); +export { default, preview } from "../../shopify/mod.ts"; diff --git a/decohub/apps/smarthint.ts b/decohub/apps/smarthint.ts new file mode 100644 index 000000000..0489d6d98 --- /dev/null +++ b/decohub/apps/smarthint.ts @@ -0,0 +1 @@ +export { default, preview } from "../../smarthint/mod.ts"; diff --git a/decohub/apps/sourei.ts b/decohub/apps/sourei.ts new file mode 100644 index 000000000..2186ea074 --- /dev/null +++ b/decohub/apps/sourei.ts @@ -0,0 +1 @@ +export { default, preview } from "../../sourei/mod.ts"; diff --git a/decohub/apps/streamshop.ts b/decohub/apps/streamshop.ts new file mode 100644 index 000000000..8bb34bfaa --- /dev/null +++ b/decohub/apps/streamshop.ts @@ -0,0 +1 @@ +export { default, preview } from "../../streamshop/mod.ts"; diff --git a/decohub/apps/typesense.ts b/decohub/apps/typesense.ts index 040e6a5a6..738685d25 100644 --- a/decohub/apps/typesense.ts +++ b/decohub/apps/typesense.ts @@ -1,7 +1 @@ -import { Markdown } from "../components/Markdown.tsx"; - -export { default } from "../../typesense/mod.ts"; - -export const Preview = await Markdown( - new URL("../../typesense/README.md", import.meta.url).href, -); +export { default, preview } from "../../typesense/mod.ts"; diff --git a/decohub/apps/vnda.ts b/decohub/apps/vnda.ts index 10309090d..55f90c014 100644 --- a/decohub/apps/vnda.ts +++ b/decohub/apps/vnda.ts @@ -1,7 +1 @@ -import { Markdown } from "../components/Markdown.tsx"; - -export { default } from "../../vnda/mod.ts"; - -export const Preview = await Markdown( - new URL("../../vnda/README.md", import.meta.url).href, -); +export { default, preview } from "../../vnda/mod.ts"; diff --git a/decohub/apps/vtex.ts b/decohub/apps/vtex.ts index 540c7c614..66a661a55 100644 --- a/decohub/apps/vtex.ts +++ b/decohub/apps/vtex.ts @@ -1,7 +1,16 @@ -import { Markdown } from "../components/Markdown.tsx"; - export { default } from "../../vtex/mod.ts"; - -export const Preview = await Markdown( - new URL("../../vtex/README.md", import.meta.url).href, -); +import { PreviewVtex } from "../../vtex/preview/Preview.tsx"; +import { Markdown } from "../components/Markdown.tsx"; +import { type AppRuntime } from "@deco/deco"; +export const preview = async (props: AppRuntime) => { + const markdownContent = await Markdown( + new URL("../../vtex/README.md", import.meta.url).href, + ); + return { + Component: PreviewVtex, + props: { + ...props, + markdownContent, + }, + }; +}; diff --git a/decohub/apps/wake.ts b/decohub/apps/wake.ts index 27eb76f7a..47cabd78c 100644 --- a/decohub/apps/wake.ts +++ b/decohub/apps/wake.ts @@ -1,7 +1 @@ -import { Markdown } from "../components/Markdown.tsx"; - -export { default } from "../../wake/mod.ts"; - -export const Preview = await Markdown( - new URL("../../wake/README.md", import.meta.url).href, -); +export { default, preview } from "../../wake/mod.ts"; diff --git a/decohub/apps/wap.ts b/decohub/apps/wap.ts new file mode 100644 index 000000000..fd842f473 --- /dev/null +++ b/decohub/apps/wap.ts @@ -0,0 +1,3 @@ +import { Markdown as _Markdown } from "../components/Markdown.tsx"; + +export { default } from "../../wap/mod.ts"; diff --git a/decohub/components/Markdown.tsx b/decohub/components/Markdown.tsx index e7c986c7e..1f590df3d 100644 --- a/decohub/components/Markdown.tsx +++ b/decohub/components/Markdown.tsx @@ -1,11 +1,36 @@ -import { CSS, KATEX_CSS, render } from "https://deno.land/x/gfm@0.2.5/mod.ts"; -import "https://esm.sh/prismjs@1.27.0/components/prism-diff.js?no-check"; -import "https://esm.sh/prismjs@1.27.0/components/prism-jsx.js?no-check"; -import "https://esm.sh/prismjs@1.27.0/components/prism-tsx.js?no-check"; -import "https://esm.sh/prismjs@1.27.0/components/prism-typescript.js?no-check"; +interface DenoGfm { + render: ( + content: string, + options: { + allowIframes: boolean; + allowMath: boolean; + disableHtmlSanitization: boolean; + }, + ) => string; + KATEX_CSS: string; + CSS: string; +} +let denoGfm: Promise | null = null; +const importDenoGfm = async (): Promise => { + const gfmVersion = `0.9.0`; + try { + const gfm = await import(`jsr:@deno/gfm@${gfmVersion}`); + return gfm; + } catch (err) { + return { + render: () => `could not dynamic load @deno/gfm@${gfmVersion} ${err}`, + KATEX_CSS: "", + CSS: "", + }; + } +}; export const Markdown = async (path: string) => { - const content = await fetch(path).then((res) => res.text()); + denoGfm ??= importDenoGfm(); + const { CSS, KATEX_CSS, render } = await denoGfm; + const content = await fetch(path) + .then((res) => res.text()) + .catch(() => `Could not fetch README.md for ${path}`); return () => { return ( @@ -14,7 +39,6 @@ export const Markdown = async (path: string) => { + +
+ Clique e veja! + + + ); +} diff --git a/ra-trustvox/components/TrustvoxShelfRate.tsx b/ra-trustvox/components/TrustvoxShelfRate.tsx new file mode 100644 index 000000000..3db21cc6a --- /dev/null +++ b/ra-trustvox/components/TrustvoxShelfRate.tsx @@ -0,0 +1,31 @@ +interface Props { + /** + * @ignore + */ + productId: string; +} + +export default function TrustvoxShelfRate({ productId }: Props) { + return ( + <> + +
+ + ); +} diff --git a/ra-trustvox/manifest.gen.ts b/ra-trustvox/manifest.gen.ts new file mode 100644 index 000000000..860c4dc36 --- /dev/null +++ b/ra-trustvox/manifest.gen.ts @@ -0,0 +1,23 @@ +// DO NOT EDIT. This file is generated by deco. +// This file SHOULD be checked into source version control. +// This file is automatically updated during development when running `dev.ts`. + +import * as $$$$$$0 from "./sections/TrustvoxCertificate.tsx"; +import * as $$$$$$1 from "./sections/TrustvoxProductReviews.tsx"; +import * as $$$$$$2 from "./sections/TrustvoxRateConfig.tsx"; +import * as $$$$$$3 from "./sections/TrustvoxStoreReviewsCarousel.tsx"; + +const manifest = { + "sections": { + "ra-trustvox/sections/TrustvoxCertificate.tsx": $$$$$$0, + "ra-trustvox/sections/TrustvoxProductReviews.tsx": $$$$$$1, + "ra-trustvox/sections/TrustvoxRateConfig.tsx": $$$$$$2, + "ra-trustvox/sections/TrustvoxStoreReviewsCarousel.tsx": $$$$$$3, + }, + "name": "ra-trustvox", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/ra-trustvox/mod.ts b/ra-trustvox/mod.ts new file mode 100644 index 000000000..c0a42d82b --- /dev/null +++ b/ra-trustvox/mod.ts @@ -0,0 +1,46 @@ +import { PreviewContainer } from "../utils/preview.tsx"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { type App, type AppContext as AC } from "@deco/deco"; +export interface State { + /** + * @title Store ID + * @description Store ID available on the Trustvox dashboard. + */ + storeId: string; + /** + * @title Number of reviews in store carousel. + * @description Number of reviews that should appear in the store carousel widget. + * @default 7 + */ + numberOfReviewsInStoreCarousel?: number; + /** + * @title Enable the staging environment. + * @description When enabling the testing environment, the store id must be replaced with a store id from a Trustvox testing environment store. + * @default false + */ + enableStaging?: boolean; +} +/** + * @title RA Trustvox + * @description RA trustvox reviews. + * @category Review + * @logo https://raw.githubusercontent.com/trustvox/deco-apps/enhancement/trustvox-app/ra-trustvox/ra-trustvox.png + */ +export default function RATrustvox(state: State): App { + return { manifest, state }; +} +export type AppContext = AC>; +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "RA Trustvox", + owner: "deco.cx", + description: "RA trustvox reviews.", + logo: + "https://raw.githubusercontent.com/trustvox/deco-apps/enhancement/trustvox-app/ra-trustvox/ra-trustvox.png", + images: [], + tabs: [], + }, + }; +}; diff --git a/ra-trustvox/ra-trustvox.png b/ra-trustvox/ra-trustvox.png new file mode 100644 index 000000000..16be38dcc Binary files /dev/null and b/ra-trustvox/ra-trustvox.png differ diff --git a/ra-trustvox/sections/TrustvoxCertificate.tsx b/ra-trustvox/sections/TrustvoxCertificate.tsx new file mode 100644 index 000000000..3f6b24a62 --- /dev/null +++ b/ra-trustvox/sections/TrustvoxCertificate.tsx @@ -0,0 +1,15 @@ +import { AppContext } from "../mod.ts"; +import { type SectionProps } from "@deco/deco"; +export default function TrustvoxCertificate( + { enableStaging = false }: SectionProps, +) { + const scriptUrl = enableStaging + ? "https://storage.googleapis.com/trustvox-certificate-widget-staging/widget.js" + : "https://certificate.trustvox.com.br/widget.js"; + return + + +`; + } catch (error) { + console.error("Failed to read HTML template:", error); + return generateFallbackPage({ workspace, user, callbackUrl }); + } + + const processedHtml = htmlTemplate + .replace("{{WORKSPACE_DATA}}", JSON.stringify(workspace)) + .replace("{{USER_DATA}}", JSON.stringify(user)) + .replace("{{CALLBACK_URL}}", JSON.stringify(callbackUrl)) + .replace("{{WORKSPACE_NAME}}", workspace.name) + .replace("{{WORKSPACE_DOMAIN}}", workspace.domain || "") + .replace("{{USER_NAME}}", user.real_name || user.name); + + return processedHtml; +} + +function generateFallbackPage( + { workspace, user, callbackUrl }: SelectionPageOptions, +): string { + return ` + + + + + MCP Connector - Slack Access + + + +
+

MCP Connector - Slack Access

+

Template file not found. Using fallback interface.

+

Connected to workspace: ${workspace.name}

+

User: ${user.real_name || user.name}

+
+ + +
+
+ +`; +} diff --git a/slack/utils/ui-templates/selection-page.template.html b/slack/utils/ui-templates/selection-page.template.html new file mode 100644 index 000000000..45913ac1c --- /dev/null +++ b/slack/utils/ui-templates/selection-page.template.html @@ -0,0 +1,642 @@ + + + + + + + MCP Connector - Slack Access + + + + + + + + diff --git a/smarthint/README.md b/smarthint/README.md new file mode 100644 index 000000000..ecd171b97 --- /dev/null +++ b/smarthint/README.md @@ -0,0 +1,70 @@ +The search and recommendation system that enhances the experience in your online store. + +Loaders and actions for adding SmartHint to your website. + +SmartHint is an e-commerce search and recommendation system that uses artificial intelligence to elevate the online shopping experience. + +It consists of smart search, pages of departments/categories and recommendation showcases. + +To access the SmartHint account data or register, go to the [admin panel](https://admin.smarthint.co/) + +## Installation + +- Install via decohub +- Fill the necessary fields: + - shcode + - cluster + - Public store URL +- Fill the optional fields (If you will use SmartHint to load category page results) + - Category Tree (You can use a your platform category loader or fill it manually) + +🎉 Your SmartHint setup is complete. You should now see SmartHint +loaders/actions available for your sections. + +## Admin setup + +
+ Admin setup +
    +
  • 1. Add SmarthintTracking section on Global Section in your site configs
  • +
  • 2. Configure autocomplete/search on pages that has a searchbar
  • +
  • 3. Configure the SearchResult and Seo section on your Search/Hotsite/Category pages
  • +
+
+ + +## Dev setup + +
+ Dev setup +
    +
  • 1. Create a section that receive SmarthintRecommendation[] | null and render your Shelf Sections
  • +
  • 2. Create a section that receive Banner[] | null To render Search/Hotsite/Category banners
  • +
  • 3. If your store use the useAutocomplete as search function, change to the SmartHint one
  • +
  • 4. Call the <SmarthintSendEventOnClick> on your Product Card component on SmartHint shelves or SmartHint Search/Hotsite/Category pages +
      +
      + Analytics Props +
        +
      • id: the product card element id
      • +
      • event: +
        +                {
        +                  position // the index of product on Shelf/SearchResult,
        +                  productGroupID // the product group id,
        +                  productPrice // the product price,
        +                  clickProduct // the url of product,
        +                  clickFeature // the recommendation name (nameRecommendation) or SearchWithResult if a category/search/hotsite page,
        +                  positionRecommendation // the position of recommendation (position) or '0' if category/search/hotsite page,
        +                }
        +              
        +
      • +
      +
      +
    +
  • +
+
+ + + diff --git a/smarthint/actions/click.ts b/smarthint/actions/click.ts new file mode 100644 index 000000000..61b7c3f3e --- /dev/null +++ b/smarthint/actions/click.ts @@ -0,0 +1,69 @@ +import { AppContext } from "../mod.ts"; +import { getSessionCookie } from "../utils/getSession.ts"; +import { PageType } from "../utils/typings.ts"; + +export interface Props { + shippingPrice?: number; + shippingTime?: number; + /** + * @description Type of page you are setting up. + */ + pageType: PageType; + date?: string; + elapsedTime?: number; + productPrice: number; + clickFeature: string; + term: string; + position: number; + productGroupID: string; + clickProduct: string; + positionRecommendation: string; +} + +/** + * @title SmartHint Integration + * @description Pageview Click Event + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { recs, shcode } = ctx; + const { + shippingPrice, + shippingTime, + pageType, + date, + productPrice, + clickFeature, + term, + position, + productGroupID, + positionRecommendation, + clickProduct, + } = props; + + const url = new URL(req.url); + const { anonymous, session } = getSessionCookie(req.headers); + + await recs["GET /track/click"]({ + date, + origin: url.origin, + shcode, + session, + pageType, + term, + position: String(position), + productId: productGroupID, + productPrice: String(productPrice), + shippingTime: String(shippingTime), + shippingPrice: String(shippingPrice), + anonymousConsumer: anonymous, + clickProduct, + clickFeature, + locationRecs: positionRecommendation, + }); +}; + +export default action; diff --git a/smarthint/actions/pageview.ts b/smarthint/actions/pageview.ts new file mode 100644 index 000000000..7a865e8f2 --- /dev/null +++ b/smarthint/actions/pageview.ts @@ -0,0 +1,54 @@ +import { AppContext } from "../mod.ts"; +import { getSessionCookie } from "../utils/getSession.ts"; +import { PageType } from "../utils/typings.ts"; + +export interface Props { + shippingPrice: number; + shippingTime: number; + /** + * @description Type of page you are setting up. + */ + pageType: PageType; + date: string; + elapsedTime: number; + productPrice: number; +} + +/** + * @title SmartHint Integration + * @description Pageview Event + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { recs, shcode } = ctx; + const { + shippingPrice, + shippingTime, + pageType, + date, + elapsedTime, + productPrice, + } = props; + + const url = new URL(req.url); + const { anonymous, session } = getSessionCookie(req.headers); + + await recs["GET /track/pageView"]({ + url: req.url, + date, + origin: url.origin, + shcode, + session, + pageType, + elapsedTime: String(elapsedTime), + productPrice: String(productPrice), + shippingTime: String(shippingTime), + shippingPrice: String(shippingPrice), + anonymousConsumer: anonymous, + }); +}; + +export default action; diff --git a/smarthint/components/Click.tsx b/smarthint/components/Click.tsx new file mode 100644 index 000000000..899a3efba --- /dev/null +++ b/smarthint/components/Click.tsx @@ -0,0 +1,31 @@ +import { scriptAsDataURI } from "../../utils/dataURI.ts"; +import { Props as ClickProps } from "../actions/click.ts"; + +export const SmarthintSendEventOnClick = ({ + event, + id, +}: { + event: Omit; + id: string; +}) => ( + +
+ + { + /* Reels e Info + */ + } +
+
+
+
+
+ Video Commerce StreamShop +
+

+ + Incorpore Reels interativos no seu ecommerce ou distribua + por whatsapp 🚀 + +

+

+ + + O Video Commerce da StreamShop é uma solução inovadora de + simples implementação que eleva a experiência dos seus + clientes com a sua marca. + + Incorpore os vídeos que você já produz para as redes + sociais às páginas do seu site ou distribua por whatsapp, + oferecendo muito mais conteúdo e interatividade para seus + consumidores. + +
‍ +
+
+ + Eleve a conversão de suas vendas. Abra a sua conta! + +
+
+
‍ +
+ + Clique nos videos e experimente! + +

+
+
+ +
+
+
+
+
+ + + ); +} diff --git a/streamshop/components/ui/StreamshopSection.tsx b/streamshop/components/ui/StreamshopSection.tsx new file mode 100644 index 000000000..818a7a189 --- /dev/null +++ b/streamshop/components/ui/StreamshopSection.tsx @@ -0,0 +1,86 @@ +import { JSX } from "preact"; +import { clx } from "../../sdk/clx.ts"; + +export interface Props { + /** @description Section title */ + title?: string; + + /** @description See all link */ + cta?: string; +} + +function Header({ title, cta }: Props) { + if (!title) { + return null; + } + + return ( +
+ {title} + {cta && ( + + See all + + )} +
+ ); +} + +interface Tab { + title: string; +} + +function Tabbed( + { children }: { + children: JSX.Element; + }, +) { + return ( + <> + {children} + + ); +} + +function Container({ class: _class, ...props }: JSX.IntrinsicElements["div"]) { + return ( +
+ ); +} + +function Placeholder( + { height, class: _class }: { height: string; class?: string }, +) { + return ( +
+ +
+ ); +} + +function Section() {} + +Section.Container = Container; +Section.Header = Header; +Section.Tabbed = Tabbed; +Section.Placeholder = Placeholder; + +export default Section; diff --git a/streamshop/manifest.gen.ts b/streamshop/manifest.gen.ts new file mode 100644 index 000000000..8a09a6a04 --- /dev/null +++ b/streamshop/manifest.gen.ts @@ -0,0 +1,29 @@ +// DO NOT EDIT. This file is generated by deco. +// This file SHOULD be checked into source version control. +// This file is automatically updated during development when running `dev.ts`. + +import * as $$$$$$0 from "./sections/Banner.tsx"; +import * as $$$$$$1 from "./sections/Carousel.tsx"; +import * as $$$$$$2 from "./sections/Embed.tsx"; +import * as $$$$$$3 from "./sections/Info&Reels.tsx"; +import * as $$$$$$4 from "./sections/Reels.tsx"; +import * as $$$$$$5 from "./sections/Stories.tsx"; +import * as $$$$$$6 from "./sections/Widget.tsx"; + +const manifest = { + "sections": { + "streamshop/sections/Banner.tsx": $$$$$$0, + "streamshop/sections/Carousel.tsx": $$$$$$1, + "streamshop/sections/Embed.tsx": $$$$$$2, + "streamshop/sections/Info&Reels.tsx": $$$$$$3, + "streamshop/sections/Reels.tsx": $$$$$$4, + "streamshop/sections/Stories.tsx": $$$$$$5, + "streamshop/sections/Widget.tsx": $$$$$$6, + }, + "name": "streamshop", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/streamshop/mod.ts b/streamshop/mod.ts new file mode 100644 index 000000000..053785cb3 --- /dev/null +++ b/streamshop/mod.ts @@ -0,0 +1,37 @@ +import type { App, FnContext } from "@deco/deco"; +import { PreviewContainer } from "./components/ui/Preview.tsx"; +import manifest, { Manifest } from "./manifest.gen.ts"; + +// deno-lint-ignore ban-types +export type State = {}; +export type AppContext = FnContext; + +/** + * @title Video Commerce - Stream shop + * @description Integration of streamshop services. + * @category Tools + * @logo https://cdn.prod.website-files.com/6445b237edd0d4b3293ec173/6707f86b939ac3eaea62fe44_SSHOP_AVATAR%20copy%202.png + */ +export default function App(state: State): App { + return { manifest, state }; +} + +// It is important to use the same name as the default export of the app +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Video Commerce", + owner: "StreamShop Technologies", + description: "Powered by StreamShop", + logo: + "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAA8FBMVEWbkdCkjcqsicS1hb6+gbjGfbPPea3VdqjYd6XaeKHdeZ7gepvie5jle5XofJHqfY7tfovwf4jygIXzgoLzhIDzhn7ziHzzinrzjHjzjnbzkHTzknLbeprVhqThg5fccJjdqsLz8/j////k1N/Tk6nZcZ3mtcjttcPsnav98PHikKvhcpLpb4LqwdLs4+zeg5LWlLzt4efnjIzDc67ixNruv83zwMf5z8/rzt/SaqHyd3jzjI3ei5Dw3OjbkJfdttHbnaTYpsfcqrLdt7/OhLPnoLbexMz83t27erX5x8X4urn2ravi1un1n5zQq87Rhq/xiwRQAAABEElEQVR4AaXS06IDMRAA0Nq228wWa29tu///NTWSa8zrCUYmk9litdkdTpfb4/X5A8FQOBKNxRPJVDqT/Tnm8vnCJ1gsIQCq/CFWqlAr0Awqf3gTWM4f4Bkq/B6dgli8ZESDFImSKIsiIPESCigKpeKo6agqGIZRv0YDSGw2W5Wil7vW2e5Al8CeXsGaAH0CxQHWoTYMCUSjC3IPHBMI8hlzg9wNmQmJ0zPOQCz5rzgn6gTHFQHE4BkXFI7yAxn6crNBxV+4HKHWFWf89c+VguMAtbBso2vUwVAXW/gmbJCKYXNL4A4+x/YF8Wz308Mhn8+zbEGSaCDq1EaAxypGbkLrPLIix/E8H2m3v9zb/+MJLe5Gr8K2TA8AAAAASUVORK5CYII=", + images: [ + "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/streamshop/e4ce0dd4-1213-4671-acb6-c2d366390d5d/1.png", + "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/streamshop/34d3586f-995c-4354-ba52-7e10ef89219f/2.png", + "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/streamshop/dc2b7628-4b5f-425e-88ef-b79f79096f48/3.png", + ], + tabs: [], + }, + }; +}; diff --git a/streamshop/sdk/clx.ts b/streamshop/sdk/clx.ts new file mode 100644 index 000000000..4745715bf --- /dev/null +++ b/streamshop/sdk/clx.ts @@ -0,0 +1,3 @@ +/** filter out nullable values, join and minify class names */ +export const clx = (...args: (string | null | undefined | false)[]) => + args.filter(Boolean).join(" ").replace(/\s\s+/g, " "); diff --git a/streamshop/sections/Banner.tsx b/streamshop/sections/Banner.tsx new file mode 100644 index 000000000..75db69352 --- /dev/null +++ b/streamshop/sections/Banner.tsx @@ -0,0 +1,138 @@ +import { type HTMLWidget, type ImageWidget } from "../../admin/widgets.ts"; +import { Picture, Source } from "../../website/components/Picture.tsx"; +import { clx } from "../sdk/clx.ts"; +import Section from "../components/ui/StreamshopSection.tsx"; + +export interface Props { + /** + * @title Título + */ + title?: string; + /** + * @title Descrição + */ + description?: HTMLWidget; + + /** + * @title Imagens + */ + images: { + mobile?: { + width: number; + height: number; + src: ImageWidget; + }; + desktop?: { + width: number; + height: number; + src: ImageWidget; + }; + }; + + /** + * @title Botões + */ + cta?: { + href: string; + label: string; + }; + /** + * @title Link + */ + link?: string; + + /** + * @title Container + * @description 100% do site ou container + */ + containerWidth?: "container" | "full"; +} + +/** + * @title StreamShop Banner + */ +export default function Banner( + { + title = "Title", + description = "Exemple of description", + images, + cta = { href: "/", label: "Click me!" }, + containerWidth, + link, + }: Props, +) { + return ( + +
+ {images?.desktop?.src + ? ( + + {images?.mobile && ( + + )} + {images?.desktop && ( + + )} + {title} + + ) + : ( +
+
+ )} + +
+ {title && {title} + } + {description && ( + + )} +
+ {cta && ( + + {cta.label} + + )} +
+
+
+
+ ); +} + +export const LoadingFallback = () => ; diff --git a/streamshop/sections/Carousel.tsx b/streamshop/sections/Carousel.tsx new file mode 100644 index 000000000..62b42b414 --- /dev/null +++ b/streamshop/sections/Carousel.tsx @@ -0,0 +1,162 @@ +import { clx } from "../sdk/clx.ts"; +import Section, { + Props as SectionHeaderProps, +} from "../components/ui/StreamshopSection.tsx"; +import { type LoadingFallbackProps } from "@deco/deco"; +import { useDevice } from "@deco/deco/hooks"; + +interface StyleDesktop { + /** + * @title Altura do vídeo + * @desription px ou % + */ + videoHeigth?: string; + + /** + * @title Largura do vídeo + * @desription px ou % + */ + videoWidth?: string; +} + +interface StyleMobile { + /** + * @title Altura do vídeo + * @desription px ou % + */ + videoHeigth?: string; + + /** + * @title Largura do vídeo + * @desription px ou % + */ + videoWidth?: string; +} + +interface Style { + /** + * @title Container + * @description 100% do site ou container + */ + containerWidth?: "container" | "full"; + + /** + * @title Arredondamento dos cantos + */ + radius?: "pequeno" | "médio" | "grande" | "pílula"; + + /** + * @title Desktop + */ + styleDesktop?: StyleDesktop; + + /** + * @title Mobile + */ + styleMobile?: StyleMobile; +} + +interface Props extends SectionHeaderProps { + /** + * @title Slug dos videos + */ + slugs: string[]; + + /** + * @title Estilo + */ + style: Style; +} + +/** + * @title StreamShop Carousel Video + */ +export default function Carousel({ + title = "Title", + cta, + slugs = [ + "lnSWxBFj", + "E5hUMpXl", + "o8GbO1r7", + "g31wys57", + "4J8mqGAD", + "Q41wyj80", + "NJ6WxSZp", + "lCx1dr89", + "ZI2NBKS7", + "ximkLtuV", + "AG6Fhvn0", + "YLohX8FM", + "lUwLnDpx", + "5ur2WIIU", + "PdfbAvpP", + ], + style = { + styleDesktop: { + videoWidth: "300px", + videoHeigth: "500px", + }, + }, +}: Props) { + const device = useDevice(); + const currentStyle = device == "desktop" + ? style.styleDesktop + : style.styleMobile; + return ( + <> + + + +
+ +
+ +
+ {/* @ts-ignore */} + + {/* @ts-ignore */} + +
+
+ + ); +} + +export const LoadingFallback = ( + { title, cta }: LoadingFallbackProps, +) => ( + + + ; + +); diff --git a/streamshop/sections/Embed.tsx b/streamshop/sections/Embed.tsx new file mode 100644 index 000000000..73e565723 --- /dev/null +++ b/streamshop/sections/Embed.tsx @@ -0,0 +1,27 @@ +interface Props { + /** + * @title Slugs á serem exibidos + */ + slugs?: string[]; +} + +/** + * @title StreamShop Embed + */ +export default function Stories( + { slugs = ["YW9HwZbU", "hOok12Xu", "9zCcxtSH", "CS2UU3tJ"] }: Props, +) { + return ( +
+ +
+ ); +} diff --git a/streamshop/sections/Info&Reels.tsx b/streamshop/sections/Info&Reels.tsx new file mode 100644 index 000000000..f6f16ca47 --- /dev/null +++ b/streamshop/sections/Info&Reels.tsx @@ -0,0 +1,82 @@ +import Section, { + Props as SectionHeaderProps, +} from "../components/ui/StreamshopSection.tsx"; +import { type LoadingFallbackProps } from "@deco/deco"; + +interface Props extends SectionHeaderProps { + /** + * @title Slug da sua loja + * @description Slug da sua loja, não de videos únicos + */ + storeSlug?: string; + + /** + * @title Tamanho + */ + size?: { + width: string; + height: string; + }; + + /** + * @title Texto + * @format html + */ + text: string; +} + +/** + * @title StreamShop Info & Stories + */ +export default function InfoStories( + { + title, + cta, + storeSlug, + size = { width: "300px", height: "500px" }, + text = `
+
Video Commerce StreamShop
+

Incorpore vídeos interativos no seu ecommerce e eleve sua taxa de conversão!

+

O Video Commerce da StreamShop é uma solução inovadora de simples implementação que eleva a experiência dos seus clientes com a sua marca.

Incorpore os vídeos que você já produz para as redes sociais às páginas do seu site, oferecendo muito mais conteúdo e interatividade para seus consumidores.

Seu ecommerce não pode esperar. Assine agora!

+
`, + }: Props, +) { + return ( + <> + + +
+
+
+ +
+ +
+
+
+ + ); +} + +export const LoadingFallback = ( + { title, cta }: LoadingFallbackProps, +) => ( + + + ; + +); diff --git a/streamshop/sections/Reels.tsx b/streamshop/sections/Reels.tsx new file mode 100644 index 000000000..2132bdee4 --- /dev/null +++ b/streamshop/sections/Reels.tsx @@ -0,0 +1,28 @@ +interface Props { + /** + * @title Slug da sua loja + */ + storeSlug?: string; +} + +/** + * @title StreamShop Reels + */ +export default function Stories({ storeSlug = "streamshopdemo" }: Props) { + return ( +
+ +
+ ); +} diff --git a/streamshop/sections/Stories.tsx b/streamshop/sections/Stories.tsx new file mode 100644 index 000000000..173a27c3b --- /dev/null +++ b/streamshop/sections/Stories.tsx @@ -0,0 +1,76 @@ +import Section, { + Props as SectionHeaderProps, +} from "../components/ui/StreamshopSection.tsx"; +import { type LoadingFallbackProps } from "@deco/deco"; + +interface Props extends SectionHeaderProps { + /** + * @title Slug Videos + */ + slugs: string[]; +} + +/** + * @title StreamShop Stories + */ +export default function Stories({ + title = "Stories", + cta = "See all", + slugs = [ + "lnSWxBFj", + "E5hUMpXl", + "o8GbO1r7", + "g31wys57", + "4J8mqGAD", + "Q41wyj80", + "NJ6WxSZp", + "lCx1dr89", + "ZI2NBKS7", + "ximkLtuV", + "AG6Fhvn0", + "YLohX8FM", + "lUwLnDpx", + "5ur2WIIU", + "PdfbAvpP", + ], +}: Props) { + return ( + <> + + + + + +
+ {/* @ts-ignore */} + + {/* @ts-ignore */} + +
+
+ + ); +} + +export const LoadingFallback = ( + { title, cta }: LoadingFallbackProps, +) => ( + + + ; + +); diff --git a/streamshop/sections/Widget.tsx b/streamshop/sections/Widget.tsx new file mode 100644 index 000000000..d3a1391d4 --- /dev/null +++ b/streamshop/sections/Widget.tsx @@ -0,0 +1,157 @@ +import { useScript } from "@deco/deco/hooks"; + +interface WidgetOptions { + /** + * @title Link ao vivo + * @description URL do link ao vivo que será exibido no widget. + */ + live: string; + + /** + * @title Imagem de fundo + * @description Define uma imagem de fundo para o botão. Aceita formatos jpeg, jpg, png ou gif. + */ + bg?: string; + + /** + * @title Posição horizontal + * @description Define a posição horizontal do botão. Opções: "left" ou "right" (padrão: "right"). + */ + positionX?: "left" | "right"; + + /** + * @title Posição vertical + * @description Define a posição vertical do botão. Opções: "up" ou "down" (padrão: "down"). + */ + positionY?: "up" | "down"; + + /** + * @title Espaço horizontal + * @description Define o espaço horizontal relativo à tela em pixels (padrão: 30). + */ + sizePositionX?: number; + + /** + * @title Espaço vertical + * @description Define o espaço vertical relativo à tela em pixels (padrão: 30). + */ + sizePositionY?: number; + + /** + * @title Altura do botão + * @description Altura do botão em pixels (padrão: 70). + */ + height?: number; + + /** + * @title Largura do botão + * @description Largura do botão em pixels (padrão: 70). + */ + width?: number; + + /** + * @title Animação do botão + * @description Define se a animação do botão deve estar ativa. Defina como false para desativar (padrão: true). + */ + animation?: boolean; + + /** + * @title Raio da borda + * @description Define o raio da borda do botão em pixels (padrão: 999). + */ + borderRadius?: number; + + /** + * @title Modo de exibição + * @description Define o modo de exibição em tela cheia. Opções: "side" ou "cinema" (padrão: "side"). + */ + display?: "side" | "cinema"; +} + +interface Props { + /** + * @title Opções do widget + * @description Configurações personalizadas para o widget do StreamShop. + */ + options?: WidgetOptions; +} + +// deno-lint-ignore no-explicit-any +declare const ss_widget_btn: (options: any) => void; + +const serviceWorkerScript = ( + { + live, + bg, + positionX, + positionY, + sizePositionX, + sizePositionY, + height, + width, + animation, + borderRadius, + display, + }: WidgetOptions, +) => + addEventListener("load", () => { + console.log("Running on load - StreamShop Widget"); + const liveshopSdkWidgetOptions = { + live, + bg, + positionX: positionX || "right", + positionY: positionY || "down", + sizePositionX: sizePositionX || 30, + sizePositionY: sizePositionY || 30, + height: height || 70, + width: width || 70, + animation: animation !== undefined ? animation : true, + borderRadius: borderRadius || 999, + display: display || "side", + }; + + // Core Script (do not touch) + (function (_i: Window, s: Document, o: string, g: string): void { + const p = new Promise(function (rs) { + return rs(); + }); + const a = s.createElement(o) as HTMLScriptElement; + const m = s.getElementsByTagName(o)[0]; + a.async = true; + a.src = g; + a.onload = function () { + return p.then(function () { + return ss_widget_btn(liveshopSdkWidgetOptions); + }); + }; + m.parentNode?.insertBefore(a, m); + })( + window, + document, + "script", + "https://assets.streamshop.com.br/sdk/liveshop-sdk-widget-btn.min.js", + ); + }); + +/** + * @title StreamShop Widget + * @description Componente que integra o widget do StreamShop ao site, exibindo uma transmissão ao vivo configurável. + */ +export default function Widget({ + options = { + live: "https://lite.streamshop.com.br/streamshopdemo", + bg: + "https://images.crunchbase.com/image/upload/c_pad,f_auto,q_auto:eco,dpr_1/mzolsyhormiy7fvz6dgp", + }, +}: Props) { + return ( + <> + + + ); +} + +export default Slider; diff --git a/utils/cookie.ts b/utils/cookie.ts index 15315207e..6a37c72d9 100644 --- a/utils/cookie.ts +++ b/utils/cookie.ts @@ -1,12 +1,32 @@ -import { getSetCookies, setCookie } from "std/http/cookie.ts"; - +import { getCookies, getSetCookies, setCookie } from "std/http/cookie.ts"; +import { DECO_SEGMENT, type Flag } from "@deco/deco"; +import { tryOrDefault } from "@deco/deco/utils"; +export const getFlagsFromRequest = (req: Request) => { + const cookies = getCookies(req.headers); + return getFlagsFromCookies(cookies); +}; +export const getFlagsFromCookies = (cookies: Record) => { + const flags: Flag[] = []; + const segment = cookies[DECO_SEGMENT] + ? tryOrDefault( + () => JSON.parse(decodeURIComponent(atob(cookies[DECO_SEGMENT]))), + {}, + ) + : {}; + segment.active?.forEach((flag: string) => + flags.push({ name: flag, value: true }) + ); + segment.inactiveDrawn?.forEach((flag: string) => + flags.push({ name: flag, value: false }) + ); + return flags; +}; export const proxySetCookie = ( from: Headers, to: Headers, toDomain?: URL | string, ) => { const newDomain = toDomain && new URL(toDomain); - for (const cookie of getSetCookies(from)) { const newCookie = newDomain ? { @@ -14,7 +34,6 @@ export const proxySetCookie = ( domain: newDomain.hostname, } : cookie; - setCookie(to, newCookie); } }; diff --git a/utils/dataURI.ts b/utils/dataURI.ts index c2262d4f2..f9760a8ff 100644 --- a/utils/dataURI.ts +++ b/utils/dataURI.ts @@ -1,16 +1,31 @@ +let once = true; + +// Avoid throwing DOM Exception: +// The string to be encoded contains characters outside of the Latin1 range. +const btoaSafe = (x: string) => + btoa(`decodeURIComponent(escape(${unescape(encodeURIComponent(x))}))`); + // deno-lint-ignore no-explicit-any export const scriptAsDataURI = any>( fn: T, ...params: Parameters -) => - dataURI( +) => { + if (once) { + once = false; + console.warn( + `scriptAsDataURI is deprecated and will soon be removed. Use import { useScriptAsDataURI } from 'deco/hooks/useScript.ts' instead.`, + ); + } + + return dataURI( "text/javascript", true, `(${fn})(${params.map((p) => JSON.stringify(p)).join(", ")})`, ); +}; export const dataURI = ( contentType: "text/javascript", base64: boolean, content: string, -) => `data:${contentType}${base64 ? `;base64,${btoa(content)}` : content}`; +) => `data:${contentType}${base64 ? `;base64,${btoaSafe(content)}` : content}`; diff --git a/utils/defaultErrorPage.tsx b/utils/defaultErrorPage.tsx new file mode 100644 index 000000000..64c7498ad --- /dev/null +++ b/utils/defaultErrorPage.tsx @@ -0,0 +1,185 @@ +import { Head } from "$fresh/runtime.ts"; + +type Props = { + error?: string; +}; + +const Squares = () => ( + <> + + +
+
+
+
+
+ +
+

{name}

+

by {owner}

+
+
+

+ {description} +

+
+
+ {images.length > 0 && ( +
+
+ {images.length > 1 && ( +
+ + + +
+ )} + + {images.map((image, index) => { + return ( + + + + ); + })} + + {images.length > 1 && ( +
+ + + +
+ )} +
+ + +
+ )} +
+
+ {tabs?.map((tab, idx) => { + return ( +
+ + {tab.title} + +
+ {tab.content} +
+
+ ); + })} + {(tabs?.length || 0) > 0 && ( +
+
+ )} + +
+
+ +
+ ); +} + +const ArrowSvg = () => ( + + + +); diff --git a/utils/shortHash.ts b/utils/shortHash.ts new file mode 100644 index 000000000..172e4bc36 --- /dev/null +++ b/utils/shortHash.ts @@ -0,0 +1,21 @@ +export async function hashString(input: string): Promise { + const encoder = new TextEncoder(); + const data = encoder.encode(input); + + const hashBuffer = await crypto.subtle.digest("SHA-256", data); + const hashArray = Array.from(new Uint8Array(hashBuffer)); + + const hashHex = hashArray.map((byte) => byte.toString(16).padStart(2, "0")) + .join(""); + return hashHex.slice(0, 8); +} + +export function hashStringSync(input: string): string { + let hash = 0; + for (let i = 0; i < input.length; i++) { + const char = input.charCodeAt(i); + hash = ((hash << 5) - hash) + char; + hash |= 0; // Convert to 32-bit integer + } + return hash.toString(16).slice(0, 8); +} diff --git a/utils/weakcache.ts b/utils/weakcache.ts new file mode 100644 index 000000000..59ba9e877 --- /dev/null +++ b/utils/weakcache.ts @@ -0,0 +1 @@ +export * as weakcache from "npm:weak-lru-cache@1.0.0"; diff --git a/verified-reviews/loaders/productDetailsPage.ts b/verified-reviews/loaders/productDetailsPage.ts index 917afa83a..dd7278444 100644 --- a/verified-reviews/loaders/productDetailsPage.ts +++ b/verified-reviews/loaders/productDetailsPage.ts @@ -6,7 +6,10 @@ import { getProductId, PaginationOptions, } from "../utils/client.ts"; -export type Props = PaginationOptions; + +export type Props = PaginationOptions & { + aggregateSimilarProducts?: boolean; +}; /** * @title Opiniões verificadas - Full Review for Product (Ratings and Reviews) @@ -17,18 +20,24 @@ export default function productDetailsPage( ctx: AppContext, ): ExtensionOf { const client = createClient({ ...ctx }); + return async (productDetailsPage: ProductDetailsPage | null) => { - if (!productDetailsPage) { + if (!productDetailsPage || !client) { return null; } - if (!client) { - return null; + const productId = getProductId(productDetailsPage.product); + let productsToGetReviews = [productId]; + + if (config.aggregateSimilarProducts) { + productsToGetReviews = [ + productId, + ...productDetailsPage.product.isSimilarTo?.map(getProductId) ?? [], + ]; } - const productId = getProductId(productDetailsPage.product); const fullReview = await client.fullReview({ - productId, + productId: productsToGetReviews, count: config?.count, offset: config?.offset, order: config?.order, diff --git a/verified-reviews/loaders/productList.ts b/verified-reviews/loaders/productList.ts index 3e9c9315b..b576646d8 100644 --- a/verified-reviews/loaders/productList.ts +++ b/verified-reviews/loaders/productList.ts @@ -1,7 +1,7 @@ import { AppContext } from "../mod.ts"; -import { AggregateRating, Product } from "../../commerce/types.ts"; +import { Product } from "../../commerce/types.ts"; import { ExtensionOf } from "../../website/loaders/extension.ts"; -import { Ratings } from "../utils/types.ts"; +import { getRatingProduct } from "../utils/transform.ts"; import { createClient, getProductId } from "../utils/client.ts"; /** @@ -37,22 +37,3 @@ export default function productList( }); }; } - -const getRatingProduct = ({ - ratings, - productId, -}: { - ratings: Ratings | undefined; - productId: string; -}): AggregateRating | undefined => { - const rating = ratings?.[productId]?.[0]; - if (!rating) { - return undefined; - } - - return { - "@type": "AggregateRating", - ratingCount: Number(rating.count), - ratingValue: Number(parseFloat(rating.rate).toFixed(1)), - }; -}; diff --git a/verified-reviews/loaders/productListingPage.ts b/verified-reviews/loaders/productListingPage.ts new file mode 100644 index 000000000..f04d81670 --- /dev/null +++ b/verified-reviews/loaders/productListingPage.ts @@ -0,0 +1,47 @@ +import { AppContext } from "../mod.ts"; +import { ProductListingPage } from "../../commerce/types.ts"; +import { ExtensionOf } from "../../website/loaders/extension.ts"; +import { + createClient, + getProductId, + PaginationOptions, +} from "../utils/client.ts"; +import { getRatingProduct } from "../utils/transform.ts"; + +export type Props = PaginationOptions; + +/** + * @title Opiniões verificadas - Full Review for Product (Ratings and Reviews) + */ +export default function productListingPage( + _config: unknown, + _req: Request, + ctx: AppContext, +): ExtensionOf { + const client = createClient({ ...ctx }); + return async (page: ProductListingPage | null) => { + if (!page) { + return null; + } + if (!client) { + return page; + } + + const productsIds = page.products.map(getProductId); + const ratings = await client.ratings({ productsIds: productsIds }); + + return { + ...page, + products: page.products.map((product) => { + const productId = getProductId(product); + return { + ...product, + aggregateRating: getRatingProduct({ + ratings, + productId: productId, + }), + }; + }), + }; + }; +} diff --git a/verified-reviews/loaders/productReviews.ts b/verified-reviews/loaders/productReviews.ts new file mode 100644 index 000000000..af332f9de --- /dev/null +++ b/verified-reviews/loaders/productReviews.ts @@ -0,0 +1,33 @@ +import { AppContext } from "../mod.ts"; +import { Review } from "../../commerce/types.ts"; +import { createClient, PaginationOptions } from "../utils/client.ts"; +import { toReview } from "../utils/transform.ts"; + +export type Props = PaginationOptions & { + productId: string | string[]; +}; + +/** + * @title Opiniões verificadas - Full Review for Product (Ratings and Reviews) + */ +export default async function productReviews( + config: Props, + _req: Request, + ctx: AppContext, +): Promise { + const client = createClient({ ...ctx }); + + if (!client) { + return null; + } + + const reviewsResponse = await client.reviews({ + productId: config.productId, + count: config?.count, + offset: config?.offset, + order: config?.order, + }); + + const reviews = reviewsResponse?.[0]; + return reviews?.reviews?.map(toReview) ?? []; +} diff --git a/verified-reviews/loaders/storeReview.ts b/verified-reviews/loaders/storeReview.ts new file mode 100644 index 000000000..c2e29534a --- /dev/null +++ b/verified-reviews/loaders/storeReview.ts @@ -0,0 +1,42 @@ +import { Review } from "../../commerce/types.ts"; +import { AppContext } from "../mod.ts"; +import { createClient } from "../utils/client.ts"; +import { toReview } from "../utils/transform.ts"; + +export type Props = { + /** + * @title Number of reviews + * @default 5 + */ + limit?: number; + /** + * @title Offset + * @default 0 + */ + offset?: number; +}; + +/** + * @title Opiniões verificadas - Full Review for Store (Ratings and Reviews) + */ +export default async function storeReview( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { offset = 0, limit = 5 } = props; + const client = createClient({ ...ctx }); + + if (!client) { + return null; + } + + const reviews = await client.storeReview(); + + if (!reviews) { + return null; + } + + // The API does not have a pagination, so we need to do it here + return reviews.map(toReview).slice(offset, limit); +} diff --git a/verified-reviews/logo.png b/verified-reviews/logo.png new file mode 100644 index 000000000..4f19f17da Binary files /dev/null and b/verified-reviews/logo.png differ diff --git a/verified-reviews/manifest.gen.ts b/verified-reviews/manifest.gen.ts index 47b4dc1e8..8286cc66d 100644 --- a/verified-reviews/manifest.gen.ts +++ b/verified-reviews/manifest.gen.ts @@ -2,13 +2,19 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$0 from "./loaders/productList.ts"; -import * as $$$1 from "./loaders/productDetailsPage.ts"; +import * as $$$0 from "./loaders/productDetailsPage.ts"; +import * as $$$1 from "./loaders/productList.ts"; +import * as $$$2 from "./loaders/productListingPage.ts"; +import * as $$$3 from "./loaders/productReviews.ts"; +import * as $$$4 from "./loaders/storeReview.ts"; const manifest = { "loaders": { - "verified-reviews/loaders/productDetailsPage.ts": $$$1, - "verified-reviews/loaders/productList.ts": $$$0, + "verified-reviews/loaders/productDetailsPage.ts": $$$0, + "verified-reviews/loaders/productList.ts": $$$1, + "verified-reviews/loaders/productListingPage.ts": $$$2, + "verified-reviews/loaders/productReviews.ts": $$$3, + "verified-reviews/loaders/storeReview.ts": $$$4, }, "name": "verified-reviews", "baseUrl": import.meta.url, diff --git a/verified-reviews/mod.ts b/verified-reviews/mod.ts index b082c3519..752b0fc78 100644 --- a/verified-reviews/mod.ts +++ b/verified-reviews/mod.ts @@ -1,18 +1,36 @@ -import type { App, AppContext as AC } from "deco/mod.ts"; +import type { Secret } from "../website/loaders/secret.ts"; import manifest, { Manifest } from "./manifest.gen.ts"; +import { PreviewContainer } from "../utils/preview.tsx"; +import { type App, type AppContext as AC } from "@deco/deco"; export interface ConfigVerifiedReviews { idWebsite: string; - secretKey?: string; + secretKey?: Secret; plateforme?: string; } - /** - * @title App Opiniões Verificadas + * @title Verified Reviews + * @description A specialized solution in the collection of customer reviews + * @category Review + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/verified-reviews/logo.png */ export default function App( state: ConfigVerifiedReviews, ): App { return { manifest, state }; } - export type AppContext = AC>; +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Verified Reviews", + owner: "deco.cx", + description: + "A specialized solution in the collection of customer reviews.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/verified-reviews/logo.png", + images: [], + tabs: [], + }, + }; +}; diff --git a/verified-reviews/utils/client.ts b/verified-reviews/utils/client.ts index 85f9fe988..8ff1b5d67 100644 --- a/verified-reviews/utils/client.ts +++ b/verified-reviews/utils/client.ts @@ -2,21 +2,39 @@ import { fetchAPI } from "../../utils/fetch.ts"; import { Ratings, Reviews, VerifiedReviewsFullReview } from "./types.ts"; import { Product } from "../../commerce/types.ts"; import { ConfigVerifiedReviews } from "../mod.ts"; -import { context } from "deco/live.ts"; - +import { + getRatingProduct, + getWeightedRatingProduct, + toReview, +} from "./transform.ts"; +import { context } from "@deco/deco"; export type ClientVerifiedReviews = ReturnType; - export interface PaginationOptions { count?: number; offset?: number; + // legacy compatible parameters that will map to "orderMap" parameters, but we generally recommend using a custom parameter. order?: | "date_desc" | "date_ASC" | "rate_DESC" | "rate_ASC" - | "helpfulrating_DESC"; + | "helpfulrating_DESC" + | string; + /** + * @description Determines if the order of results should be customized based on the provided parameter. + */ + customizeOrder?: boolean; } +// creating an object to keep backward compatibility +const orderMap = { + date_desc: "date_desc", + date_ASC: "date_asc", + rate_DESC: "rate_desc", + rate_ASC: "rate_asc", + helpfulrating_DESC: "most_helpful", +} as const; + const MessageError = { ratings: "🔴⭐ Error on call ratings of Verified Review - probably unidentified product", @@ -25,29 +43,27 @@ const MessageError = { fullReview: "🔴⭐ Error on call Full Review of Verified Review - probably unidentified product", }; - const baseUrl = "https://awsapis3.netreviews.eu/product"; - export const createClient = (params: ConfigVerifiedReviews | undefined) => { - if (!params) return; - + if (!params) { + return; + } const { idWebsite } = params; - /** @description https://documenter.getpostman.com/view/2336519/SVzw6MK5#338f8f1b-4379-40a2-8893-080fe5234679 */ - const rating = async ({ productId }: { productId: string }) => { + const rating = async ({ productId }: { + productId: string; + }) => { const payload = { query: "average", products: [productId], idWebsite: idWebsite, plateforme: "br", }; - try { const data = await fetchAPI(`${baseUrl}`, { method: "POST", body: JSON.stringify(payload), }); - return Object.keys(data).length ? data : undefined; } catch (error) { if (context.isDeploy) { @@ -58,9 +74,10 @@ export const createClient = (params: ConfigVerifiedReviews | undefined) => { return undefined; } }; - /** @description https://documenter.getpostman.com/view/2336519/SVzw6MK5#6d8ab05a-28b6-48b3-9e8f-6bbbc046619a */ - const ratings = async ({ productsIds }: { productsIds: string[] }) => { + const ratings = async ({ productsIds }: { + productsIds: string[]; + }) => { const payload = { query: "average", products: productsIds, @@ -72,30 +89,38 @@ export const createClient = (params: ConfigVerifiedReviews | undefined) => { method: "POST", body: JSON.stringify(payload), }); - return Object.keys(data).length ? data : undefined; } catch (error) { if (context.isDeploy) { console.error(MessageError.ratings, error); } else { - throw new Error(`${MessageError.ratings} - ${error}`); + console.log(`${MessageError.ratings} - ${error}`); + return undefined; } return undefined; } }; - /** @description https://documenter.getpostman.com/view/2336519/SVzw6MK5#daf51360-c79e-451a-b627-33bdd0ef66b8 */ - const reviews = ({ - productId, - count = 5, - offset = 0, - order = "date_desc", - }: PaginationOptions & { - productId: string; - }) => { + const reviews = ( + { + productId, + count = 5, + offset = 0, + order: _order = "date_desc", + customizeOrder = false, + }: + & PaginationOptions + & { + productId: string | string[]; + }, + ) => { + const order = customizeOrder + ? _order + : orderMap[_order as keyof typeof orderMap]; + const payload = { query: "reviews", - product: productId, + product: Array.isArray(productId) ? productId : [productId], idWebsite: idWebsite, plateforme: "br", offset: offset, @@ -103,7 +128,7 @@ export const createClient = (params: ConfigVerifiedReviews | undefined) => { order: order, }; - return fetchAPI(`${baseUrl}`, { + return fetchAPI(`${baseUrl}`, { method: "POST", body: JSON.stringify(payload), }); @@ -113,46 +138,36 @@ export const createClient = (params: ConfigVerifiedReviews | undefined) => { productId, count = 5, offset = 0, + order, }: PaginationOptions & { - productId: string; + productId: string | string[]; }): Promise => { try { + const isMultiProduct = Array.isArray(productId); + const response = await Promise.all([ - rating({ productId }), - reviews({ productId, count, offset }), + ratings({ + productsIds: isMultiProduct ? productId : [productId], + }), + reviews({ productId, count, offset, order }), ]); - const [responseRating, responseReview] = response.flat() as [ Ratings, Reviews | null, ]; - const currentRating = responseRating?.[productId]?.[0]; + const aggregateRating = isMultiProduct + ? getWeightedRatingProduct(responseRating) + : getRatingProduct({ ratings: responseRating, productId }); + return { - aggregateRating: currentRating + aggregateRating: aggregateRating ? { - "@type": "AggregateRating", - ratingValue: Number(parseFloat(currentRating.rate).toFixed(1)), - reviewCount: Number(currentRating.count), + ...aggregateRating, + stats: responseReview?.stats, } : undefined, - review: responseReview - ? responseReview.reviews?.map((item) => ({ - "@type": "Review", - author: [ - { - "@type": "Person", - name: `${item.firstname} ${item.lastname}`, - }, - ], - datePublished: item.review_date, - reviewBody: item.review, - reviewRating: { - "@type": "AggregateRating", - ratingValue: Number(item.rate), - }, - })) - : [], + review: responseReview ? responseReview.reviews?.map(toReview) : [], }; } catch (error) { if (context.isDeploy) { @@ -166,14 +181,31 @@ export const createClient = (params: ConfigVerifiedReviews | undefined) => { }; } }; - + const storeReview = async (): Promise => { + try { + const response = await fetchAPI( + `https://cl.avis-verifies.com/br/cache/8/6/a/${idWebsite}/AWS/WEBSITE_API/reviews.json`, + { + method: "GET", + }, + ); + return (response ? response : []); + } catch (error) { + if (context.isDeploy) { + console.error(MessageError.ratings, error); + } else { + throw new Error(`${MessageError.ratings} - ${error}`); + } + return null; + } + }; return { rating, ratings, reviews, fullReview, + storeReview, }; }; - export const getProductId = (product: Product) => product.isVariantOf!.productGroupID; diff --git a/verified-reviews/utils/transform.ts b/verified-reviews/utils/transform.ts new file mode 100644 index 000000000..5d34ecab9 --- /dev/null +++ b/verified-reviews/utils/transform.ts @@ -0,0 +1,85 @@ +import { + AggregateRating, + Review as CommerceReview, +} from "../../commerce/types.ts"; +import { Ratings, Review } from "./types.ts"; + +const MAX_RATING_VALUE = 5; +const MIN_RATING_VALUE = 0; + +export const getRatingProduct = ({ + ratings, + productId, +}: { + ratings: Ratings | undefined; + productId: string; +}): AggregateRating | undefined => { + const rating = ratings?.[productId]?.[0]; + + if (!rating) { + return undefined; + } + + const aggregateRating: AggregateRating = { + "@type": "AggregateRating", + ratingCount: Number(rating.count), + ratingValue: Number(parseFloat(rating.rate).toFixed(1)), + bestRating: MAX_RATING_VALUE, + worstRating: MIN_RATING_VALUE, + }; + + return aggregateRating; +}; + +export const getWeightedRatingProduct = ( + ratings: Ratings | undefined, +): AggregateRating | undefined => { + if (!ratings) { + return undefined; + } + + const { weightedRating, totalRatings } = Object.entries(ratings ?? {}).reduce( + (acc, [_, [ratingDetails]]) => { + const count = Number(ratingDetails.count); + const value = Number(parseFloat(ratingDetails.rate).toFixed(1)); + + acc.totalRatings += count; + acc.weightedRating += count * value; + + return acc; + }, + { weightedRating: 0, totalRatings: 0 }, + ); + + const aggregateRating: AggregateRating = { + "@type": "AggregateRating", + ratingCount: totalRatings, + reviewCount: totalRatings, + ratingValue: totalRatings > 0 + ? Number((weightedRating / totalRatings).toFixed(1)) + : 0, + bestRating: MAX_RATING_VALUE, + worstRating: MIN_RATING_VALUE, + }; + + return aggregateRating; +}; + +export const toReview = (review: Review): CommerceReview => ({ + "@type": "Review", + author: [ + { + "@type": "Author", + name: `${review.firstname} ${review.lastname}`, + }, + ], + datePublished: review.review_date, + reviewBody: review.review, + dateCreated: review.order_date, + reviewRating: { + "@type": "AggregateRating", + ratingValue: Number(review.rate), + // this api does not support multiple reviews + reviewCount: 1, + }, +}); diff --git a/verified-reviews/utils/types.ts b/verified-reviews/utils/types.ts index 1873e2302..e48d57f04 100644 --- a/verified-reviews/utils/types.ts +++ b/verified-reviews/utils/types.ts @@ -1,4 +1,7 @@ -import { AggregateRating, Review } from "../../commerce/types.ts"; +import { + AggregateRating as CommerceAggregateRating, + Review as CommerceReview, +} from "../../commerce/types.ts"; export interface Ratings { [key: string]: { @@ -7,40 +10,46 @@ export interface Ratings { }[]; } +export interface Review { + count_helpful_yes: string; + firstname: string; + order_ref: string; + rate: string; + review: string; + email: string; + count_helpful_no: string; + hide_personnal_data: string; + lastname: string; + medias: string; + order_date: string; + id_review_product: string; + review_date: string; + id_product: string; + id_review: string; + sign_helpful: string; + publish_date: string; + info1: string; + info2: string; + info3: string; + info4: string; + info5: string; + info6: string; + info7: string; + info8: string; + info9: string; + info10: string; +} + export interface Reviews { - reviews: { - count_helpful_yes: string; - firstname: string; - order_ref: string; - rate: string; - review: string; - email: string; - count_helpful_no: string; - hide_personnal_data: string; - lastname: string; - medias: string; - order_date: string; - id_review_product: string; - review_date: string; - id_product: string; - id_review: string; - sign_helpful: string; - publish_date: string; - info1: string; - info2: string; - info3: string; - info4: string; - info5: string; - info6: string; - info7: string; - info8: string; - info9: string; - info10: string; - }[]; - status: number[]; + reviews: Review[]; + stats: number[]; +} + +export interface AggregateRating extends CommerceAggregateRating { + stats?: number[]; } export interface VerifiedReviewsFullReview { + review: CommerceReview[]; aggregateRating?: AggregateRating; - review: Review[]; } diff --git a/vertex/README.md b/vertex/README.md new file mode 100644 index 000000000..f3bd95a52 --- /dev/null +++ b/vertex/README.md @@ -0,0 +1 @@ +# App Template diff --git a/vertex/loaders/transcribeAudio.ts b/vertex/loaders/transcribeAudio.ts new file mode 100644 index 000000000..7a0f6f3bf --- /dev/null +++ b/vertex/loaders/transcribeAudio.ts @@ -0,0 +1,62 @@ +import { generateText } from "npm:ai@4.2.0"; +import { Buffer } from "node:buffer"; +import { AppContext } from "../mod.ts"; + +/** + * @name TRANSCRIBE_AUDIO + * @description Transcribes an audio file from a public URL using any google model that supports audio transcription + */ +export interface Props { + /** + * @description The public URL of the audio file to transcribe + */ + audioUrl: string; + /** + * @description The google model to use for transcription + * @default gemini-1.5-pro + */ + model?: string; +} +export default async function transcribeAudio( + { audioUrl, model = "gemini-1.5-pro" }: Props, + _request: Request, + ctx: AppContext, +) { + const vertexClient = ctx.vertexClient; + const response = await fetch(audioUrl); + const audioData = await response.arrayBuffer(); + + const transcriptionModel = vertexClient(model, { + audioTimestamp: true, + }); + + const { text } = await generateText({ + model: transcriptionModel, + messages: [ + { + role: "user", + content: [ + { + type: "text", + text: + "Please transcribe this audio file. Include timestamps if available.", + }, + { + type: "file", + mimeType: "audio/mpeg", + data: Buffer.from(audioData), + }, + ], + }, + ], + }); + + return { + content: [ + { + type: "text", + text: text, + }, + ], + }; +} diff --git a/vertex/manifest.gen.ts b/vertex/manifest.gen.ts new file mode 100644 index 000000000..a1dd5b7d2 --- /dev/null +++ b/vertex/manifest.gen.ts @@ -0,0 +1,17 @@ +// DO NOT EDIT. This file is generated by deco. +// This file SHOULD be checked into source version control. +// This file is automatically updated during development when running `dev.ts`. + +import * as $$$0 from "./loaders/transcribeAudio.ts"; + +const manifest = { + "loaders": { + "vertex/loaders/transcribeAudio.ts": $$$0, + }, + "name": "vertex", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/vertex/mod.ts b/vertex/mod.ts new file mode 100644 index 000000000..cd857be40 --- /dev/null +++ b/vertex/mod.ts @@ -0,0 +1,62 @@ +import { type App, type AppContext as AC } from "@deco/deco"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import { createVertex } from "npm:@ai-sdk/google-vertex@2.2.1/edge"; +import { Secret } from "../website/loaders/secret.ts"; + +interface State { + vertexClient: ReturnType; +} + +interface Props { + /** + * @description The Google Cloud credentials to use + */ + googleCredentials: { + clientEmail: Secret | string; + privateKeyId: Secret | string; + privateKey: Secret | string; + }; + /** + * @description The Google Cloud region to use + */ + location: Secret | string; + /** + * @description The Google Cloud project to use + */ + project: Secret | string; +} +/** + * @title Vertex + * @appName vertex + * @description Use Google’s Vertex AI for language, vision, and generative tasks. + * @category Tool + * @logo https://assets.decocache.com/mcp/156feb88-2648-43e0-b7d9-40c1bc2e1d1d/Vertex.svg + */ +export default function Vertex(props: Props): App { + const { googleCredentials, location, project } = props; + const vertex = createVertex({ + googleCredentials: { + clientEmail: typeof googleCredentials.clientEmail === "string" + ? googleCredentials.clientEmail + : googleCredentials.clientEmail.get() || "", + privateKeyId: typeof googleCredentials.privateKeyId === "string" + ? googleCredentials.privateKeyId + : googleCredentials.privateKeyId.get() || "", + privateKey: typeof googleCredentials.privateKey === "string" + ? googleCredentials.privateKey + : googleCredentials.privateKey.get() || "", + }, + location: typeof location === "string" ? location : location.get() || "", + project: typeof project === "string" ? project : project.get() || "", + }); + + return { + state: { + vertexClient: vertex, + }, + manifest, + dependencies: [], + }; +} +export type VertexApp = ReturnType; +export type AppContext = AC; diff --git a/vidu/actions/imageToVideo.ts b/vidu/actions/imageToVideo.ts new file mode 100644 index 000000000..99be34aec --- /dev/null +++ b/vidu/actions/imageToVideo.ts @@ -0,0 +1,65 @@ +import { AppContext } from "../mod.ts"; +import type { + ImageToVideoRequestBody, + ImageToVideoResponseBody, +} from "../client.ts"; +import { PREVIEW_URL } from "../loaders/resultPreview.ts"; +import { getInstallId } from "../utils.ts"; +export type Props = ImageToVideoRequestBody; + +export interface Result { + /** + * @title Status + * @description The status of the action. + */ + status: "success"; + /** + * @title Preview URL + * @description The URL of the preview of the video. Render this URL in the UI to show the user the preview of the video. + */ + previewUrl: string; + /** + * @title Message + * @description A message to the user. + */ + message: string; +} + +/** + * @title Image to Video + * @description Generates a video from a starting image using the Vidu API. + * @name IMAGE_TO_VIDEO + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const payload = { + ...props, + model: props.model ?? "vidu2.0", + } as unknown as ImageToVideoRequestBody; // Type assertion to satisfy TypeScript + + const url = new URL(req.url); + const installId = getInstallId(url); + + const response = await ctx.api["POST /ent/v2/img2video"]({}, { + body: payload, + }); + + const result = await response.json(); + + if (result.state !== "failed") { + return { + status: "success", + previewUrl: + `${PREVIEW_URL}&generationId=${result.task_id}&presignedUrl=${props.presignedUrl}&installId=${installId}`, + message: + "Video generation started. The video will be available at the previewUrl.", + }; + } + + return result; +}; + +export default action; diff --git a/vidu/actions/referenceToVideo.ts b/vidu/actions/referenceToVideo.ts new file mode 100644 index 000000000..a4ec16efd --- /dev/null +++ b/vidu/actions/referenceToVideo.ts @@ -0,0 +1,65 @@ +import { AppContext } from "../mod.ts"; +import type { + ReferenceToVideoRequestBody, + ReferenceToVideoResponseBody, +} from "../client.ts"; +import { PREVIEW_URL } from "../loaders/resultPreview.ts"; +import { getInstallId } from "../utils.ts"; +export type Props = ReferenceToVideoRequestBody; + +export interface Result { + /** + * @title Status + * @description The status of the action. + */ + status: "success"; + /** + * @title Preview URL + * @description The URL of the preview of the video. Render this URL in the UI to show the user the preview of the video. + */ + previewUrl: string; + /** + * @title Message + * @description A message to the user. + */ + message: string; +} + +/** + * @title Reference to Video + * @description Generates a video from reference images using the Vidu API. Allows for consistent subjects across the generated video. + * @name REFERENCE_TO_VIDEO + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const url = new URL(req.url); + const installId = getInstallId(url); + + const payload = { + ...props, + model: props.model ?? "vidu2.0", + } as unknown as ReferenceToVideoRequestBody; // Type assertion to satisfy TypeScript + + const response = await ctx.api["POST /ent/v2/reference2video"]({}, { + body: payload, + }); + + const result = await response.json(); + + if (result.state !== "failed") { + return { + status: "success", + previewUrl: + `${PREVIEW_URL}&generationId=${result.task_id}&presignedUrl=${props.presignedUrl}&installId=${installId}`, + message: + "Video generation started. The video will be available at the previewUrl.", + }; + } + + return result; +}; + +export default action; diff --git a/vidu/actions/startEndToVideo.ts b/vidu/actions/startEndToVideo.ts new file mode 100644 index 000000000..06b31e9a2 --- /dev/null +++ b/vidu/actions/startEndToVideo.ts @@ -0,0 +1,83 @@ +import { AppContext } from "../mod.ts"; +import type { + StartEndToVideoRequestBody, + StartEndToVideoResponseBody, +} from "../client.ts"; +import { PREVIEW_URL } from "../loaders/resultPreview.ts"; +import { getInstallId } from "../utils.ts"; + +export type Props = StartEndToVideoRequestBody; + +export interface Result { + /** + * @title Status + * @description The status of the action. + */ + status: "success"; + /** + * @title Preview URL + * @description The URL of the preview of the video. Render this URL in the UI to show the user the preview of the video. + */ + previewUrl: string; + /** + * @title Message + * @description A message to the user. + */ + message: string; +} + +/** + * @title Start-End to Video + * @name START_END_TO_VIDEO + * @description Generates a video that smoothly transitions from a start frame to an end frame using the Vidu API. + * + * This action requires exactly two images: + * - The first image is used as the starting frame of the video + * - The second image is used as the ending frame of the video + * + * The model will create a smooth, fluid transition between these two frames. + * For best results: + * - The pixel density of both images should be similar (ratio between 0.8 and 1.25) + * - The prompt should describe the desired motion/transition between frames + * - The subjects in both images should be related for more coherent results + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + // Validate that exactly 2 images are provided + if (props.images.length !== 2) { + throw new Error( + "Start-End to Video requires exactly 2 images - the first is used as the start frame and the second as the end frame.", + ); + } + + const url = new URL(req.url); + const installId = getInstallId(url); + + const payload = { + ...props, + model: props.model ?? "vidu2.0", + } as unknown as StartEndToVideoRequestBody; // Type assertion to satisfy TypeScript + + const response = await ctx.api["POST /ent/v2/start-end2video"]({}, { + body: payload, + }); + + const result = await response.json(); + + if (result.state !== "failed") { + return { + status: "success", + previewUrl: + `${PREVIEW_URL}&generationId=${result.task_id}&presignedUrl=${props.presignedUrl}&installId=${installId}`, + message: + "Video generation started. The video will transition smoothly from the start frame to the end frame and will be available at the previewUrl.", + }; + } + + return result; +}; + +export default action; diff --git a/vidu/actions/textToVideo.ts b/vidu/actions/textToVideo.ts new file mode 100644 index 000000000..35e6f604d --- /dev/null +++ b/vidu/actions/textToVideo.ts @@ -0,0 +1,67 @@ +import { AppContext } from "../mod.ts"; +import type { + TextToVideoModel, + TextToVideoRequestBody, + TextToVideoResponseBody, +} from "../client.ts"; +import { PREVIEW_URL } from "../loaders/resultPreview.ts"; +import { getInstallId } from "../utils.ts"; + +export type Props = TextToVideoRequestBody; + +export interface Result { + /** + * @title Status + * @description The status of the action. + */ + status: "success"; + /** + * @title Preview URL + * @description The URL of the preview of the video. Render this URL in the UI to show the user the preview of the video. + */ + previewUrl: string; + /** + * @title Message + * @description A message to the user. + */ + message: string; +} +/** + * @title Text to Video + * @description Generates a video from a text prompt using the Vidu API. The result will be available in a preview page. + * @name TEXT_TO_VIDEO + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const payload = { + ...props, + model: props.model ?? "vidu1.5" as TextToVideoModel, + }; + + const url = new URL(req.url); + + const installId = getInstallId(url); + + const response = await ctx.api["POST /ent/v2/text2video"]({}, { + body: payload, + }); + + const result = await response.json(); + + if (result.state !== "failed") { + return { + status: "success", + previewUrl: + `${PREVIEW_URL}&generationId=${result.task_id}&presignedUrl=${props.presignedUrl}&installId=${installId}`, + message: + "Video generation started. The video will be available at the previewUrl.", + }; + } + + return response.json(); +}; + +export default action; diff --git a/vidu/client.ts b/vidu/client.ts new file mode 100644 index 000000000..36f17b374 --- /dev/null +++ b/vidu/client.ts @@ -0,0 +1,365 @@ +export type ViduModel = "vidu2.0" | "vidu1.5" | "vidu1.0"; +export type ViduResolution = "360p" | "720p" | "1080p"; +export type ViduMovementAmplitude = "auto" | "small" | "medium" | "large"; +export type ViduAspectRatio = "16:9" | "9:16" | "1:1"; +export type StartEndToVideoModel = "vidu2.0" | "vidu1.5"; + +export interface ImageToVideoRequestBody { + /** + * @title Presigned URL + * @description The presigned URL used to upload the video after it is generated. If you dont have any, ask for the user to provide one, and hint to search in his tools. This is used only to upload the video after it is generated, and not as a preview. + */ + presignedUrl: string; + /** @title Model name */ + /** @default "vidu2.0" */ + /** @description The model to use for video generation. */ + model?: ViduModel; + /** + * @title Public URLs of images + * @description Provide a public URL for each image. You must use one of the following codecs: PNG, JPEG, JPG, WebP. The dimensions of the images must be at least 128x128 pixels. The aspect ratio of the images must be less than 1:4 or 4:1. All images are limited to 50MB. + */ + images: string[]; + /** + * @title Text prompt + * @description A textual description for video generation, with a maximum length of 1500 characters. + */ + prompt?: string; + /** + * @title Duration (seconds) + * @description The number of seconds of duration for the output video. vidu2.0 only accepts 4 seconds. + * @default 4 + */ + duration?: 4 | 8; + /** + * @title Random seed + * @description Manually set values will override the default random seed. + */ + seed?: number; + /** + * @title Resolution + * @description The resolution of the output video. Defaults to 360p , accepted value: 360p 720p 1080p + * Model vidu1.0 only accepted 360p + * Model vidu1.5 duration 4 accepted: 360p 720p 1080p + * Model vidu1.5 duration 8 accepted: 720p + * Model vidu2.0 duration 4 accepted: 360p 720p + * @default "360p" + */ + resolution?: ViduResolution; + /** + * @title Movement Amplitude + * @description The movement amplitude of objects in the frame. Available for model vidu1.5 and model vidu2.0. + * @default "auto" + */ + movement_amplitude?: ViduMovementAmplitude; + /** + * @title Aspect Ratio + * @description The aspect ratio of the output video. Model vidu1.0 only accepts 16:9. Models vidu1.5 and vidu2.0 accept 16:9, 9:16, 1:1. + * @default "16:9" + */ + aspect_ratio?: ViduAspectRatio; +} + +export interface ImageToVideoResponseBody { + task_id: string; + state: "created" | "queueing" | "processing" | "success" | "failed"; + model: ViduModel; + imagess: [string]; + prompt?: string; + duration: number; + seed: number; + resolution: ViduResolution; + movement_amplitude?: ViduMovementAmplitude; + created_at: string; // ISO 8601 format string +} + +export interface GenerationResultCreation { + id: string; + /** @description The URL of the generated video, valid for one hour. */ + url: string; + /** @description The cover URL of the generated video, valid for one hour. */ + cover_url: string; +} + +export interface GetGenerationResultResponseBody { + state: "created" | "queueing" | "processing" | "success" | "failed"; + err_code?: string; + creations?: GenerationResultCreation[]; +} + +export type TextToVideoModel = "vidu1.5" | "vidu1.0"; +export type TextToVideoStyle = "general" | "anime"; +export type TextToVideoAspectRatio = "16:9" | "9:16" | "1:1"; + +export interface TextToVideoRequestBody { + /** + * @title Presigned URL + * @description The presigned URL used to upload the video after it is generated. If you dont have any, ask for the user to provide one, and hint to search in his tools. This is used only to upload the video after it is generated, and not as a preview. + */ + presignedUrl: string; + /** + * @title Model name + * @description Accepted values: vidu1.5 | vidu1.0 . + * @default "vidu1.5" + */ + model?: TextToVideoModel; + /** + * @title Style + * @description The style of output video. Defaults to general. + * @default "general" + */ + style?: TextToVideoStyle; + /** + * @title Text prompt + * @description A textual description for video generation, with a maximum length of 1500 characters. + */ + prompt: string; + /** + * @title Duration (seconds) + * @description The number of seconds of duration for the output video. Can be 4 or 8. + * @default 4 + */ + duration?: 4 | 8; + /** + * @title Random seed + * @description Manually set values will override the default random seed. + */ + seed?: number; + /** + * @title Aspect Ratio + * @description The aspect ratio of the output video. Model vidu1.0 only accepts 16:9. Model vidu1.5 accepts 16:9, 9:16, 1:1. + * @default "16:9" + */ + aspect_ratio?: TextToVideoAspectRatio; + /** + * @title Resolution + * @description The resolution of the output video. Model vidu1.0 only accepts 360p. Models vidu1.5 duration 4 accepted: 360p 720p 1080p. Model vidu1.5 duration 8 accepted: 720p. + * @default "360p" + */ + resolution?: ViduResolution; + /** + * @title Movement Amplitude + * @description The movement amplitude of objects in the frame. Available for model vidu1.5. + * @default "auto" + */ + movement_amplitude?: ViduMovementAmplitude; + /** + * @title Callback URL + * @description URL to receive task status updates via POST requests. + */ + callback_url?: string; +} + +export interface TextToVideoResponseBody { + task_id: string; + state: "created" | "queueing" | "processing" | "success" | "failed"; + model: TextToVideoModel; + style?: TextToVideoStyle; + prompt: string; + duration: number; + seed: number; + aspect_ratio?: TextToVideoAspectRatio; + resolution: ViduResolution; + movement_amplitude?: ViduMovementAmplitude; + created_at: string; // ISO 8601 format string +} + +export interface ReferenceToVideoRequestBody { + /** + * @title Presigned URL + * @description The presigned URL used to upload the video after it is generated. If you dont have any, ask for the user to provide one, and hint to search in his tools. This is used only to upload the video after it is generated, and not as a preview. + */ + presignedUrl: string; + /** + * @title Model name + * @description The model to use for video generation. Accepted values: vidu2.0 | vidu1.5 | vidu1.0 + * @default "vidu2.0" + */ + model?: ViduModel; + /** + * @title Reference Images + * @description The model will use the provided images as references to generate a video with consistent subjects. + * Model vidu1.0 only accepts 1 image, while vidu1.5 and vidu2.0 accepts 1 to 3 images. + */ + images: string[]; + /** + * @title Text prompt + * @description A textual description for video generation, with a maximum length of 1500 characters. + */ + prompt: string; + /** + * @title Duration (seconds) + * @description The number of seconds of duration for the output video. + * Model vidu2.0 only accepts 4 seconds. + * @default 4 + */ + duration?: 4 | 8; + /** + * @title Random seed + * @description Manually set values will override the default random seed. + */ + seed?: number; + /** + * @title Aspect Ratio + * @description The aspect ratio of the output video. + * Model vidu1.0 only accepts 16:9. + * Models vidu1.5 and vidu2.0 accept 16:9, 9:16, 1:1. + * @default "16:9" + */ + aspect_ratio?: ViduAspectRatio; + /** + * @title Resolution + * @description The resolution of the output video. + * Model vidu1.0 only accepts 360p. + * Model vidu1.5 duration 4 accepts: 360p, 720p, 1080p. + * Model vidu1.5 duration 8 accepts: 720p. + * Model vidu2.0 duration 4 accepts: 360p, 720p. + * @default "360p" + */ + resolution?: ViduResolution; + /** + * @title Movement Amplitude + * @description The movement amplitude of objects in the frame. + * Available for model vidu1.5 and vidu2.0. + * @default "auto" + */ + movement_amplitude?: ViduMovementAmplitude; + /** + * @title Callback URL + * @description URL to receive task status updates via POST requests. + */ + callback_url?: string; +} + +export interface ReferenceToVideoResponseBody { + task_id: string; + state: "created" | "queueing" | "processing" | "success" | "failed"; + model: ViduModel; + images: string[]; + prompt: string; + duration: number; + seed: number; + aspect_ratio?: ViduAspectRatio; + resolution: ViduResolution; + movement_amplitude?: ViduMovementAmplitude; + created_at: string; // ISO 8601 format string +} + +export interface StartEndToVideoRequestBody { + /** + * @title Presigned URL + * @description The presigned URL used to upload the video after it is generated. If you dont have any, ask for the user to provide one, and hint to search in his tools. This is used only to upload the video after it is generated, and not as a preview. + */ + presignedUrl: string; + /** + * @title Model name + * @description The model to use for video generation. Only vidu1.5 and vidu2.0 models support this feature. + * @default "vidu2.0" + */ + model?: StartEndToVideoModel; + /** + * @title Start and End Images + * @description Requires exactly 2 images, with the first image used as the start frame and the second image as the end frame. + * The pixel density of the start and end frames should be similar (the ratio should be between 0.8 and 1.25). + * Images can be provided as URLs or Base64 encoded strings. + * Supported formats: PNG, JPEG, JPG, WebP + * Images must be at least 128x128 pixels, with aspect ratio less than 1:4 or 4:1. + * Maximum file size: 50MB per image. + */ + images: string[]; + /** + * @title Text prompt + * @description A textual description for video generation, with a maximum length of 1500 characters. + * This helps guide the transition between the start and end frames. + */ + prompt?: string; + /** + * @title Duration (seconds) + * @description The number of seconds of duration for the output video. + * @default 4 + */ + duration?: 4 | 8; + /** + * @title Random seed + * @description Manually set values will override the default random seed. + */ + seed?: number; + /** + * @title Resolution + * @description The resolution of the output video. + * For duration 4: 360p, 720p, 1080p are supported. + * For duration 8: only 720p is supported. + * @default "360p" + */ + resolution?: ViduResolution; + /** + * @title Movement Amplitude + * @description The movement amplitude of objects in the frame. + * Controls how dynamic the transition between start and end frames appears. + * @default "auto" + */ + movement_amplitude?: ViduMovementAmplitude; + /** + * @title Callback URL + * @description URL to receive task status updates via POST requests. + */ + callback_url?: string; +} + +export interface StartEndToVideoResponseBody { + task_id: string; + state: "created" | "queueing" | "processing" | "success" | "failed"; + model: StartEndToVideoModel; + images: string[]; + prompt?: string; + duration: number; + seed: number; + resolution: ViduResolution; + movement_amplitude?: ViduMovementAmplitude; + created_at: string; // ISO 8601 format string +} + +export interface ViduClient { + /** + * @title Image to Video + * @description Creates a video generation task from an image. + */ + "POST /ent/v2/img2video": { + response: ImageToVideoResponseBody; + body: ImageToVideoRequestBody; + }; + + /** + * @title Get Generation Result + * @description Retrieves the status and results of a video generation task. + */ + "GET /ent/v2/tasks/:id/creations": { + response: GetGenerationResultResponseBody; + }; + + /** + * @title Text to Video + * @description Creates a video generation task from a text prompt. + */ + "POST /ent/v2/text2video": { + response: TextToVideoResponseBody; + body: TextToVideoRequestBody; + }; + + /** + * @title Reference to Video + * @description Creates a video generation task from reference images. + */ + "POST /ent/v2/reference2video": { + response: ReferenceToVideoResponseBody; + body: ReferenceToVideoRequestBody; + }; + + /** + * @title Start-End to Video + * @description Creates a video that transitions from a start frame to an end frame. + */ + "POST /ent/v2/start-end2video": { + response: StartEndToVideoResponseBody; + body: StartEndToVideoRequestBody; + }; +} diff --git a/vidu/loaders/getGenerationResult.ts b/vidu/loaders/getGenerationResult.ts new file mode 100644 index 000000000..a7184e5ee --- /dev/null +++ b/vidu/loaders/getGenerationResult.ts @@ -0,0 +1,76 @@ +import { AppContext } from "../mod.ts"; +import type { GetGenerationResultResponseBody } from "../client.ts"; + +export interface Props { + /** + * @title Task ID + * @description The ID of the video generation task. + */ + generationId: string; + /** + * @title Presigned URL + * @description The presigned URL used to upload the video if it is available. + */ + presignedUrl: string; +} + +const POLLING_INTERVAL_MS = 2000; // Poll every 2 seconds + +export interface Result { + state: "success" | "in-progress" | "failed"; + resultUrl?: string; + originalUrl?: string; +} + +/** + * @title Get Generation Result + * @description Retrieves the status and results (video URL, cover URL) of a Vidu generation task, polling until completion or failure. + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + let data: GetGenerationResultResponseBody | Result; + + while (true) { + const response = await ctx.api["GET /ent/v2/tasks/:id/creations"]({ + id: props.generationId, + }); + + data = await response.json(); + + if (data.state === "success") { + if (data.creations?.[0]?.url) { + const response = await fetch(data.creations[0].url); + await fetch(props.presignedUrl, { + method: "PUT", + body: response.body, + }); + + return { + state: "success", + resultUrl: props.presignedUrl.replace("_presigned/", ""), + originalUrl: data.creations[0].url, + }; + } + + break; + } + + if (data.state === "failed") { + throw new Error("Video generation failed"); + } + + if (data.state === "queueing" || data.state === "processing") { + await new Promise((resolve) => setTimeout(resolve, POLLING_INTERVAL_MS)); + } else { + console.warn(`Unexpected task state: ${data.state}`); + break; + } + } + + return data as Result; +}; + +export default loader; diff --git a/vidu/loaders/resultPreview.ts b/vidu/loaders/resultPreview.ts new file mode 100644 index 000000000..76d6378cb --- /dev/null +++ b/vidu/loaders/resultPreview.ts @@ -0,0 +1,153 @@ +import { AppContext } from "../mod.ts"; + +export interface Props { + generationId: string; + presignedUrl?: string; +} + +export const PREVIEW_URL = + "https://mcp.deco.site/live/invoke/vidu/loaders/resultPreview.ts?appName=Vidu"; + +const RESULT_URL = + "https://mcp.deco.site/live/invoke/vidu/loaders/getGenerationResult.ts?appName=Vidu"; + +/** + * @title Preview Loader + * @description Generates HTML and JS for polling and displaying video generation status. + */ +export default function PreviewLoader( + props: Props, + req: Request, + _ctx: AppContext, +): Response { + const { + generationId, + presignedUrl, + } = props; + + const url = new URL(req.url); + const installId = url.searchParams.get("installId"); + + const html = ` + + + + + Preview + + + +
+
+ + + +
+ + + +`; + + return new Response(html, { + headers: { + "Content-Type": "text/html", + }, + status: 200, + }); +} diff --git a/vidu/manifest.gen.ts b/vidu/manifest.gen.ts new file mode 100644 index 000000000..efb05a4f3 --- /dev/null +++ b/vidu/manifest.gen.ts @@ -0,0 +1,29 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/imageToVideo.ts"; +import * as $$$$$$$$$1 from "./actions/referenceToVideo.ts"; +import * as $$$$$$$$$2 from "./actions/startEndToVideo.ts"; +import * as $$$$$$$$$3 from "./actions/textToVideo.ts"; +import * as $$$0 from "./loaders/getGenerationResult.ts"; +import * as $$$1 from "./loaders/resultPreview.ts"; + +const manifest = { + "loaders": { + "vidu/loaders/getGenerationResult.ts": $$$0, + "vidu/loaders/resultPreview.ts": $$$1, + }, + "actions": { + "vidu/actions/imageToVideo.ts": $$$$$$$$$0, + "vidu/actions/referenceToVideo.ts": $$$$$$$$$1, + "vidu/actions/startEndToVideo.ts": $$$$$$$$$2, + "vidu/actions/textToVideo.ts": $$$$$$$$$3, + }, + "name": "vidu", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/vidu/mod.ts b/vidu/mod.ts new file mode 100644 index 000000000..76d5c6128 --- /dev/null +++ b/vidu/mod.ts @@ -0,0 +1,55 @@ +import type { App, FnContext } from "@deco/deco"; +import { fetchSafe } from "../utils/fetch.ts"; +import { createHttpClient } from "../utils/http.ts"; +import type { Secret } from "../website/loaders/secret.ts"; +import manifest, { Manifest } from "./manifest.gen.ts"; +import type { ViduClient } from "./client.ts"; + +export type AppContext = FnContext; + +export interface Props { + /** + * @title Vidu API Key + * @description The API key for accessing the Vidu API. + * @format password + */ + apiKey: string | Secret; +} + +export interface State { + api: ReturnType>; +} + +/** + * @title Vidu + * @appName vidu + * @description Transform text or images into video using Vidu's AI tools. + * @category AI & Generative + * @logo https://assets.decocache.com/mcp/551c6502-caaf-498a-82b5-d6c586244fbd/Vidu.svg + */ +export default function App( + props: Props, +): App { + const { apiKey } = props; + const stringToken = typeof apiKey === "string" + ? apiKey + : apiKey.get?.() ?? ""; + + const api = createHttpClient({ + base: `https://api.vidu.com`, + headers: new Headers({ + "Authorization": `Token ${stringToken}`, + "Content-Type": "application/json", + }), + fetcher: fetchSafe, + }); + + const state = { api }; + + return { + state, + manifest, + }; +} + +export type ViduApp = ReturnType; diff --git a/vidu/utils.ts b/vidu/utils.ts new file mode 100644 index 000000000..e80e5159e --- /dev/null +++ b/vidu/utils.ts @@ -0,0 +1,17 @@ +/** + * Extracts the install ID from a URL pathname with the format: + * /apps/Vidu/7afa4147-0903-4416-a52a-c1f7d3b35762/mcp/messages + * + * @param url URL object or string representation of the URL + * @returns The install ID from the pathname or null if not found + */ +export function getInstallId(url: URL | string): string | null { + const pathName = typeof url === "string" ? url : url.pathname; + + // Match the UUID pattern in the pathname after /apps/Vidu/ + const match = pathName.match( + /\/apps\/Vidu\/([0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/i, + ); + + return match ? match[1] : null; +} diff --git a/vnda/README.md b/vnda/README.md index 0e9e73187..9362fe685 100644 --- a/vnda/README.md +++ b/vnda/README.md @@ -1,33 +1,11 @@ -

-

- - VNDA - -

-

-

- - Your online store with the best e-commerce platform. - -

-

- Loaders, actions and workflows for adding VNDA Commerce Platform to your deco.cx website. -

-

+Your online store with the best e-commerce platform. + +Loaders, actions and workflows for adding VNDA Commerce Platform to your deco.cx website. + VNDA offers a range of features and services to facilitate e-commerce operations. This app wrapps VNDA Commerce API into a comprehensive set of loaders/actions/workflows empowering non technical users to interact and act -upon their headless commerce. - -

- -# Installation - -1. Install via decohub -2. Fill the necessary fields: - -🎉 Your VNDA setup is complete. You should now see VNDA -loaders/actions/workflows available for your sections. +upon their headless commerce. \ No newline at end of file diff --git a/vnda/actions/cart/addItems.ts b/vnda/actions/cart/addItems.ts new file mode 100644 index 000000000..7cd31f58b --- /dev/null +++ b/vnda/actions/cart/addItems.ts @@ -0,0 +1,46 @@ +import { HttpError } from "../../../utils/http.ts"; +import cartLoader, { Cart } from "../../loaders/cart.ts"; +import { AppContext } from "../../mod.ts"; +import { getCartCookie } from "../../utils/cart.ts"; + +interface Item { + itemId: string; + quantity: number; + attributes?: Record; +} + +export interface Props { + items: Item[]; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { items } = props; + const cartId = getCartCookie(req.headers); + + if (!cartId) { + throw new HttpError(400, "Missing cart cookie"); + } + + await api["POST /api/v2/carts/:cartId/items/bulk"]({ cartId }, { + body: { + items: items.map((item) => ({ + sku: item.itemId, + quantity: item.quantity, + customizations: item.attributes + ? Object.entries(item.attributes).map(([key, value]) => ({ + [key]: value, + })) + : undefined, + })), + }, + }); + + return cartLoader({}, req, ctx); +}; + +export default action; diff --git a/vnda/actions/cart/simulation.ts b/vnda/actions/cart/simulation.ts index 22f0f65f4..ff7c7ee67 100644 --- a/vnda/actions/cart/simulation.ts +++ b/vnda/actions/cart/simulation.ts @@ -1,13 +1,11 @@ import { AppContext } from "../../mod.ts"; import type { ShippingMethod } from "../../utils/client/types.ts"; -import { badRequest } from "deco/mod.ts"; - +import { badRequest } from "@deco/deco"; export interface Props { skuId: string; quantity: number; zip: string; } - const action = async ( props: Props, _req: Request, @@ -15,7 +13,6 @@ const action = async ( ): Promise => { const { api } = ctx; const { skuId, quantity, zip } = props; - if (!skuId || !quantity || !zip) { badRequest({ message: "could not find some props", @@ -28,5 +25,4 @@ const action = async ( }); return cep.json(); }; - export default action; diff --git a/vnda/actions/notifyme.ts b/vnda/actions/notifyme.ts new file mode 100644 index 000000000..166a0983d --- /dev/null +++ b/vnda/actions/notifyme.ts @@ -0,0 +1,43 @@ +import { AppContext } from "../mod.ts"; + +export interface Props { + key: string; + sku: string; + email: string; +} + +const action = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { account } = ctx; + const { key, sku, email } = props; + + const formdata = new FormData(); + formdata.append("key", key); + formdata.append("sku", sku); + formdata.append("email", email); + + const options = { + method: "POST", + body: formdata, + }; + + try { + await Promise.all([ + fetch( + `https://${account}.cdn.vnda.com.br/lista_de_espera`, + options, + ).then((res) => res.json()), + fetch( + `https://${account}.cdn.vnda.com.br/webform`, + options, + ), + ]); + } catch (error) { + console.log(error); + } +}; + +export default action; diff --git a/vnda/handlers/sitemap.ts b/vnda/handlers/sitemap.ts new file mode 100644 index 000000000..fc560a988 --- /dev/null +++ b/vnda/handlers/sitemap.ts @@ -0,0 +1,73 @@ +import { AppContext } from "../mod.ts"; + +type ConnInfo = Deno.ServeHandlerInfo; +const xmlHeader = + ''; + +const includeSiteMaps = ( + currentXML: string, + origin: string, + includes?: string[], +) => { + const siteMapIncludeTags = []; + + for (const include of (includes ?? [])) { + siteMapIncludeTags.push(` + + ${include.startsWith("/") ? `${origin}${include}` : include} + ${new Date().toISOString().substring(0, 10)} +`); + } + return siteMapIncludeTags.length > 0 + ? currentXML.replace( + xmlHeader, + `${xmlHeader}\n${siteMapIncludeTags.join("\n")}`, + ) + : currentXML; +}; + +export interface Props { + include?: string[]; +} +/** + * @title Sitemap Proxy + */ +export default function Sitemap( + { include }: Props, + appCtx: AppContext, +) { + const { publicUrl } = appCtx; + return ( + req: Request, + _ctx: ConnInfo, + ) => { + if (!publicUrl) { + throw new Error("Missing publicUrl"); + } + + const url = new URL( + publicUrl?.startsWith("http") ? publicUrl : `https://${publicUrl}`, + ); + + const headers = new Headers(); + headers.set("Content-Type", "application/xml"); + + const reqUrl = new URL(req.url); + const text = `${xmlHeader} + + ${url.host}sitemap/vnda.xml + + `; + return new Response( + includeSiteMaps( + text.replaceAll(publicUrl, `${reqUrl.origin}/`), + reqUrl.origin, + include, + ), + { + headers, + status: 200, + }, + ); + }; +} diff --git a/vnda/hooks/useCart.ts b/vnda/hooks/useCart.ts index 43a9f2004..fd30d4e14 100644 --- a/vnda/hooks/useCart.ts +++ b/vnda/hooks/useCart.ts @@ -2,26 +2,27 @@ import type { AnalyticsItem } from "../../commerce/types.ts"; import type { Manifest } from "../manifest.gen.ts"; import { invoke } from "../runtime.ts"; -import type { Item } from "../utils/client/types.ts"; import { Context, state as storeState } from "./context.ts"; const { cart, loading } = storeState; +type Item = NonNullable["items"][number]; + export const itemToAnalyticsItem = ( item: Item & { quantity: number }, index: number, -): AnalyticsItem => ({ - item_id: `${item.id}_${item.variant_sku}`, - item_name: item.product_name, - discount: item.price - item.variant_price, - item_variant: item.variant_name?.slice(item.product_name.length).trim(), - // TODO: check - price: item.price, - // TODO - // item_brand: "todo", - index, - quantity: item.quantity, -}); +): AnalyticsItem => { + return { + item_id: item.variant_sku, + item_group_id: item.id, + quantity: item.quantity, + price: item.price, + index, + discount: Math.abs(item.variant_price - item.price), + item_name: item.product_name, + item_variant: item.variant_name, + }; +}; type EnqueuableActions< K extends keyof Manifest["actions"], diff --git a/vnda/loaders/cart.ts b/vnda/loaders/cart.ts index 22d097cba..74bbb0680 100644 --- a/vnda/loaders/cart.ts +++ b/vnda/loaders/cart.ts @@ -1,5 +1,5 @@ import { AppContext } from "../mod.ts"; -import { getCartCookie, setCartCookie } from "../utils/cart.ts"; +import { getAgentCookie, getCartCookie, setCartCookie } from "../utils/cart.ts"; import { OpenAPI } from "../utils/openapi/vnda.openapi.gen.ts"; export type Cart = { @@ -18,13 +18,34 @@ const loader = async ( ): Promise => { const { api } = ctx; const cartId = getCartCookie(req.headers); + const agent = getAgentCookie(req.headers); - const orderForm = cartId - ? await api["GET /api/v2/carts/:cartId"]({ cartId }) - .then((res) => res.json()) - : await api["POST /api/v2/carts"]({}, { body: {} }).then((res) => + let orderForm; + + try { + orderForm = cartId + ? await api["GET /api/v2/carts/:cartId"]({ cartId }).then((res) => + res.json() + ) + : await api["POST /api/v2/carts"]({}, { body: {} }).then((res) => + res.json() + ); + } catch (_error) { + // Failed to get current cardId, creating a new orderForm + orderForm = await api["POST /api/v2/carts"]({}, { body: {} }).then((res) => res.json() ); + } + + const hasAgent = orderForm.agent === agent; + + if (!hasAgent && agent) { + const [{ id }] = await api["GET /api/v2/users"]({ external_code: agent }) + .then((res) => res.json()); + await api["PATCH /api/v2/carts/:cartId"]({ cartId: orderForm.id }, { + body: { agent, user_id: id }, + }); + } setCartCookie(ctx.response.headers, orderForm.id.toString()); return { diff --git a/vnda/loaders/extensions/price/list.ts b/vnda/loaders/extensions/price/list.ts new file mode 100644 index 000000000..c8904f980 --- /dev/null +++ b/vnda/loaders/extensions/price/list.ts @@ -0,0 +1,21 @@ +import { Product } from "../../../../commerce/types.ts"; +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { fetchAndApplyPrices } from "../../../utils/transform.ts"; + +export interface Props { + priceCurrency: string; +} + +const loader = ( + { priceCurrency }: Props, + req: Request, + ctx: AppContext, +): ExtensionOf => +(products: Product[] | null) => { + if (!Array.isArray(products)) return products; + + return fetchAndApplyPrices(products, priceCurrency, req, ctx); +}; + +export default loader; diff --git a/vnda/loaders/extensions/price/listingPage.ts b/vnda/loaders/extensions/price/listingPage.ts new file mode 100644 index 000000000..6131c01b7 --- /dev/null +++ b/vnda/loaders/extensions/price/listingPage.ts @@ -0,0 +1,35 @@ +import { ProductListingPage } from "../../../../commerce/types.ts"; +import { ExtensionOf } from "../../../../website/loaders/extension.ts"; +import { AppContext } from "../../../mod.ts"; +import { fetchAndApplyPrices } from "../../../utils/transform.ts"; + +export interface Props { + priceCurrency: string; +} + +const loader = ( + { priceCurrency }: Props, + req: Request, + ctx: AppContext, +): ExtensionOf => +async (props: ProductListingPage | null) => { + if (!props) return props; + + const { products, ...page } = props; + + if (!Array.isArray(products)) return props; + + const extendedProducts = await fetchAndApplyPrices( + products, + priceCurrency, + req, + ctx, + ); + + return { + ...page, + products: extendedProducts, + }; +}; + +export default loader; diff --git a/vnda/loaders/productDetailsPage.ts b/vnda/loaders/productDetailsPage.ts index 0f2765708..385cedef2 100644 --- a/vnda/loaders/productDetailsPage.ts +++ b/vnda/loaders/productDetailsPage.ts @@ -2,10 +2,12 @@ import type { ProductDetailsPage } from "../../commerce/types.ts"; import { STALE } from "../../utils/fetch.ts"; import type { RequestURLParam } from "../../website/functions/requestToParam.ts"; import { AppContext } from "../mod.ts"; -import { getSEOFromTag, parseSlug, toProduct } from "../utils/transform.ts"; +import { ProductPrice } from "../utils/client/types.ts"; +import { parseSlug, toProduct } from "../utils/transform.ts"; export interface Props { slug: RequestURLParam; + priceIntl?: boolean; } /** @@ -18,49 +20,123 @@ async function loader( ctx: AppContext, ): Promise { const url = new URL(req.url); - const { slug } = props; + const { slug, priceIntl = false } = props; const { api } = ctx; if (!slug) return null; const variantId = url.searchParams.get("skuId") || null; - const { id } = parseSlug(slug); + const fromSlug = parseSlug(slug); - const [maybeProduct, seo] = await Promise.all([ - api["GET /api/v2/products/:id"]({ id, include_images: "true" }, STALE) - .then((r) => r.json()).catch(() => null), - api["GET /api/v2/seo_data"]({ - resource_type: "Product", - resource_id: id, - type: "category", - }, STALE).then((res) => res.json()), + // 404: invalid slug + if (!fromSlug) { + return null; + } + + const { id } = fromSlug; + + const getMaybeProduct = async (id: number) => { + try { + const result = await api["GET /api/v2/products/:id"]({ + id, + include_images: "true", + }, STALE); + return result.json(); + } catch (error) { + // Make async rendering work + if (error instanceof DOMException && error.name === "AbortError") { + throw error; + } + + return null; + } + }; + + // Since the Product by ID request don't return the INTL price, is necessary to search all prices and replace them + const getProductPrice = async (id: number): Promise => { + if (!priceIntl) { + return null; + } else { + try { + const result = await api["GET /api/v2/products/:productId/price"]({ + productId: id, + }, STALE); + return result.json(); + } catch (error) { + // Make async rendering work + if (error instanceof DOMException && error.name === "AbortError") { + throw error; + } + + return null; + } + } + }; + + const [maybeProduct, productPrice] = await Promise.all([ + getMaybeProduct(id), + getProductPrice(id), ]); + const variantsLength = maybeProduct?.variants?.length ?? 0; + // 404: product not found - if (!maybeProduct) { + if (!maybeProduct || variantsLength === 0) { return null; } const product = toProduct(maybeProduct, variantId, { url, priceCurrency: "BRL", + productPrice, }); + const segments = url.pathname.slice(1).split("/"); + + let seoArray; + if (product.isVariantOf?.productGroupID) { + seoArray = await api["GET /api/v2/seo_data"]({ + resource_type: "Product", + resource_id: Number(product.isVariantOf.productGroupID), + }, STALE).then((res) => res.json()) + .catch(() => undefined); + } + + const seo = seoArray?.at(-1); + return { "@type": "ProductDetailsPage", // TODO: Find out what's the right breadcrumb on vnda breadcrumbList: { "@type": "BreadcrumbList", - itemListElement: [], - numberOfItems: 0, + itemListElement: segments.map((s, i) => ({ + "@type": "ListItem", + name: s, + position: i + 1, + item: new URL(`/${segments.slice(0, i + 1).join("/")}`, url).href, + })), + numberOfItems: segments.length, }, product, - seo: getSEOFromTag({ - title: product.name, - description: product.description || "", - ...seo?.[0], - }, req), + seo: { + title: seo?.title || (product.name ?? ""), + description: seo?.description || (product.description ?? ""), + canonical: new URL(`/${segments.join("/")}`, url).href, + }, }; } export default loader; + +export const cache = "stale-while-revalidate"; + +export const cacheKey = (props: Props, req: Request) => { + const url = new URL(req.url); + const { slug, priceIntl = false } = props; + + if (!slug) return null; + + const variantId = url.searchParams.get("skuId") || ""; + + return `product-details-page-${slug}-${priceIntl}-${variantId}`; +}; diff --git a/vnda/loaders/productDetailsPageVideo.ts b/vnda/loaders/productDetailsPageVideo.ts new file mode 100644 index 000000000..53fbb948c --- /dev/null +++ b/vnda/loaders/productDetailsPageVideo.ts @@ -0,0 +1,28 @@ +import { AppContext } from "../mod.ts"; +import { ExtensionOf } from "../../website/loaders/extension.ts"; +import { ProductDetailsPage } from "../../commerce/types.ts"; +import { addVideoToProduct } from "../utils/transform.ts"; +import { STALE } from "../../utils/fetch.ts"; + +export default function productDetailsPageVideo( + _props: unknown, + _req: Request, + ctx: AppContext, +): ExtensionOf { + const { api } = ctx; + return async (productDetailsPage: ProductDetailsPage | null) => { + if (!productDetailsPage) { + return null; + } + const { product } = productDetailsPage; + const { inProductGroupWithID } = product; + const videos = await api["GET /api/v2/products/:productId/videos"]({ + productId: inProductGroupWithID as string, + }, STALE).then((r) => r.json()).catch(() => null); + const productWithVideo = addVideoToProduct(product, videos); + return { + ...productDetailsPage, + product: productWithVideo, + }; + }; +} diff --git a/vnda/loaders/productList.ts b/vnda/loaders/productList.ts index e79ce5e51..112ce1e72 100644 --- a/vnda/loaders/productList.ts +++ b/vnda/loaders/productList.ts @@ -19,6 +19,9 @@ export interface Props { /** @description search for products that have certain tag */ tags?: string[]; + /** @description search for products that have certain type_tag */ + typeTags?: { key: string; value: string }[]; + /** @description search for products by id */ ids: number[]; } @@ -35,21 +38,64 @@ const productListLoader = async ( const url = new URL(req.url); const { api } = ctx; - const search = await api["GET /api/v2/products/search"]({ - term: props?.term, - wildcard: props?.wildcard, - sort: props?.sort, - per_page: props?.count, - "tags[]": props?.tags, - "ids[]": props?.ids, - }, STALE).then((res) => res.json()); - - return search.results?.map((product) => - toProduct(product, null, { + const { results: searchResults = [] } = await api + ["GET /api/v2/products/search"]({ + term: props?.term, + wildcard: props?.wildcard, + sort: props?.sort, + per_page: props?.count, + "tags[]": props?.tags, + ...Object.fromEntries( + (props.typeTags || []).map(( + { key, value }, + ) => [`type_tags[${key}][]`, value]), + ), + "ids[]": props?.ids, + }, STALE).then((res) => res.json()); + + const validProducts = searchResults.filter(({ variants }) => { + return variants.length !== 0; + }); + + if (validProducts.length === 0) return null; + + const sortedProducts = props.ids?.length > 0 + ? props.ids.map((id) => validProducts.find((product) => product.id === id)) + : validProducts; + + return sortedProducts.map((product) => { + return toProduct(product!, null, { url, priceCurrency: "BRL", - }) - ) ?? null; + }); + }); }; export default productListLoader; + +export const cache = "stale-while-revalidate"; + +export const cacheKey = (props: Props) => { + const { term, wildcard, sort, tags, typeTags, ids, count } = props; + + const tagsString = tags?.sort((a, b) => a.localeCompare(b)).join("-") ?? ""; + const typeTagsString = + typeTags?.sort((a, b) => a.key.localeCompare(b.key)).map(({ key, value }) => + `${key}-${value}` + ).join("-") ?? ""; + const idsString = ids?.sort((a, b) => a - b).join("-") ?? ""; + + const values = [ + term, + wildcard, + sort, + tagsString, + typeTagsString, + idsString, + count, + ]; + + const filteredValues = values.filter(Boolean); + + return `product-list-${filteredValues.join("-")}`; +}; diff --git a/vnda/loaders/productListingPage.ts b/vnda/loaders/productListingPage.ts index 0f35c7427..fd03219b8 100644 --- a/vnda/loaders/productListingPage.ts +++ b/vnda/loaders/productListingPage.ts @@ -1,10 +1,16 @@ -import type { ProductListingPage } from "../../commerce/types.ts"; +import type { + BreadcrumbList, + ProductListingPage, +} from "../../commerce/types.ts"; 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"; import { + canonicalFromTags, getSEOFromTag, toFilters, toProduct, @@ -19,6 +25,15 @@ export const VNDA_SORT_OPTIONS: SortOption[] = [ { value: "highest_price", label: "Maior preço" }, ]; +type Operators = "and" | "or"; + +interface FilterOperator { + type_tags?: Operators; + property1?: Operators; + property2?: Operators; + property3?: Operators; +} + export interface Props { /** * @description overides the query term @@ -38,8 +53,38 @@ export interface Props { * Slug for category pages */ slug?: RequestURLParam; + + filterByTags?: boolean; + + /** @description if properties are empty, "typeTags" value will apply to all. Defaults to "and" */ + filterOperator?: FilterOperator; + + /** + * @hide true + * @description The URL of the page, used to override URL from request + */ + pageHref?: string; } +const getBreadcrumbList = (categories: Tag[], url: URL): BreadcrumbList => ({ + "@type": "BreadcrumbList" as const, + itemListElement: categories.map((t, index) => ({ + "@type": "ListItem" as const, + item: canonicalFromTags(categories.slice(0, index + 1), url).href, + position: index + 1, + name: t.title, + })), + numberOfItems: categories.length, +}); + +const handleOperator = ( + key: "type_tags" | "property1" | "property2" | "property3", + defaultValue: Operators, + filterOperators?: FilterOperator, +) => ({ + [`${key}_operator`]: filterOperators?.[key] ?? defaultValue ?? "and", +}); + /** * @title VNDA Integration * @description Product Listing Page loader @@ -50,53 +95,132 @@ const searchLoader = async ( ctx: AppContext, ): Promise => { // get url from params - const url = new URL(req.url); + const url = new URL(props.pageHref || req.url); const { api } = ctx; const count = props.count ?? 12; - const { cleanUrl, typeTags } = typeTagExtractor(url); const sort = url.searchParams.get("sort") as Sort; const page = Number(url.searchParams.get("page")) || 1; - const isSearchPage = url.pathname === "/busca"; + const isSearchPage = ctx.searchPagePath + ? ctx.searchPagePath === url.pathname + : url.pathname === "/busca" || url.pathname === "/s"; const qQueryString = url.searchParams.get("q"); const term = props.term || props.slug || qQueryString || undefined; - const response = await api["GET /api/v2/products/search"]({ - term, - sort, - page, - per_page: count, - "tags[]": props.tags, - wildcard: true, - ...Object.fromEntries(typeTags.map(({ key, value }) => [key, value])), - }, STALE); + const priceFilterRegex = /de-(\d+)-a-(\d+)/; + const filterMatch = url.href.match(priceFilterRegex) ?? []; + + const categoryTagName = (props.term || url.pathname.slice(1) || "").split( + "/", + ); + + const properties1 = url.searchParams.getAll("type_tags[property1][]"); + const properties2 = url.searchParams.getAll("type_tags[property2][]"); + const properties3 = url.searchParams.getAll("type_tags[property3][]"); + + const categoryTagNames = Array.from(url.searchParams.values()); + + const tags = await Promise.all([ + ...categoryTagNames, + ...categoryTagName.filter((item): item is string => + typeof item === "string" + ), + ].map((name) => + api["GET /api/v2/tags/:name"]({ name }, STALE) + .then((res) => res.json()) + .catch(() => undefined) + )); + + const categories = tags + .slice(-categoryTagName.length) + .filter((tag): tag is Tag => + typeof tag !== "undefined" && typeof tag.name !== "undefined" + ); + + const filteredTags = tags + .filter((tag): tag is Tag => typeof tag !== "undefined"); + + const { cleanUrl, typeTags } = typeTagExtractor(url, filteredTags); + + const initialTags = props.tags && props.tags?.length > 0 + ? props.tags + : undefined; + + const categoryTagsToFilter = categories.length > 0 && props.filterByTags + ? categories.map((t) => t.name) + .filter((name): name is string => typeof name === "string") + : undefined; + + const defaultOperator = props.filterOperator?.type_tags ?? "and"; + + const preference = categoryTagsToFilter + ? term + : qQueryString ?? url.pathname.slice(1); + + const tag = categories.at(-1); + + const [response, seo = []] = await Promise.all([ + await api["GET /api/v2/products/search"]({ + term: term ?? preference, + sort, + page, + per_page: count, + "tags[]": initialTags ?? categoryTagsToFilter, + wildcard: true, + ...(filterMatch[1] && { min_price: Number(filterMatch[1]) }), + ...(filterMatch[2] && { max_price: Number(filterMatch[2]) }), + "property1_values[]": properties1, + "property2_values[]": properties2, + "property3_values[]": properties3, + ...handleOperator("type_tags", defaultOperator, props.filterOperator), + ...handleOperator("property1", defaultOperator, props.filterOperator), + ...handleOperator("property2", defaultOperator, props.filterOperator), + ...handleOperator("property3", defaultOperator, props.filterOperator), + ...Object.fromEntries( + typeTags.reduce]>>( + (acc, { key, value, isProperty }) => { + if (isProperty) return acc; + + const pos = acc.findIndex((item) => item[0] === key); + + if (pos !== -1) { + acc[pos] = [key, [...acc[pos][1], value]]; + return acc; + } + + return [...acc, [key, [value]]]; + }, + [], + ), + ), + }, STALE), + api["GET /api/v2/seo_data"]( + { resource_type: "Tag", code: tag?.name }, + STALE, + ).then((res) => res.json()) + .catch(() => undefined), + ]); + const pagination = JSON.parse( response.headers.get("x-pagination") ?? "null", ) as ProductSearchResult["pagination"] | null; - const categoryTagName = props.term || url.pathname.split("/").pop() || ""; - const [search, seo, categoryTag] = await Promise.all([ - response.json(), - api["GET /api/v2/seo_data"]({ - resource_type: "Tag", - code: categoryTagName, - type: "category", - }, STALE).then((res) => res.json()), - isSearchPage - ? api["GET /api/v2/tags/:name"]({ name: categoryTagName }, STALE) - .then((res) => res.json()).catch(() => undefined) - : undefined, - ]); + const search = await response.json(); + + const { results: searchResults = [] } = search; + + const validProducts = searchResults.filter(({ variants }) => { + return variants.length !== 0; + }); - const { results: searchResults } = search; - const products = searchResults?.map((product) => - toProduct(product, null, { + const products = validProducts.map((product) => { + return toProduct(product, null, { url, priceCurrency: "BRL", - }) - ); + }); + }); const nextPage = new URLSearchParams(url.searchParams); const previousPage = new URLSearchParams(url.searchParams); @@ -109,21 +233,27 @@ const searchLoader = async ( previousPage.set("page", (page - 1).toString()); } - const hasSEO = !isSearchPage && (seo?.[0] || categoryTag); + const hasTypeTags = !![ + ...typeTags, + ...properties1, + ...properties2, + ...properties3, + ].length; return { "@type": "ProductListingPage", - seo: hasSEO - ? getSEOFromTag({ ...categoryTag, ...seo?.[0] }, req) - : undefined, - // TODO: Find out what's the right breadcrumb on vnda - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement: [], - numberOfItems: 0, - }, + seo: safeJsonSerialize( + getSEOFromTag(categories, url, seo.at(-1), hasTypeTags, isSearchPage), + ), + breadcrumb: isSearchPage + ? { + "@type": "BreadcrumbList", + itemListElement: [], + numberOfItems: 0, + } + : getBreadcrumbList(categories, url), filters: toFilters(search.aggregations, typeTags, cleanUrl), - products: products ?? [], + products, pageInfo: { nextPage: pagination?.next_page ? `?${nextPage}` : undefined, previousPage: pagination?.prev_page ? `?${previousPage}` : undefined, @@ -135,4 +265,52 @@ const searchLoader = async ( }; }; +export const cache = "stale-while-revalidate"; +export const cacheKey = (props: Props, req: Request, _ctx: AppContext) => { + const url = new URL(props.pageHref || req.url); + const qQueryString = url.searchParams.get("q"); + const term = props.term || qQueryString || + undefined; + + if (term) { + return null; + } + + const typeTags = [...url.searchParams.entries()] + .filter(([key]) => key.includes("type_tags")) + .reduce( + (prev, [key, value]) => [...prev, `${key}:${value}`], + [] as string[], + ) + .join("\\"); + + const priceFilterRegex = /de-(\d+)-a-(\d+)/; + const filterMatch = url.href.match(priceFilterRegex); + const filterOperators = [ + props.filterOperator?.property1 ?? "and", + props.filterOperator?.property2 ?? "and", + props.filterOperator?.property3 ?? "and", + props.filterOperator?.type_tags ?? "and", + ]; + + const params = new URLSearchParams([ + ["count", (props.count || url.searchParams.get("count") || 12).toString()], + ["sort", url.searchParams.get("sort") ?? ""], + ["type_tags", typeTags], + ["tags", props?.tags?.join("\\") ?? ""], + [ + "price", + filterMatch ? `min:${filterMatch[1]}_max:${filterMatch[2]}` : "", + ], + ["filterByTags", props.filterByTags ? "true" : "false"], + ["filterOperator", filterOperators.join("\\")], + ["page", (url.searchParams.get("page") ?? 1).toString()], + ]); + + params.sort(); + + url.search = params.toString(); + return url.href; +}; + export default searchLoader; diff --git a/vnda/loaders/proxy.ts b/vnda/loaders/proxy.ts index fc1630d56..20e6a0606 100644 --- a/vnda/loaders/proxy.ts +++ b/vnda/loaders/proxy.ts @@ -16,6 +16,7 @@ const PAGE_PATHS = [ "/conta/*", "/cupom/ajax", "/entrar", + "/entrar/*", "/images/*", "/javascripts/*", "/loja/configuracoes", @@ -24,7 +25,7 @@ const PAGE_PATHS = [ "/recaptcha", "/recuperar_senha", "/sair", - "/sitemap.xml", + "/sitemap/vnda.xml", "/stylesheets/*", "/v/s", "/webform", @@ -34,17 +35,30 @@ const API_PATHS = [ "/api/*", ]; +const decoSiteMapUrl = "/sitemap/deco.xml"; + const VNDA_HOST_HEADER = "X-Shop-Host"; export interface Props { /** @description ex: /p/fale-conosco */ pagesToProxy?: string[]; + generateDecoSiteMap?: boolean; + /** + * @title Exclude paths from /deco-sitemap.xml + */ + excludePathsFromDecoSiteMap?: string[]; + includeSiteMap?: string[]; } /** * @title VNDA Proxy Routes */ function loader( - { pagesToProxy = [] }: Props, + { + pagesToProxy = [], + generateDecoSiteMap, + excludePathsFromDecoSiteMap = [], + includeSiteMap, + }: Props, _req: Request, { publicUrl, account }: AppContext, ): Route[] { @@ -55,6 +69,21 @@ function loader( const customHeaders = [{ key: VNDA_HOST_HEADER, value: url.hostname }]; + const [include, routes] = generateDecoSiteMap + ? [ + [...(includeSiteMap ?? []), decoSiteMapUrl], + [{ + pathTemplate: decoSiteMapUrl, + handler: { + value: { + excludePaths: excludePathsFromDecoSiteMap, + __resolveType: "website/handlers/sitemap.ts", + }, + }, + }], + ] + : [includeSiteMap, []]; + const internalDomainPaths = [ ...PAGE_PATHS, ...pagesToProxy, @@ -65,13 +94,27 @@ function loader( handler: { value: { __resolveType: "website/handlers/proxy.ts", - url: internalDomain, + avoidAppendPath: pathTemplate === "/sitemap/vnda.xml", + url: pathTemplate === "/sitemap/vnda.xml" + ? `https://sitemap.vnda.com.br/preview/${publicUrl}` + : internalDomain, host: url.hostname, customHeaders, }, }, })); + const siteMap = { + pathTemplate: "/sitemap.xml", + handler: { + value: { + include, + __resolveType: "vnda/handlers/sitemap.ts", + customHeaders, + }, + }, + }; + const apiDomainPaths = API_PATHS.map((pathTemplate) => ({ pathTemplate, handler: { @@ -84,7 +127,7 @@ function loader( }, })); - return [...internalDomainPaths, ...apiDomainPaths]; + return [...routes, ...internalDomainPaths, siteMap, ...apiDomainPaths]; } export default loader; diff --git a/vnda/logo.png b/vnda/logo.png new file mode 100644 index 000000000..f78f44c57 Binary files /dev/null and b/vnda/logo.png differ diff --git a/vnda/manifest.gen.ts b/vnda/manifest.gen.ts index 4ee4749cc..cd5093019 100644 --- a/vnda/manifest.gen.ts +++ b/vnda/manifest.gen.ts @@ -2,29 +2,43 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$0 from "./loaders/productList.ts"; -import * as $$$1 from "./loaders/productDetailsPage.ts"; -import * as $$$2 from "./loaders/productListingPage.ts"; -import * as $$$3 from "./loaders/proxy.ts"; -import * as $$$4 from "./loaders/cart.ts"; -import * as $$$$$$$$$0 from "./actions/cart/updateItem.ts"; -import * as $$$$$$$$$1 from "./actions/cart/updateCart.ts"; -import * as $$$$$$$$$2 from "./actions/cart/addItem.ts"; -import * as $$$$$$$$$3 from "./actions/cart/simulation.ts"; +import * as $$$$$$$$$0 from "./actions/cart/addItem.ts"; +import * as $$$$$$$$$1 from "./actions/cart/addItems.ts"; +import * as $$$$$$$$$2 from "./actions/cart/simulation.ts"; +import * as $$$$$$$$$3 from "./actions/cart/updateCart.ts"; +import * as $$$$$$$$$4 from "./actions/cart/updateItem.ts"; +import * as $$$$$$$$$5 from "./actions/notifyme.ts"; +import * as $$$$0 from "./handlers/sitemap.ts"; +import * as $$$0 from "./loaders/cart.ts"; +import * as $$$1 from "./loaders/extensions/price/list.ts"; +import * as $$$2 from "./loaders/extensions/price/listingPage.ts"; +import * as $$$3 from "./loaders/productDetailsPage.ts"; +import * as $$$4 from "./loaders/productDetailsPageVideo.ts"; +import * as $$$5 from "./loaders/productList.ts"; +import * as $$$6 from "./loaders/productListingPage.ts"; +import * as $$$7 from "./loaders/proxy.ts"; const manifest = { "loaders": { - "vnda/loaders/cart.ts": $$$4, - "vnda/loaders/productDetailsPage.ts": $$$1, - "vnda/loaders/productList.ts": $$$0, - "vnda/loaders/productListingPage.ts": $$$2, - "vnda/loaders/proxy.ts": $$$3, + "vnda/loaders/cart.ts": $$$0, + "vnda/loaders/extensions/price/list.ts": $$$1, + "vnda/loaders/extensions/price/listingPage.ts": $$$2, + "vnda/loaders/productDetailsPage.ts": $$$3, + "vnda/loaders/productDetailsPageVideo.ts": $$$4, + "vnda/loaders/productList.ts": $$$5, + "vnda/loaders/productListingPage.ts": $$$6, + "vnda/loaders/proxy.ts": $$$7, + }, + "handlers": { + "vnda/handlers/sitemap.ts": $$$$0, }, "actions": { - "vnda/actions/cart/addItem.ts": $$$$$$$$$2, - "vnda/actions/cart/simulation.ts": $$$$$$$$$3, - "vnda/actions/cart/updateCart.ts": $$$$$$$$$1, - "vnda/actions/cart/updateItem.ts": $$$$$$$$$0, + "vnda/actions/cart/addItem.ts": $$$$$$$$$0, + "vnda/actions/cart/addItems.ts": $$$$$$$$$1, + "vnda/actions/cart/simulation.ts": $$$$$$$$$2, + "vnda/actions/cart/updateCart.ts": $$$$$$$$$3, + "vnda/actions/cart/updateItem.ts": $$$$$$$$$4, + "vnda/actions/notifyme.ts": $$$$$$$$$5, }, "name": "vnda", "baseUrl": import.meta.url, diff --git a/vnda/middleware.ts b/vnda/middleware.ts new file mode 100644 index 000000000..7d6f72b19 --- /dev/null +++ b/vnda/middleware.ts @@ -0,0 +1,29 @@ +import { AppMiddlewareContext } from "./mod.ts"; +import { equal } from "std/testing/asserts.ts"; +import { + buildSegmentCookie, + getSegmentFromBag, + getSegmentFromCookie, + setSegmentCookie, + setSegmentInBag, +} from "./utils/segment.ts"; + +export const middleware = ( + _props: unknown, + req: Request, + ctx: AppMiddlewareContext, +) => { + const segment = getSegmentFromBag(ctx); + if (!segment) { + const segmentFromRequest = buildSegmentCookie(req); + const segmentFromCookie = getSegmentFromCookie(req); + if ( + segmentFromRequest !== null && + !equal(segmentFromRequest, segmentFromCookie) + ) { + setSegmentInBag(ctx, segmentFromRequest); + setSegmentCookie(segmentFromRequest, ctx.response.headers); + } + } + return ctx.next!(); +}; diff --git a/vnda/mod.ts b/vnda/mod.ts index b8d886c7f..515413ae9 100644 --- a/vnda/mod.ts +++ b/vnda/mod.ts @@ -1,10 +1,17 @@ -import type { App, FnContext } from "deco/mod.ts"; +import { Markdown } from "../decohub/components/Markdown.tsx"; import { createHttpClient } from "../utils/http.ts"; +import { PreviewContainer } from "../utils/preview.tsx"; +import type { Secret } from "../website/loaders/secret.ts"; import manifest, { Manifest } from "./manifest.gen.ts"; +import { middleware } from "./middleware.ts"; import { OpenAPI } from "./utils/openapi/vnda.openapi.gen.ts"; - +import { + type App, + type AppMiddlewareContext as AMC, + type FnContext, +} from "@deco/deco"; +export type AppMiddlewareContext = AMC>; export type AppContext = FnContext; - /** @title VNDA */ export interface Props { /** @@ -13,56 +20,83 @@ export interface Props { * @default deco */ account: string; - /** * @title Public store URL * @description Domain that is registered on VNDA * @default www.mystore.com.br */ publicUrl: string; - /** * @description The token generated from admin panel. Read here: https://developers.vnda.com.br/docs/chave-de-acesso-e-requisicoes. Do not add any other permissions than catalog. */ - authToken: string; - + authToken: Secret; /** * @title Use Sandbox * @description Define if sandbox environment should be used */ sandbox: boolean; - /** * @description Use VNDA as backend platform + * @hide true */ platform: "vnda"; + /** @description Here is to put the pathname of the Search Page. Ex: /s. We have default values: "/busca" or "/s" */ + searchPagePath?: string; } - export interface State extends Props { api: ReturnType>; } - export const color = 0x0C29D0; - /** * @title VNDA + * @appName vnda + * @description Manage your e-commerce catalog and sales using VNDA by Olist. + * @category Ecommmerce + * @logo https://assets.decocache.com/mcp/d15a3dfb-145f-4d13-8bdf-a9568b5a33a1/VNDA.svg */ -export default function App(props: Props): App { +export default function VNDA(props: Props): App { const { authToken, publicUrl, sandbox } = props; + const stringAuthToken = typeof authToken === "string" + ? authToken + : authToken?.get?.() ?? ""; const api = createHttpClient({ headers: new Headers({ "User-Agent": "decocx/1.0", "X-Shop-Host": publicUrl, "accept": "application/json", - authorization: `Bearer ${authToken}`, + authorization: `Bearer ${stringAuthToken}`, }), base: sandbox ? "https://api.sandbox.vnda.com.br" : "https://api.vnda.com.br", }); - return { state: { ...props, api }, manifest, + middleware, }; } +export const preview = async () => { + const markdownContent = await Markdown( + new URL("./README.md", import.meta.url).href, + ); + return { + Component: PreviewContainer, + props: { + name: "VNDA", + owner: "deco.cx", + description: + "Loaders, actions and workflows for adding VNDA Commerce Platform to your website.", + logo: "https://raw.githubusercontent.com/deco-cx/apps/main/vnda/logo.png", + images: [ + "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/starting/8deab172-eca8-45dd-85f9-c44f66b1cfb1/Hub_de_Integracao_Tiny_91206b57b3_94dac840e3.webp", + ], + tabs: [ + { + title: "About", + content: markdownContent(), + }, + ], + }, + }; +}; diff --git a/vnda/runtime.ts b/vnda/runtime.ts index 41d65a98d..da42a2435 100644 --- a/vnda/runtime.ts +++ b/vnda/runtime.ts @@ -1,4 +1,3 @@ -import { proxy } from "deco/clients/withManifest.ts"; import { Manifest } from "./manifest.gen.ts"; - +import { proxy } from "@deco/deco/web"; export const invoke = proxy(); diff --git a/vnda/utils/cart.ts b/vnda/utils/cart.ts index d86746b6a..3364e552d 100644 --- a/vnda/utils/cart.ts +++ b/vnda/utils/cart.ts @@ -1,4 +1,5 @@ import { getCookies, setCookie } from "std/http/cookie.ts"; +import { SEGMENT_COOKIE_NAME } from "./segment.ts"; const CART_COOKIE = "vnda_cart_id"; @@ -10,6 +11,12 @@ export const getCartCookie = (headers: Headers): string | undefined => { return cookies[CART_COOKIE]; }; +export const getAgentCookie = (headers: Headers): string | undefined => { + const cookies = getCookies(headers); + + return cookies[SEGMENT_COOKIE_NAME]; +}; + export const setCartCookie = (headers: Headers, cartId: string) => setCookie(headers, { name: CART_COOKIE, diff --git a/vnda/utils/client/client.ts b/vnda/utils/client/client.ts index e1330a71d..85e8c2853 100644 --- a/vnda/utils/client/client.ts +++ b/vnda/utils/client/client.ts @@ -2,6 +2,7 @@ import { Item, OrderForm, ProductGroup, + ProductPrice, ProductSearchResult, RelatedItemTag, SEO, @@ -17,6 +18,12 @@ export interface API { searchParams: { include_images: boolean }; }; + /** @docs https://developers.vnda.com.br/reference/get-api-v2-products-product_id-price */ + "GET /api/v2/products/:productId/price": { + response: ProductPrice; + searchParams: { coupon_codes?: string[] }; + }; + /** @docs https://developers.vnda.com.br/reference/get-api-v2-banners */ "GET /api/v2/banners": { searchParams: { @@ -59,7 +66,8 @@ export interface API { sort?: Sort; per_page?: number; wildcard?: boolean; - } & { [x: string]: unknown }; + type_tags_operator?: string; + } & { [x: string]: unknown | unknown[] }; }; /** @docs https://developers.vnda.com.br/reference/get-api-v2-carts-id */ diff --git a/vnda/utils/client/types.ts b/vnda/utils/client/types.ts index 5a4ddf57f..5accc3d1a 100644 --- a/vnda/utils/client/types.ts +++ b/vnda/utils/client/types.ts @@ -1,3 +1,5 @@ +import { ProductPriceVariant } from "../openapi/vnda.openapi.gen.ts"; + export type Sort = "newest" | "oldest" | "lowest_price" | "highest_price"; export interface ProductSearchResult { @@ -378,9 +380,22 @@ export interface Banner { export interface SEO { id: number; + name?: string; title?: string; description?: string | null; resource_type: string; resource_id: number; parent_id: null | number; } + +export interface ProductPrice { + available: boolean; + on_sale: boolean; + price: number; + sale_price: number; + intl_price: number; + discount_rule?: unknown; + updated_at: string; + installments: Installment[]; + variants: ProductPriceVariant[]; +} diff --git a/vnda/utils/openapi/vnda.openapi.gen.ts b/vnda/utils/openapi/vnda.openapi.gen.ts index 87b463270..6bdf30999 100644 --- a/vnda/utils/openapi/vnda.openapi.gen.ts +++ b/vnda/utils/openapi/vnda.openapi.gen.ts @@ -1,5249 +1,5412 @@ + +// deno-fmt-ignore-file // deno-lint-ignore-file no-explicit-any ban-types ban-unused-ignore // // DO NOT EDIT. This file is generated by deco. // This file SHOULD be checked into source version control. // To generate this file: deno task start -// +// + export interface OpenAPI { - "GET /api/v2/seo_data": { - searchParams: { - resource_type?: string; - resource_id?: number; - type?: string; - code?: string; - }; - response: { - id: number; - title?: string; - description?: string; - resource_type: string; - resource_id: number; - parent_id: number; - }[]; - }; - /** - * Permite autorizar operações usando o access_token e a senha do usuário - */ - "POST /api/v2/users/authorize": { - body: { - access_token: string; - password: string; - }; - }; - /** - * Realiza o login do usuário a partir do email e da senha - */ - "POST /api/v2/users/login": { - body: { - email: string; - password: string; - }; - response: User; - }; - /** - * Realiza o logout do usuário a partir do access_token do mesmo - */ - "POST /api/v2/users/logout": { - body: { - /** - * Token de validação de usuário logado - * - * O `access_token` é gerado quando o usuário loga no Admin - */ - access_token?: string; - }; - }; - /** - * Retorna os dados de um usuário pelo seu ID - */ - "GET /api/v2/users/:id": { - response: User; - }; - /** - * Atualiza um usuário - */ - "PUT /api/v2/users/:id": { - body: { - email?: string; - name?: string; - role_name?: "Agente" | "Gestor" | "Local"; - password?: string; - password_confirmation?: string; - external_code?: string; - phone_area?: string; - phone?: string; - tags?: string[]; - }; - }; - /** - * Retorna as versões da regra de bônus cadastrada - */ - "GET /api/v2/credits/rules/versions": { - response: { - event?: string; - author?: string; - created_at?: string; - ip?: string; - user_agent?: string; - cart_id?: string; - object_changes?: string; - }; - }; - /** - * Retorna as regras de bônus cadastradas - */ - "GET /api/v2/credits/rules": { - response: { - active: boolean; - minimum_subtotal: number; - bonus: number; - delayed_for: number; - valid_for: number; - maximum_usage_factor: number; - }; - }; - /** - * Permite atualizar as regras de bônus - */ - "PUT /api/v2/credits/rules": { - body: { - /** - * Percentual em cima do total do pedido que vai ser dado de bônus para o cliente - */ - bonus: number; - /** - * Número de dias em que o crédito começa a valer - */ - valid_in: number; - /** - * Número de dias para a expiração do crédito - */ - valid_for: number; - /** - * Valor mínimo do pedido para que o bônus possa ser transferido para o cliente - */ - minimum_subtotal?: number; - /** - * Percentual do subtotal do pedido que pode ser pago com o bônus - */ - maximum_usage_factor?: number; - }; - }; - /** - * Permite remover as regras de bônus, desativando o recurso - */ - "DELETE /api/v2/credits/rules": {}; - /** - * Retorna os dados de um pedido usando o `code` ou `token` - */ - "GET /api/v2/orders/:code": { - searchParams: { - /** - * Retorna as formas de entrega do pedido - */ - include_shipping_address?: boolean; - }; - response: Order; - }; - /** - * Retorna uma lista de pedidos - */ - "GET /api/v2/orders": { - searchParams: { - /** - * Retorna os resultados a partir desta data, no formato 'yyyy-mm-dd' - */ - start?: string; - /** - * Retorna os resultados até esta data, no formato 'yyyy-mm-dd' - */ - finish?: string; - /** - * Se "true" retorna somente os pedidos que tenham nota fiscal. Se "false" retorna somente os pedidos que não tenham nota fiscal - */ - invoiced?: boolean; - /** - * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação - */ - page?: number; - /** - * Número máximo de registros que deve ser retornado por página - */ - per_page?: number; - /** - * Array com os códigos de cupons - */ - coupon_codes?: string[]; - /** - * Se "true" inclui o preço dos produtos customizados no total do pedido. Se "false" retorna o total do pedido sem a somatória do preço de produtos customizados. - */ - include_customizations_in_total?: boolean; - }; - response: Order[]; - }; - /** - * Faz a captura do pagamento no adquirente - * Apenas para pedidos pagos com cartão de crédito - */ - "POST /api/v2/orders/:code/capture": { - response: {}; - }; - /** - * Altera o status do pedido para "confirmado" - */ - "POST /api/v2/orders/:code/confirm": { - body: { - /** - * Para cartão de crédito deve ser enviado OBRIGATORIAMENTE o retorno da requisição para "/api/v2/orders/{code}/capture" - */ - confirmation_data?: string; - }; - }; - /** - * Faz o estorno do pagamento no adquirente - * Apenas para pedidos pagos com cartão de crédito - */ - "POST /api/v2/orders/:code/chargeback": {}; - /** - * Altera o status do pedido para "cancelado" - */ - "POST /api/v2/orders/:code/cancel": { - body: { - /** - * Deve ser enviado algo que comprove que o pagamento foi devolvido. - * Para cartão de crédito deve ser enviado OBRIGATORIAMENTE o retorno da requisição para "/api/v2/orders/{code}/chargeback" - */ - cancelation_data?: string; - }; - response: {}; - }; - /** - * Altera o status do pacote para "enviado" - */ - "PATCH /api/v2/orders/:orderCode/packages/:packageCode/ship": {}; - /** - * Altera o pacote para "entregue" - */ - "PATCH /api/v2/orders/:orderCode/packages/:packageCode/deliver": {}; - /** - * Recebe uma lista JSON com os SKUs que devem ser atualizados. A atualização será executada em segundo plano em aproximadamente 1 minuto - */ - "POST /api/v2/variants/quantity": { - body: { - sku: string; - quantity: number; - /** - * Informe somente para atualizar o estoque de um local específico - */ - place_id?: number; - }[]; - }; - /** - * Atualiza o estoque de uma variante de um produto - */ - "POST /api/v2/variants/:sku/quantity": { - searchParams: { - quantity: number; - }; - response: { - status?: string; - }; - }; - /** - * Atualiza o estoque específico de um local - */ - "PATCH /api/v2/variants/:sku/inventories/:placeId": { - searchParams: { - quantity?: number; - }; - response: { - status?: string; - }; - }; - /** - * Permite listar as variantes de um produto - */ - "GET /api/v2/products/:productId/variants": { - response: Variant[]; - }; - /** - * Permite criar uma variante - */ - "POST /api/v2/products/:productId/variants": { - body: { - sku: string; - name?: string; - quantity: number; - main?: boolean; - /** - * Largura do produto, em centímetros - */ - width?: number; - /** - * Altura do produto, em centímetros - */ - height?: number; - /** - * Comprimento do produito, em centímetros - */ - length?: number; - /** - * Massa do produto, em gramas - */ - weight?: number; - /** - * Dias de manuseio da variante - */ - handling_days?: number; - price: number; - /** - * Customização da variante - */ - custom_attributes?: {}; - min_quantity?: number; - norder?: number; - property1?: string; - property2?: string; - property3?: string; - barcode?: string; - }; - response: { - id?: number; - main?: boolean; - available?: boolean; - sku?: string; - name?: string; - slug?: string; - min_quantity?: number; - quantity?: number; - /** - * Quantidade de itens disponíveis - */ - stock?: number; - /** - * Customização da variante - */ - custom_attributes?: {}; - properties?: {}; - /** - * Data e horário da última atualização - */ - updated_at?: string; - price?: number; - installments?: number[]; - available_quantity?: number; - /** - * Massa do produto, em gramas - */ - weight?: number; - /** - * Largura do produto, em centímetros - */ - width?: number; - /** - * Altura do produto, em centímetros - */ - height?: number; - /** - * Comprimento do produito, em centímetros - */ - length?: number; - /** - * Dias de manuseio da variante - */ - handling_days?: number; - inventories?: VariantInventory[]; - sale_price?: number; - image_url?: string; - product_id?: number; - norder?: number; - }; - }; - /** - * Permite remover uma variante - */ - "DELETE /api/v2/products/:productId/variants/:id": {}; - /** - * @deprecated - * Permite atualizar uma variante - */ - "PATCH /api/v2/products/:productId/variants/:id": { - body: { - sku: string; - name?: string; - quantity: number; - main?: boolean; - width?: number; - height?: number; - length?: number; - weight?: number; - handling_days?: number; - price: number; - custom_attributes?: {}; - min_quantity?: number; - norder?: number; - property1?: string; - property2?: string; - property3?: string; - barcode?: string; - quantity_sold?: number; - }; - }; - /** - * Permite determinar a ordem das variantes dentro de cada produto - */ - "POST /api/v2/variants/reorder": { - body: { - /** - * A ordem dos elementos será replicada para as variantes - */ - ids: number[]; - }; - }; - /** - * Retorna um template usando o path dele - */ - "GET /api/v2/templates/:path": { - response: Template; - }; - /** - * Remove um template usando o path dele - */ - "DELETE /api/v2/templates/:path": {}; - /** - * Atualiza o conteúdo de um template usando o path dele - */ - "PATCH /api/v2/templates/:path": { - body: { - body?: string; - }; - }; - /** - * Retorna uma lista de templates - */ - "GET /api/v2/templates": { - response: Template[]; - }; - /** - * Cria um novo template - */ - "POST /api/v2/templates": { - body: { - path: string; - body?: string; - }; - response: Template; - }; - /** - * Reativa um usuário que estiver desativado - */ - "POST /api/v2/users/:id/activate": {}; - /** - * Desativa um usuário - */ - "POST /api/v2/users/:id/deactivate": {}; - /** - * Lista os usuários - */ - "GET /api/v2/users": { - searchParams: { - /** - * Incluir usuários desativados? - */ - include_inactive?: boolean; - /** - * Incluir todas as imagens dos produtos? - */ - include_images?: boolean; - /** - * Exibe somente os usuários com o código externo indicado - */ - external_code?: string; - /** - * Exibe somente os usuários com a função indicada - */ - role_name?: "Agente" | "Gestor" | "Local"; - /** - * Filtra usuários que contenham o valor indicado no nome, telefone, email ou código externo - */ - term?: string; - }; - response: User1[]; - }; - /** - * Cria um usuário - */ - "POST /api/v2/users": { - body: { - email?: string; - name?: string; - role_name?: "Agente" | "Gestor" | "Local"; - password?: string; - password_confirmation?: string; - external_code?: string; - phone_area?: string; - phone?: string; - tags?: string[]; - }; - response: User; - }; - /** - * Lista os usuários - */ - "GET /api/v2/users/tags": { - searchParams: { - /** - * Exibe somente os usuários com a função indicada - */ - role_names?: "Agente" | "Gestor" | "Local" | "Agente Social Selling"; - }; - response: { - tags?: string[]; - }; - }; - /** - * Retorna a lista de carrinhos ativos nos últimos 60 dias - */ - "GET /api/v2/carts": { - searchParams: { - /** - * Número da página - */ - page?: number; - /** - * Quantidade de produtos por página - */ - per_page?: number; - /** - * Inclui os carrinhos sem telefone (não enviar o campo para não incluir) - */ - without_phones?: boolean; - /** - * Filtra os carrinhos que possuem tentativa de pagamento - */ - with_payments?: boolean; - }; - response: Cart[]; - }; - /** - * Permite criar um carrinho - */ - "POST /api/v2/carts": { - body: ParametrosDeCarrinhoResumido; - response: Cart1; - }; - /** - * Permite retornar um carrinho - */ - "GET /api/v2/carts/:id": { - response: Cart1; - }; - /** - * Permite criar um carrinho - */ - "POST /api/v2/carts/:id": { - body: { - agent?: string; - zip?: string; - client_id?: number; - coupon_code?: string; - /** - * DEPRECATED: enviar o `client_id` - */ - email?: string; - rebate_token?: string; - }; - response: Cart1; - }; - /** - * Permite excluir um carrinho - */ - "DELETE /api/v2/carts/:id": {}; - /** - * Permite atualizar os atributos de um carrinho - */ - "PATCH /api/v2/carts/:id": { - body: { - agent?: string; - zip?: string; - client_id?: number; - /** - * DEPRECATED: enviar o `client_id` - */ - email?: string; - rebate_token?: string; - }; - }; - /** - * Permite calcular as parcelas referentes ao total do carrinho - */ - "GET /api/v2/carts/:id/installments": { - response: CartInstallment1[]; - }; - /** - * Lista os locais - */ - "GET /api/v2/places": { - searchParams: { - /** - * Filtra os locais for nome - */ - names?: string[]; - /** - * Filtra os locais que são/não são warehouse - */ - warehouse?: boolean; - /** - * Filtra os locais que contenham determinada categoria - */ - category?: string; - /** - * As lojas mais próximas da coordenada informada serão exibidas primeiro - */ - coordinates?: string; - /** - * As lojas mais próximas do CEP informado serão exibidas primeiro - */ - origin_zip_code?: string; - }; - response: Place[]; - }; - /** - * Cria um local - */ - "POST /api/v2/places": { - body: { - name: string; - address_line_1: string; - address_line_2?: string; - city: string; - neighborhood?: string; - zip?: string; - home_page?: string; - latitude?: number; - longitude?: number; - images?: string[]; - description?: string; - email: string; - first_phone?: string; - second_phone?: string; - mobile_phone?: string; - only_cash?: boolean; - categories?: string[]; - marker_url?: string; - state?: string; - opening_hours?: string; - warehouse?: boolean; - legal_name?: string; - cnpj?: string; - }; - response: Place; - }; - /** - * Remove um local - */ - "DELETE /api/v2/places/:id": {}; - /** - * Atualiza um local - */ - "PATCH /api/v2/places/:id": { - body: { - name: string; - address_line_1: string; - address_line_2?: string; - city: string; - neighborhood?: string; - zip?: string; - home_page?: string; - latitude?: number; - longitude?: number; - images?: string[]; - description?: string; - email: string; - first_phone?: string; - second_phone?: string; - mobile_phone?: string; - only_cash?: boolean; - categories?: string[]; - marker_url?: string; - state?: string; - opening_hours?: string; - warehouse?: boolean; - legal_name?: string; - cnpj?: string; - }; - }; - /** - * Lista as notas fiscais - */ - "GET /api/v2/orders/:code/packages/:packageCode/invoices": { - response: Invoice[]; - }; - /** - * Cria uma nota fiscal - */ - "POST /api/v2/orders/:code/packages/:packageCode/invoices": { - body: { - number: number; - series?: number; - issued_at?: string; - key?: string; - volumes?: number; - }; - response: Invoice; - }; - /** - * Remove uma nota fiscal - */ - "DELETE /api/v2/orders/:code/packages/:packageCode/invoices/:number": {}; - /** - * Atualiza uma nota fiscal - */ - "PATCH /api/v2/orders/:code/packages/:packageCode/invoices/:number": { - body: { - number: number; - series?: number; - issued_at?: string; - key?: string; - volumes?: number; - }; - }; - /** - * Será enviado por email um link para o cadastro da nova senha - * O link tem validade de 24 horas - */ - "POST /api/v2/users/reset_password": { - body: { - email: string; - }; - }; - /** - * Cadastra a nova senha - */ - "PATCH /api/v2/users/reset_password": { - body: { - /** - * Token pare renovação de senha enviado por email - */ - token: string; - /** - * Nova senha para o usuário - */ - password: string; - /** - * Confirmação da nova senha do usuário - */ - password_confirmation: string; - }; - }; - /** - * Retorna o endereço de entrega - */ - "GET /api/v2/orders/:code/shipping_address": { - response: { - id?: number; - first_name: string; - last_name: string; - company_name?: string; - email: string; - /** - * Serão retornados apenas os campos preenchidos - */ - documents?: { - cpf?: string; - cnpj?: string; - ie?: string; - }; - street_name: string; - street_number: string; - complement?: string; - neighborhood: string; - /** - * Somente números - */ - first_phone_area: string; - /** - * Somente números - */ - first_phone: string; - /** - * Somente números - */ - second_phone_area?: string; - /** - * Somente números - */ - second_phone?: string; - reference?: string; - /** - * Somente números - */ - zip: string; - city: string; - state: string; - recipient_name?: string; - }; - }; - /** - * Lista os recebedores - */ - "GET /api/v2/payment_recipients": { - response: PaymentRecipient[]; - }; - /** - * Cria um recebedor - */ - "POST /api/v2/payment_recipients": { - body: { - tag_id?: number; - recipient_id?: number; - percentage: number; - active?: boolean; - charge_processing_fee?: boolean; - liable?: boolean; - code?: string; - place_id?: number; - user_id?: number; - /** - * Indica se o frete deve ser incluído no split do pagamento - */ - include_shipping?: boolean; - }; - response: PaymentRecipient; - }; - /** - * Retorna um recebedor - */ - "GET /api/v2/payment_recipients/:id": { - response: PaymentRecipient; - }; - /** - * Remove um recebedor - */ - "DELETE /api/v2/payment_recipients/:id": {}; - /** - * Atualiza um recebedor - */ - "PATCH /api/v2/payment_recipients/:id": { - body: { - tag_id?: number; - recipient_id?: number; - percentage?: number; - active?: boolean; - charge_processing_fee?: boolean; - liable?: boolean; - code?: string; - place_id?: number; - user_id?: number; - /** - * Indica se o frete deve ser incluído no split do pagamento - */ - include_shipping?: boolean; - }; - }; - /** - * Permite a listagem de recebíveis do usuário - */ - "GET /api/v2/users/:userId/payables": { - response: RecebiveisDoUsuario[]; - }; - /** - * Lista os membros da audiência - */ - "GET /api/v2/audience_members": { - response: AudienceMember[]; - }; - /** - * Permite criar um membro da audiência - */ - "POST /api/v2/audience_members": { - body: { - first_name?: null | string; - last_name?: null | string; - email: string; - phone_area?: null | string; - phone?: null | string; - tags?: string[]; - }; - response: AudienceMember; - }; - /** - * Permite remover um membro da audiência - */ - "DELETE /api/v2/audience_members/:id": {}; - /** - * Permite alterar um membro da audiência - */ - "PATCH /api/v2/audience_members/:id": { - body: { - first_name?: string; - last_name?: string; - email?: string; - phone_area?: string; - phone?: string; - tags?: string[]; - }; - }; - /** - * Lista os rastreios de um pacote de um pedido - */ - "GET /api/v2/orders/:orderCode/packages/:packageCode/trackings": { - response: { - id?: number; - /** - * Código de rastreio do pacote - */ - tracking_code: string; - /** - * Data e horário da última atualização do código de rastreio do pacote - */ - tracked_at?: string; - /** - * URL para rastreio do pedido com a transportadora - */ - url?: string; - /** - * Transportadora do pacote - */ - company?: string; - }; - }; - /** - * Adiciona um rastreio para um pacote de um pedido - */ - "POST /api/v2/orders/:orderCode/packages/:packageCode/trackings": { - body: { - /** - * Código de rastreio - */ - code: string; - /** - * Transportadora - */ - company?: string; - /** - * Link de rastreamento - */ - url?: string; - }; - response: { - /** - * Código de rastreio do pacote - */ - code: string; - /** - * Transportadora - */ - company?: string; - /** - * URL para rastreio do pacote na transportadora - */ - url?: string; - }; - }; - /** - * Remove um rastreio - */ - "DELETE /api/v2/orders/:orderCode/packages/:packageCode/trackings/:id": {}; - /** - * Lista os itens de um carrinho - */ - "GET /api/v2/carts/:cartId/items": { - response: CartItem[]; - }; - /** - * Permite criar um item do carrinho - */ - "POST /api/v2/carts/:cartId/items": { - body: Produto; - response: CartItem; - }; - /** - * Remove um item do carrinho - */ - "DELETE /api/v2/carts/:cartId/items/:id": {}; - /** - * Atualiza um item do carrinho - */ - "PATCH /api/v2/carts/:cartId/items/:id": { - body: { - quantity?: number; - place_id?: number; - extra?: {}; - store_coupon_code?: string; - }; - }; - /** - * Permite adicionar itens em bulk ao carrinho - */ - "POST /api/v2/carts/:cartId/items/bulk": { - body: { - sku: string; - quantity: number; - extra?: {}; - place_id?: number; - /** - * Itens do carrinho - */ - items?: any[][]; - minItems?: 0; - }; - response: CartItem[]; - }; - /** - * Cria uma promoção - */ - "POST /api/v2/discounts": { - body: { - name: string; - start_at: string; - end_at?: string; - valid_to?: "store" | "cart"; - description?: string; - enabled?: boolean; - email?: string; - cpf?: string; - tags?: string; - }; - response: Discount1; - }; - /** - * Retorna uma promoção - */ - "GET /api/v2/discounts/:id": { - response: Discount1; - }; - /** - * Remove uma promoção - */ - "DELETE /api/v2/discounts/:id": {}; - /** - * Altera uma promoção - */ - "PATCH /api/v2/discounts/:id": { - body: { - name: string; - start_at: string; - end_at?: string; - valid_to?: "store" | "cart"; - description?: string; - enabled?: boolean; - email?: string; - cpf?: string; - tags?: string; - }; - }; - /** - * Lista as regras de desconto de uma promoção - */ - "GET /api/v2/discounts/:discountId/rules": { - response: DiscountRule[]; - }; - /** - * Cria uma regra de desconto - */ - "POST /api/v2/discounts/:discountId/rules": { - body: { - apply_to?: "product" | "tag" | "subtotal" | "total" | "shipping"; - amount_type?: "R$" | "%"; - amount?: number; - product_id?: number; - tag_name?: string; - min_quantity?: number; - shipping_method?: string; - min_subtotal?: number; - gift?: boolean; - combinated_product_id?: number; - client_tag?: string; - shipping_rule?: string; - gift_quantity?: number; - agent_tag?: string; - regions?: string[]; - channel?: string[]; - }; - response: { - id?: number; - amount?: number; - apply_to?: "product" | "tag" | "subtotal" | "total" | "shipping"; - min_quantity?: number; - type?: string; - channel?: string[]; - }; - }; - /** - * Remove uma regra de desconto - */ - "DELETE /api/v2/discounts/:discountId/rules/:id": {}; - /** - * Altera uma regra de desconto - */ - "PATCH /api/v2/discounts/:discountId/rules/:id": { - body: { - apply_to?: "product" | "tag" | "subtotal" | "total" | "shipping"; - amount_type?: "R$" | "%"; - amount?: number; - product_id?: number; - tag_id?: number; - min_quantity?: number; - shipping_method?: string; - min_subtotal?: number; - gift?: boolean; - combinated_product_id?: number; - client_tag?: string; - shipping_rule?: string; - gift_quantity?: number; - agent_tag?: string; - regions?: string[]; - channel?: string[]; - }; - }; - /** - * Permite listar os cupons de desconto de uma promoção - */ - "GET /api/v2/discounts/:discountId/coupons": { - searchParams: { - /** - * Filtra os cupons pelo campo uses_per_code - */ - uses_per_code?: number; - }; - response: Coupon[]; - }; - /** - * Cria um cupom de desconto - */ - "POST /api/v2/discounts/:discountId/coupons": { - body: { - code?: string; - uses_per_code?: number; - uses_per_user?: number; - referrer_email?: string; - quantity?: number; - user_id?: number; - }; - response: Coupon; - }; - /** - * Remove um cupom de desconto - */ - "DELETE /api/v2/discounts/:discountId/coupons:id": {}; - /** - * Atualiza um cupom de desconto - */ - "PATCH /api/v2/discounts/:discountId/coupons:id": { - body: { - /** - * Caso deseje um uso ilimitado do cupom, o valor desse campo deverá ser 0 - */ - uses_per_code?: number; - /** - * Caso deseje um uso ilimitado do cupom, o valor desse campo deverá ser 0 - */ - uses_per_user?: number; - }; - }; - /** - * Lista os produtos - */ - "GET /api/v2/products": { - searchParams: { - /** - * Delimita a quantidade de itens retornados - */ - limit?: number; - /** - * Número da página - */ - page?: number; - /** - * Quantidade de produtos por página - */ - per_page?: number; - /** - * Filtra pela referência - */ - reference?: string; - /** - * Filtra pelo ID dos produtos - */ - ids?: string[]; - /** - * Filtra produtos que coném a tag - */ - tag?: string; - /** - * Filtra produtos alterados depois da data - */ - updated_after?: string; - /** - * Exibe os produtos cadastrados recentemente primeiro - */ - sort?: "newest"; - /** - * Inclui os produtos inativos na listagem - */ - include_inactive?: boolean; - /** - * Inclui na requisição se deseja que venham todas as imagens do produto - */ - include_images?: boolean; - }; - response: Product[]; - }; - /** - * Cria um produto - */ - "POST /api/v2/products": { - body: SimpleProduct; - response: { - id?: number; - /** - * Indica se o produto está ativo (`true`) ou inativo (`false`) - */ - active?: boolean & string; - /** - * Código de Referência do produto - */ - reference: string; - /** - * Nome do produto - */ - name: string; - /** - * Descrição do produto - */ - description?: string; - /** - * Lista de tags associadas ao produto - */ - tag_list?: string[]; - slug?: string; - url?: string; - updated_at?: string; - /** - * Tipo de produto, entre: - * - `sample`: amostra - * - `subscription`: assinatura - * - `product`: produto em geral - */ - product_type?: "product" | "sample" | "subscription"; - }; - }; - /** - * Retorna um produto - */ - "GET /api/v2/products/:id": { - searchParams: { - /** - * Lista de cupons para calcular o desconto do produto - */ - coupon_codes?: string[]; - /** - * Se "true", inclui o nome do local nos inventários das variantes - */ - include_inventory_place?: string; - /** - * Se "true", inclui todas as imagens do produto - */ - include_images?: string; - }; - response: Product; - }; - /** - * Remove um produto - */ - "DELETE /api/v2/products/:id": {}; - /** - * Atualiza um produto - */ - "PATCH /api/v2/products/:id": { - body: { - name: string; - description?: string; - active?: boolean; - reference: string; - tag_list?: string; - }; - }; - /** - * Permite atualizar um produto pela referência - */ - "PATCH /api/v2/products/reference/:reference": { - body: { - reference: string; - name: string; - description?: string; - active?: boolean; - product_type?: "product" | "sample" | "subscription"; - }; - }; - /** - * Recebe uma avaliação e recalcula a pontuação atual - */ - "POST /api/v2/products/:id/rate": { - searchParams: { - /** - * Avaliação - */ - rate?: number; - }; - response: { - rating?: string; - votes?: string; - }; - }; - /** - * Busca os produtos de acordo com os parâmetros definidos - */ - "GET /api/v2/products/search": { - searchParams: { - /** - * Número da página - */ - page?: number; - /** - * Quantidade de produtos por página - */ - per_page?: number; - /** - * Filtra pelo ID dos produtos - */ - "ids[]"?: number[]; - /** - * Filtra produtos que contenham o termo - */ - term?: string; - /** - * Permite que o filtro 'term' realize filtragem de produtos por termo parcial - */ - wildcard?: boolean; - /** - * Filtra pelo nome da tag dentro de um tipo de tag. Exemplo, type_tags[cor]=verde - */ - type_tags?: {}; - /** - * Operador lógico para o filtro de tag - */ - type_tags_operator?: "and" | "or"; - /** - * Filtra pelo valor da propriedade 1 - */ - property1_values?: string[]; - /** - * Operador lógico para o filtro de valor da propriedade 1 - */ - property1_operator?: "and" | "or"; - /** - * Filtra pelo valor da propriedade 2 - */ - property2_values?: string[]; - /** - * Operador lógico para o filtro de valor da propriedade 2 - */ - property2_operator?: "and" | "or"; - /** - * Filtra pelo valor da propriedade 3 - */ - property3_values?: string[]; - /** - * Operador lógico para o filtro de valor da propriedade 3 - */ - property3_operator?: "and" | "or"; - /** - * Filtra pelo preço de venda mínimo do produto - */ - min_price?: number; - /** - * Filtra pelo preço de venda máximo do produto - */ - max_price?: number; - /** - * Filtra pelo nome das tags, independente do tipo - */ - "tags[]"?: string[]; - /** - * Filtra pelo nome das tags, independente do tipo - */ - parent_tags?: string[]; - /** - * Filtra por produtos disponíveis - */ - show_only_available?: boolean; - /** - * Ordena o resultado da busca de produtos conforme a opção escolhida - */ - sort?: "newest" | "oldest" | "lowest_price" | "highest_price"; - }; - response: { - results?: ProductSearch[]; - aggregations?: { - min_price?: number; - max_price?: number; - types?: {}; - properties?: { - property1?: { - value?: string; - count?: number; - }[]; - property2?: { - value?: string; - count?: number; - }[]; - property3?: { - value?: string; - count?: number; - }[]; - }; - }; - }; - }; - /** - * Retorna uma variante pelo SKU - */ - "GET /api/v2/variants/:sku": { - response: Variant; - }; - /** - * Permite atualizar uma variante pelo SKU - */ - "PATCH /api/v2/variants/:sku": { - body: { - sku: string; - name?: string; - quantity: number; - main?: boolean; - /** - * Largura do produto, em centímetros - */ - width?: number; - /** - * Altura do produto, em centímetros - */ - height?: number; - /** - * Comprimento do produito, em centímetros - */ - length?: number; - /** - * Massa do produto, em gramas - */ - weight?: number; - /** - * Dias de manuseio da variante - */ - handling_days?: number; - /** - * Preço do item - */ - price: number; - /** - * Customização da variante - */ - custom_attributes?: {}; - min_quantity?: number; - norder?: number; - property1?: VariantProperty1; - property2?: VariantProperty1; - property3?: VariantProperty1; - barcode?: string; - /** - * Quantidade de itens vendidos - */ - quantity_sold?: number; - }; - }; - /** - * Lista as imagens de uma variante passando o SKU da mesma na URL - */ - "GET /api/v2/products/:productId/variants/:sku/images": { - response: { - url: string; - /** - * Data e horário da última atualização da imagem do produto - */ - updated_at: string; - }[]; - }; - /** - * Lista as imagens de uma variante passando o SKU da mesma nos parâmetros - */ - "GET /api/v2/products/:productId/variants/images": { - response: { - url: string; - /** - * Data e horário da última atualização da imagem do produto - */ - updated_at: string; - }[]; - }; - /** - * Calcula o frete para uma determinada variante - */ - "GET /api/v2/variants/:sku/shipping_methods": { - searchParams: { - quantity: number; - zip: string; - }; - response: { - name: string; - value: string; - price: number; - description: string; - delivery_days: number; - value_needed_to_discount: null | number; - shipping_method_id: null | number; - notice: null | string; - fulfillment_company: null | string; - countries: null | { - country?: string; - price?: string; - }[]; - }[]; - }; - /** - * Permite listar as tags - */ - "GET /api/v2/tags": { - searchParams: { - /** - * Indica a quantidade de tags que devem ser listadas (page será ignorado) - */ - limit?: number; - /** - * Número da página - */ - page?: number; - /** - * Quantidade de resultados por página - */ - per_page?: number; - /** - * Exibe somente as tags com o tipo indicado - */ - type?: string; - /** - * Exibe somente as tags com um dos tipos indicados - */ - types?: string[]; - /** - * Exibe somente as tags com um dos nomes indicados - */ - names?: string[]; - /** - * Quando passado qualquer valor filtra as tags que contenham imagens - */ - images?: string; - /** - * Quando passado qualquer valor filtra as tags marcadas para serem exibidas no carrinho - */ - show_in_carts?: string; - /** - * Exibe somente as tags do produto indicado - */ - product_id?: number; - /** - * Texto livre que permite filtrar as tags pelo nome - */ - name?: string; - /** - * String no formato , que determina o campo a ser ordenado e qual a ordem (asc,desc) - */ - sort?: - | "name,asc" - | "name,desc" - | "type,asc" - | "type,desc" - | "title,asc" - | "title,desc" - | "products_count,asc" - | "products_count,desc"; - }; - response: Tag[]; - }; - /** - * Cria uma tag - */ - "POST /api/v2/tags": { - body: { - name: string; - title?: string; - /** - * Equivalente ao subtítulo - */ - blurb?: string; - description?: string; - tag_type?: string; - show_in_carts?: boolean; - }; - response: Tag; - }; - /** - * Lista os tipos de tags usados em alguma tag - */ - "GET /api/v2/tags/types": { - searchParams: { - /** - * Número da página - */ - page?: number; - /** - * Quantidade de resultados por página - */ - per_page?: number; - }; - response: string[]; - }; - /** - * Retorna uma tag - */ - "GET /api/v2/tags/:name": { - response: Tag; - }; - /** - * Remove uma tag - */ - "DELETE /api/v2/tags/:name": {}; - /** - * Permite atualizar uma tag - */ - "PATCH /api/v2/tags/:name": {}; - /** - * Retorna os dados de um cupom usando o seu código - */ - "GET /api/v2/coupon_codes/:code": { - response: { - id: number; - code: string; - discount_id: number; - updated_at: string; - }; - }; - /** - * Cria um pedido no Paypal para que posteriormente possa receber um pagamento - */ - "POST /api/v2/carts/:cartId/payment/paypal": { - response: { - status?: string; - id?: string; - links?: { - href?: string; - rel?: string; - method?: string; - }[]; - }; - }; - /** - * Retorna uma lista de clientes. Caso seja informado o parâmetro "email", então apenas o cliente com esse email será retornado - */ - "GET /api/v2/clients": { - searchParams: { - /** - * Retorna somente o cliente com o email informado - */ - email?: string; - /** - * Número da página - */ - page?: number; - /** - * Registros por página - */ - per_page?: number; - /** - * Filtra os clientes pela menor data de atualização - */ - min_updated_at?: string; - /** - * Filtra os clientes pela maior data de atualização - */ - max_updated_at?: string; - /** - * Data de inicío da filtragem de clientes pela data de aniversário - */ - birthday_start?: string; - /** - * Data final da filtragem de clientes pela data de aniversário - */ - birthday_end?: string; - /** - * Filtra os clientes que possuem telefone - */ - has_phone?: string; - /** - * Filtra os clientes que possuem first name - */ - has_first_name?: string; - /** - * Filtra os clientes por vendedor - */ - user_id?: number; - /** - * Filtra os clientes que possuem o termo em alguns dos campos - */ - term?: string; - /** - * Ordena o resultado da busca de clientes conforme a opção escolhida - */ - sort?: "name" | "birthdate"; - }; - response: Client[]; - }; - /** - * Permite criar um cliente - */ - "POST /api/v2/clients": { - body: { - email?: string; - first_name?: string; - last_name?: string; - birthdate?: string; - gender?: "M" | "F"; - /** - * separado por vírgula - */ - tags?: string; - lists?: string[]; - password?: string; - password_confirmation?: string; - terms?: boolean; - }; - response: { - id?: number; - first_name?: string; - last_name?: string; - email?: string; - gender?: string; - phone_area?: string; - phone?: string; - cpf?: string; - cnpj?: string; - ie?: string; - tags?: string; - lists?: string[]; - facebook_uid?: string; - liked_facebook_page?: boolean; - updated_at?: string; - birthdate?: string; - recent_address?: { - id?: string; - first_name?: string; - last_name?: string; - company_name?: string; - street_name?: string; - street_number?: string; - neighborhood?: string; - complement?: string; - reference?: string; - city?: string; - state?: string; - zip?: string; - first_phone_area?: string; - first_phone?: string; - second_phone_area?: string; - second_phone?: string; - email?: string; - documents?: { - cpf?: string; - cnpj?: string; - }; - }[]; - }; - }; - /** - * Permite retornar as informações do cliente - * O auth_token do cliente pode ser informado no lugar do ID na URL - */ - "GET /api/v2/clients/:id": { - response: Client; - }; - /** - * Permite remover um cliente - */ - "DELETE /api/v2/clients/:id": {}; - /** - * Permite atualizar as informações do cliente - */ - "PATCH /api/v2/clients/:id": { - body: { - email?: string; - first_name?: string; - last_name?: string; - birthdate?: string; - gender?: "M" | "F"; - /** - * separado por vírgula - */ - tags?: string; - lists?: string[]; - password?: string; - password_confirmation?: string; - terms?: boolean; - }; - }; - /** - * Retorna a lista de pedidos do cliente - */ - "GET /api/v2/clients/:id/orders": { - response: Order[]; - }; - /** - * Lista os endereços do cliente utilizados nos pedidos que foram confirmados - */ - "GET /api/v2/clients/:id/addresses": { - searchParams: { - status?: string; - }; - response: Address; - }; - /** - * Lista os endereços cadastrados pelo cliente - */ - "GET /api/v2/clients/:clientId/registered_addresses": { - response: Client1; - }; - /** - * Permite criar um endereço do cliente - */ - "POST /api/v2/clients/:clientId/registered_addresses": { - body: { - street_name?: string; - street_number?: string; - complement?: string; - neighborhood?: string; - label?: string; - zip?: string; - reference?: string; - }; - response: Client1; - }; - /** - * Delete o endereço cadastrado pelo cliente - */ - "DELETE /api/v2/clients/:clientId/registered_addresses/:id": {}; - /** - * Permite atualizar um endereço do cliente - */ - "PATCH /api/v2/clients/:clientId/registered_addresses/:id": { - body: { - street_name?: string; - street_number?: string; - complement?: string; - neighborhood?: string; - label?: string; - zip?: string; - reference?: string; - }; - response: Client1; - }; - /** - * Cria uma senha para o cliente e envia por email - */ - "POST /api/v2/clients/recover_password": { - searchParams: { - /** - * Email do cliente - */ - email: string; - /** - * Preencher para pular o envio do email de senha para o cliente - */ - no_send?: string; - }; - response: Client; - }; - /** - * Retorna o saldo de crétitos do cliente - */ - "GET /api/v2/clients/:id/credits": { - response: { - balance?: number; - }; - }; - /** - * Retorna as transfertências de crétidos realizadas - */ - "GET /api/v2/clients/:id/credits/transfers": { - response: { - from?: { - account?: string; - amount?: number; - }; - to?: { - account?: string; - amount?: number; - }; - }[]; - }; - /** - * Lista os bônus do cliente que ainda não foram utilizados - */ - "GET /api/v2/clients/:id/bonuses": { - searchParams: { - /** - * Número da página - */ - page?: string; - /** - * Registros por página - */ - per_page?: string; - }; - response: Bonus[]; - }; - /** - * Solicita a remoção (esquecimento) dos dados pessoais de um cliente, de acordo com a LGPD - */ - "PATCH /api/v2/clients/:id/remove_personal_data": {}; - /** - * Faz o login do cliente pelo token salvo no campo auth_token - */ - "GET /api/v2/auth/email/:token": { - response: { - id: number; - token: string; - }; - }; - /** - * Faz o login do cliente por usuário e senha - */ - "POST /api/v2/auth/client": { - body: { - email: string; - password: string; - }; - response: { - id: number; - auth_token: string; - }; - }; - /** - * Faz o pagamento do carrinho usando a forma de pagamento informada - */ - "POST /api/v2/carts/:cartId/payment": { - body: { - /** - * Meio de pagamento - */ - payment_method: "pix"; - /** - * Canal de venda do carrinho - */ - channel?: "ecommerce" | "direct"; - }; - }; - /** - * Lista os menus - */ - "GET /api/v2/menus": { - searchParams: { - parent_id?: number; - position?: string; - }; - response: Menu[]; - }; - /** - * Cria um menu - */ - "POST /api/v2/menus": { - body: { - label: string; - tooltip?: string; - description?: string; - type: string; - url?: string; - page_id?: number; - parent_id?: number; - position: string; - new_position?: string; - external?: boolean; - tag_id?: number; - }; - response: Menu; - }; - /** - * Retorna um menu - */ - "GET /api/v2/menus/:id": { - response: Menu; - }; - /** - * Remove um menu - */ - "DELETE /api/v2/menus/:id": {}; - /** - * Atualiza um menu - */ - "PATCH /api/v2/menus/:id": { - body: { - label: string; - tooltip?: string; - description?: string; - type: string; - url?: string; - page_id?: number; - parent_id?: number; - position: string; - new_position?: string; - external?: boolean; - tag_id?: number; - }; - }; - /** - * Lista as posições dos menus - */ - "GET /api/v2/menus/positions": { - response: string[]; - }; - /** - * Reordena os menus na ordem em que seus ids são listados no request - */ - "POST /api/v2/menus/reorder": { - body: { - /** - * A ordem dos elementos será replicada para os menus - */ - ids: number[]; - }; - }; - /** - * Retorna os menus em árvore, organizados pela posição - */ - "GET /api/v2/menus/tree": { - response: { - /** - * Posição - */ - [k: string]: MenuTree[]; - }; - }; - /** - * Retorna uma mensagem do site - */ - "GET /api/v2/site_message": { - response: SiteMessage; - }; - /** - * Remove uma mensagem do site - */ - "DELETE /api/v2/site_message": {}; - /** - * Cria ou atualiza uma mensagem do site - */ - "PATCH /api/v2/site_message": { - body: { - title?: string; - description?: string; - call_to_action?: string; - }; - }; - /** - * Lista as imagens associadas a loja - */ - "GET /api/v2/shop/images": { - searchParams: { - /** - * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação - */ - page?: number; - /** - * Número máximo de registros que deve ser retornado por página - */ - per_page?: number; - /** - * Ordena o resultado da busca de produtos em ordem crescente de cadastro - */ - sort?: "newest"; - }; - response: ShopAsset[]; - }; - /** - * Permite cadastrar uma imagem - */ - "POST /api/v2/shop/images": { - body: { - position?: string; - file_uid?: string; - }; - response: ShopAsset; - }; - /** - * Permite remover uma imagem da loja - */ - "DELETE /api/v2/shop/images/:id": {}; - /** - * Permite adicionar um atributo customizado de produto - */ - "POST /api/v2/shop/product_attributes": { - body: { - index: number; - name: string; - mandatory: boolean; - }; - response: ProductsAttributes; - }; - /** - * Permite listar as personalizações - */ - "GET /api/v2/customizations": { - searchParams: { - /** - * Filtra por produto - */ - product_id?: number; - }; - response: Customization[]; - }; - /** - * Permite criar uma personalização - */ - "POST /api/v2/customizations": { - body: { - group_name: string; - group_type: string; - name: string; - label?: string; - image_uid?: string; - image_name?: string; - price?: number; - quantity?: number; - handling_days?: number; - tag_id: number; - sku?: string; - pattern?: string; - }; - response: Customization; - }; - /** - * Permite retornar uma personalização - */ - "GET /api/v2/customizations/:id": { - response: Customization; - }; - /** - * Permite remover uma personalização - */ - "DELETE /api/v2/customizations/:id": {}; - /** - * Permite alterar uma personalização - */ - "PATCH /api/v2/customizations/:id": { - body: { - group_name?: string; - group_type?: string; - name?: string; - label?: string; - image_uid?: string; - image_name?: string; - price?: string; - quantity?: string; - handling_days?: string; - tag_id?: string; - sku?: string; - pattern?: string; - }; - }; - /** - * Permite listar os itens do pedido - */ - "GET /api/v2/orders/:orderId/items": { - response: OrderItems[]; - }; - /** - * Permite listar as personalizações de cada item do pedido - */ - "GET /api/v2/orders/:orderId/items/:itemId/customizations": { - response: OrderItemCustomization[]; - }; - /** - * Permite listar as personalizações de cada item do carrinho - */ - "GET /api/v2/carts/:cartId/items/:itemId/customizations": { - response: { - [k: string]: CartItemCustomization[]; - }; - }; - /** - * Permite remover uma customização do item do carrinho - */ - "DELETE /api/v2/carts/:cartId/items/:itemId/customizations": {}; - /** - * Lista os mapeamentos - */ - "GET /api/v2/mappings": { - searchParams: { - /** - * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação - */ - page?: number; - /** - * Número máximo de registros que deve ser retornado por página - */ - per_page?: number; - }; - response: Mapping[]; - }; - /** - * Cria um mapeamento - */ - "POST /api/v2/mappings": { - body: { - key: string; - from?: string[]; - to?: string; - }; - response: Mapping; - }; - /** - * Retorna os dados de um mapeamento - */ - "GET /api/v2/mappings/:id": { - response: Mapping; - }; - /** - * Remove um mapeamento - */ - "DELETE /api/v2/mappings/:id": {}; - /** - * Atualiza um mapeamento - */ - "PATCH /api/v2/mappings/:id": { - body: { - key: string; - from?: string[]; - to?: string; - }; - }; - /** - * Retorna a lista de banners - */ - "GET /api/v2/banners": { - searchParams: { - /** - * Booleano indicando para filtrar banners fora do prazo de validade - */ - only_valid?: string; - /** - * Booleano indicando para filtrar banners com prazo de validade expirados - */ - only_expired?: string; - /** - * Booleano indicando para filtrar banners agendados - */ - only_scheduled?: string; - /** - * Lista separada por vírgula com nomes de tags - */ - tag?: string; - /** - * Texto livre que permite filtrar os banners pelo título - */ - title?: string; - /** - * Booleano indicando para não fazer paginação dos resultados - */ - no_paginate?: string; - /** - * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação - */ - page?: number; - /** - * Número máximo de registros que deve ser retornado por página - */ - per_page?: number; - }; - response: Banner[]; - }; - /** - * Retorna os dados de um banner - */ - "GET /api/v2/banners/:id": { - response: Banner; - }; - /** - * Retorna todos os banners disponíveis agrupados por tag - */ - "GET /api/v2/banners/all": { - response: { - [k: string]: SlimBanner[]; - }; - }; - /** - * Permite calcular o frete para pedidos internacionais - */ - "GET /api/v2/carts/:cartId/shipping_methods/intl": { - searchParams: { - /** - * Código do país de destino - */ - country: string; - }; - response: { - "{package_label}"?: ShippingMethods1[]; - }; - }; - /** - * Lista as amostras disponíveis para determinado carrinho - */ - "GET /api/v2/carts/:cartId/samples": { - response: { - id: number; - image_url: null | string; - name: string; - reference: string; - updated_at: string; - url: string; - variants: { - id: number; - main: boolean; - sku: string; - name: string; - updated_at: string; - image_url: null | string; - product_id: number; - norder: number; - }[]; - }; - }; - /** - * Retorna o endereço de entrega - */ - "GET /api/v2/carts/:cartId/shipping_address": { - response: EnderecoDeEnvio; - }; - /** - * Adiciona um endereço de entrega no carrinho - */ - "POST /api/v2/carts/:cartId/shipping_address": { - body: EnderecoDeEnvio1; - response: CartItem; - }; - /** - * Associa um código de cupom ao carrinho - */ - "POST /api/v2/carts/:cartId/coupon_code": { - body: { - /** - * Código do cupom - */ - code: string; - }; - response: { - /** - * Código do cupom - */ - code: string; - discount: number; - rebate_token: string; - rebate_discount: number; - }; - }; - /** - * Lista todos os channels usados nos pedidos criados - */ - "GET /api/v2/orders/channels": { - response: string[]; - }; - /** - * Lista todos os estados usados nos pedidos criados - */ - "GET /api/v2/orders/states": { - response: string[]; - }; - /** - * Retorna o preço do produto e das variantes - */ - "GET /api/v2/products/:productId/price": { - searchParams: { - /** - * Array com os códigos de cupons - */ - coupon_codes?: string[]; - }; - response: { - available: boolean; - on_sale: boolean; - price: number; - sale_price: number; - intl_price: number; - discount_rule?: any; - /** - * @minItems 1 - */ - installments: [ProductInstallment, ...(ProductInstallment)[]]; - /** - * Data e horário da última atualização - */ - updated_at: string; - /** - * @minItems 1 - */ - variants: [ProductPriceVariant, ...(ProductPriceVariant)[]]; - }; - }; - /** - * Lista as imagens do produto - */ - "GET /api/v2/products/:productId/images": { - response: ProductImage[]; - }; - /** - * Cria uma imagem do produto - */ - "POST /api/v2/products/:productId/images": { - body: { - file_url: string; - /** - * IDs da variantes associadas a imagem - */ - variant_ids?: number[]; - }; - response: ProductImage[]; - }; - /** - * Deleta uma imagem do produto - */ - "DELETE /api/v2/products/:productId/images/:id": {}; - /** - * Reordena as imagens do produto - */ - "POST /api/v2/products/:productId/images/reorder": { - body: { - ids: number[]; - }; - }; - /** - * Associa a imagem com uma variante - */ - "POST /api/v2/products/:productId/images/:id/add_variant": { - body: { - variant_id: number; - }; - }; - /** - * Remove a associação da imagem com uma variante - */ - "POST /api/v2/products/:productId/images/:id/remove_variant": { - body: { - variant_id: number; - }; - }; - /** - * Retorna uma lista de pacotes de um pedido - */ - "GET /api/v2/orders/:orderCode/packages": { - response: Package[]; - }; - /** - * Indica para a API que dererminado evento aconteceu e que ela deve disparar as ações relacionadas - */ - "POST /api/v2/events": { - searchParams: { - /** - * Evento que ocorreu - */ - event_type: string; - /** - * ID do recurso selacionado ao evento - */ - id: string; - /** - * IP do usuário - */ - browser_ip?: string; - /** - * User agent do usuário - */ - user_agent?: string; - }; - }; - /** - * Permite a listagem de recebíveis (comissão) de um usuário vendedor da loja, quando ocorre split de pagamentos via Pagarme - */ - "GET /api/v2/users/:id/payables": { - response: RecebiveisDoUsuario[]; - }; - /** - * Retorna um produto pelo código identificador (`product_id`) - */ - "GET /api/v2/products/:productId": { - searchParams: { - /** - * Array com os códigos de cupons - */ - coupon_codes?: string[]; - /** - * Selecione `true` para incluir o nome do local de armazenamento no retorno da requisição - */ - include_inventory_place?: string; - /** - * Selecione `true` para incluir todas as imagens do produto - */ - include_images?: string; - }; - response: Product; - }; - /** - * Remove um produto do catálogo pelo código indentificador (`product_id`) - */ - "DELETE /api/v2/products/:productId": {}; - /** - * Atualiza informações de um produto no catálogo pelo código identificador (`product_id`) - */ - "PATCH /api/v2/products/:productId": { - body: SimpleProduct1; - }; - /** - * Recebe uma avaliação e recalcula a pontuação atual - */ - "POST /api/v2/products/:productId/rate": { - searchParams: { - /** - * Avaliação - */ - rate?: number; - }; - response: { - /** - * Média das avaliações - */ - rating?: string; - /** - * Número de avaliações recebidas - */ - votes?: string; - }; - }; - /** - * Permite remover uma variante - */ - "DELETE /api/v2/products/:productId/variants/:variantId": {}; - /** - * @deprecated - * Atualiza as informações de um variante - */ - "PATCH /api/v2/products/:productId/variants/:variantId": { - body: { - sku: string; - name?: string; - quantity: number; - main?: boolean; - /** - * Massa do produto, em gramas - */ - weight?: number; - /** - * Largura do produto, em centímetros - */ - width?: number; - /** - * Altura do produto, em centímetros - */ - height?: number; - /** - * Comprimento do produito, em centímetros - */ - length?: number; - /** - * Dias de manuseio da variante - */ - handling_days?: number; - price: number; - /** - * Customização da variante - */ - custom_attributes?: {}; - min_quantity?: number; - norder?: number; - property1?: { - name?: string; - value?: string; - defining?: boolean; - }; - property2?: { - name?: string; - value?: string; - defining?: boolean; - }; - property3?: { - name?: string; - value?: string; - defining?: boolean; - }; - barcode?: string; - /** - * Quantidade de itens vendidos - */ - quantity_sold?: number; - }; - }; - /** - * Deleta uma imagem do produto - */ - "DELETE /api/v2/products/:productId/images/:imageId": {}; - /** - * Associa a imagem com uma variante - */ - "POST /api/v2/products/:productId/images/:imageId/add_variant": { - body: { - variant_id: number; - }; - }; - /** - * Remove a associação da imagem com uma variante - */ - "POST /api/v2/products/:productId/images/:imageId/remove_variant": { - body: { - variant_id: number; - }; - }; - /** - * Retorna as informações de um carrinho pelo seu `id` ou `token` - */ - "GET /api/v2/carts/:cartId": { - response: Cart1; - }; - /** - * Permite excluir um carrinho - */ - "DELETE /api/v2/carts/:cartId": {}; - /** - * Permite atualizar os atributos de um carrinho - */ - "PATCH /api/v2/carts/:cartId": { - body: ParametrosDeCarrinhoResumido; - }; - /** - * Remove um item do carrinho - */ - "DELETE /api/v2/carts/:cartId/items/:itemId": {}; - /** - * Atualiza um item do carrinho - */ - "PATCH /api/v2/carts/:cartId/items/:itemId": { - body: Produto1; - }; - /** - * Atualiza o método para o envio dos itens do carrinho - */ - "PATCH /api/v2/carts/:cartId/shipping_methods/:valueMethod": { - body: ShippingMethods1; - }; - /** - * Calculo os método de envio disponíveis para o carrinho - */ - "GET /api/v2/carts/:cartId/shipping_methods": { - response: { - "{package_label}"?: ShippingMethods1[]; - }; - }; - /** - * Calcula as parcelas de pagamento para valor total do carrinho - */ - "GET /api/v2/carts/:cartId/installments": { - response: CartInstallment1[]; - }; - /** - * Retorna os dados de um pedido pelo `code` ou `token` do pedido - */ - "GET /api/v2/orders/:orderCode": { - searchParams: { - /** - * Inclui as formas de entrega do pedido - */ - include_shipping_address?: boolean; - }; - response: Order; - }; - /** - * Atualiza o campo de dados extras de um pedido pelo `code` do pedido - */ - "PATCH /api/v2/orders/:orderCode": { - body: { - /** - * Campo para registro de observações, chave ou valores necessários - */ - extra?: {}; - }; - }; - /** - * Retorna a *timeline* de eventos ocorridos em um pedido - */ - "GET /api/v2/orders/:orderCode/events": { - response: {}[]; - }; - /** - * Retorna a avaliação que o cliente fez em um pedido - */ - "GET /api/v2/orders/:orderCode/reviews": {}; - /** - * Retorna os descontos de um pedido pelo `code` ou `token` do pedido - */ - "GET /api/v2/orders/:orderCode/discounts": { - response: {}[]; - }; - /** - * Retorna o endereço de envio pelo `code` do pedido - */ - "GET /api/v2/orders/:orderCode/shipping_address": { - response: EnderecoDeEnvio1; - }; - /** - * Atualiza dados de endereço do pedido - */ - "PATCH /api/v2/orders/:orderCode/shipping_address": { - body: EnderecoDeEnvio1; - }; - /** - * Captura o pagamento no adquirente para pedidos com pagamento por cartão de crédito. - */ - "POST /api/v2/orders/:orderCode/capture": { - response: {}; - }; - /** - * Confirma um pedido - */ - "POST /api/v2/orders/:orderCode/confirm": { - body: { - /** - * Parâmetro para incluir o retorno [da requisição de captura do pagamento](https://developers.vnda.com.br/reference/post-api-v2-orders-capture). - * Esse parâmetro é **obrigatório** para pedidos com pagamento por cartão de crédito. - */ - confirmation_data?: string; - }; - }; - /** - * Faz o estorno do pagamento no adquirente do cartão de crédito - * Operação válida para pedidos pagos com cartão de crédito - */ - "POST /api/v2/orders/:orderCode/chargeback": {}; - /** - * Altera o status do pedido para `cancelado` - */ - "POST /api/v2/orders/:orderCode/cancel": { - body: { - /** - * Parâmetro para incluir uma confirmação de estorno de pagamento para o cliente. - * Para pedidos com pagamento via cartão de crédito, é obrigatório que nesse campo seja incluído no parâmetro o retorno [da requisição de estorno de pagamento](https://developers.vnda.com.br/reference/post-api-v2-orders-order-code-chargeback). - */ - cancelation_data?: string; - }; - response: {}; - }; - /** - * Retorna os itens de um pedido pelo código do pedido - */ - "GET /api/v2/orders/:orderCode/items": { - response: ProdutoEmUmPedido1[][]; - }; - /** - * Lista as personalizações de um item do pedido pelos códigos do item e do pedido - */ - "GET /api/v2/orders/:orderCode/items/:itemId/customizations": { - response: OrderItemCustomization[]; - }; - /** - * Retorna os pedidos de um cliente pelo seu `id_client` - */ - "GET /api/v2/clients/:idClient/orders": { - response: Order[]; - }; - /** - * Retorna as notas fisicais de um pacote do pedido - */ - "GET /api/v2/orders/:orderCode/packages/:packageCode/invoices": { - response: Invoice[]; - }; - /** - * Inclui nota fiscal no pacote de um pedido - */ - "POST /api/v2/orders/:orderCode/packages/:packageCode/invoices": { - body: Invoice; - response: Invoice; - }; - /** - * Remove uma nota fiscal - */ - "DELETE /api/v2/orders/:orderCode/packages/:packageCode/invoices/:number": {}; - /** - * Atualiza uma nota fiscal - */ - "PATCH /api/v2/orders/:orderCode/packages/:packageCode/invoices/:number": { - body: Invoice; - }; - /** - * Permite listar os pedidos pendentes do feed - */ - "GET /api/feed/orders": { - searchParams: { - /** - * Selecione `true` para incluir o endereço na resposta - */ - include_shipping_address?: true; - /** - * Filtra os pedidos por status - */ - status?: "received" | "confirmed" | "canceled"; - }; - response: Order[]; - }; - /** - * Permite marcar os pedidos para que eles sejam filtrados da listagem do feed - */ - "POST /api/feed/orders": { - body: { - orders?: { - /** - * Código do pedido - */ - code: string; - }[]; - }; - }; +"GET /api/v2/products/:productId/videos": { +response: { +id?: number +url?: string +embed_url?: string +thumbnail_url?: string +updated_at?: number +variant_ids?: number +}[] +} +"GET /api/v2/seo_data": { +searchParams: { +resource_type?: string +resource_id?: number +type?: string +code?: string +} +response: { +id: number +title?: string +description?: string +resource_type: string +resource_id: number +parent_id: number +}[] } /** - * Modelo que representa um usuário na API + * Permite autorizar operações usando o access_token e a senha do usuário */ -export interface User { - /** - * Código identificador do usuário - */ - id?: number; - /** - * Email do usuário - */ - email: string; - /** - * Token de validação de usuário logado (`access_token`) - * - * O `access_token` é gerado quando o usuário loga no Admin - */ - access_token?: string; - /** - * Nome do usuário - */ - name?: string; - /** - * Identificador de usuários administradores - * - * Esse atributo retorna `true` para um usuário administrador do ambiente de loja - */ - admin?: boolean; - /** - * Identificador de usuários que atualizaram a senha inicial - * - * Esse atributo retorna `true` para um usuário que já redefiniu sua senha pelo menos uma vez - */ - renew_password?: boolean; - /** - * Código da função do usuário na loja: - * - * - Agente: `0`; - * - Gestor: `1`; - * - Local: `2`; - * - Agente Social Selling: `3`. - */ - role?: number; - /** - * Tags para agrupamento de usuários - * As tags podem ser são utilizadas para direcionar promoções para determinados usuários, organizar os recebedores em uma divisão de pagamentos, definir regras de comissão - */ - tags?: string[]; - /** - * Código externo do Vendedor. Esse campo é destinado para cadastrar um código de vendedor já existente em outro sistema. - */ - external_code?: string; - /** - * Código de Discagem Direta a Distância (DDD) do telefone do usuário - */ - phone_area?: string; - /** - * Número de telefone do usuário - */ - phone?: string; - /** - * Data de inclusão do usuário no Admin - */ - created_at?: string; - /** - * Data de atualização das informações do usuário - */ - updated_at?: string; +"POST /api/v2/users/authorize": { +body: { +access_token: string +password: string +} } /** - * Modelo que representa um pedido na API + * Realiza o login do usuário a partir do email e da senha */ -export interface Order { - /** - * Desconto por bônus do cliente - */ - rebate_discount: number; - /** - * Código identificador `ID` do desconto por bônus - */ - rebate_token?: string; - /** - * Código identificador `ID` do cliente - */ - user_id?: number; - /** - * Data da última atualização do pedido - */ - updated_at: string; - /** - * Lista com os códigos de rastreio dos pacotes do pedido - */ - tracking_code_list?: string[]; - /** - * Código de rastreio do pacote - */ - tracking_code?: string; - /** - * Valor final do pedido - */ - total: number; - token: string; - taxes: number; - /** - * Valor da soma dos itens do pedido, desconsiderando descontos e frete. - */ - subtotal: number; - /** - * Status do pedido - */ - status: "received" | "confirmed" | "canceled"; - payment_due_date?: string; - slip_url?: string; - slip_token?: string; - slip_due_date?: string; - slip: boolean; - shipping_tracked_at?: string; - shipping_price?: number; - shipping_label?: string; - /** - * Data e horário de envio do pedido - */ - shipped_at: string; - /** - * Data e horário de recebimento do pedido - */ - received_at: string; - payment_tid?: string; - /** - * Método de pagamento do pedido - */ - payment_method: string; - payment_gateway: string; - payment_authorization: string; - /** - * Data e horário do pagamento do pedido - */ - paid_at: string; - items?: ProdutoEmUmPedido[]; - /** - * Parcelas do pagamento parcelado - */ - installments?: number; - /** - * Código identificador do pedido - */ - id?: number; - /** - * Campo de observações do pedido - */ - extra?: {}; - expected_delivery_date?: string; - /** - * Email do cliente - */ - email: string; - /** - * Valor do desconto aplicado no pedido - */ - discount_price: number; - deposit: boolean; - delivery_type?: string; - delivery_message?: string; - /** - * Dias para entrega - */ - delivery_days?: number; - /** - * Data de entrega do pedido - */ - delivered_at: string; - /** - * Código de cupom do pedido - */ - coupon_code: string; - /** - * Data e horário de confirmação do pedido - */ - confirmed_at: string; - /** - * Código do pedido - */ - code: string; - /** - * Código identificador (`ID`) do cliente - */ - client_id: number; - /** - * Canal de venda que originou o pedido - */ - channel: "ecommerce" | "direct"; - /** - * Código identificador do carrinho que originou o pedido - */ - cart_id: number; - /** - * Data de validade do cartão de crédito - */ - card_validity: string; - /** - * Número do cartão de crédito - */ - card_number: string; - /** - * Retorna `true` se o método de pagamento do pedido é por cartão de crédito. - */ - card: boolean; - /** - * Data e horário do cancelamento do pedido - */ - canceled_at?: string; - /** - * Endereço IP de origem do pedido - */ - browser_ip: string; - /** - * Agente do pedido - */ - agent?: string; - affiliate_tag?: string; - pix_qr_code?: string; - /** - * Código de autorização do pagamento - */ - payment_authorization_code?: string; - /** - * Indica se o pedido gerou bônus - */ - bonus_granted?: boolean; - has_split?: boolean; - /** - * Indica se o pedido foi pago usando o Pix - */ - pix: boolean; - ame_qr_code?: string; - /** - * Indica se o pedido foi pago usando o Ame - */ - ame: boolean; - antifraud_assurance?: string; - minItems?: 0; +"POST /api/v2/users/login": { +body: { +email: string +password: string +} +response: User } /** - * Modelo de produto em um pedido + * Realiza o logout do usuário a partir do access_token do mesmo */ -export interface ProdutoEmUmPedido { - extra: {}; - height?: number; - id?: number; - length?: number; - original_price?: number; - package?: string; - picture_url?: string; - place_city?: string; - place_id?: number; - place_name?: string; - price?: number; - product_id: number; - product_name: string; - quantity: number; - reference: string; - sku: string; - total: number; - variant_id: number; - variant_name: string; - weight: number; - width: number; - barcode?: string; -} +"POST /api/v2/users/logout": { +body: { /** - * Modelo que representa uma variante na API + * Token de validação de usuário logado + * + * O `access_token` é gerado quando o usuário loga no Admin */ -export interface Variant { - /** - * Código identificador da variante - */ - id?: number; - /** - * Identifica se é a variante principal do produto. Para `true` a variante é principal e `false` a variante é secundária - */ - main?: boolean; - /** - * Identifica se a variante está ativa em `true` e desativa em `false` - */ - available?: boolean; - /** - * Código SKU da variante - */ - sku?: string; - /** - * Nome da variante - */ - name?: string; - /** - * Slug da URL da variante - */ - slug?: string; - /** - * Quantidade mínima para venda - */ - min_quantity?: number; - /** - * Quantidade física - */ - quantity?: number; - quantity_sold?: number; - /** - * Quantidade disponível - */ - stock?: number; - /** - * Customização da variante - */ - custom_attributes?: {}; - /** - * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante - */ - properties?: { - property1?: VariantProperty; - property2?: VariantProperty; - property3?: VariantProperty; - }; - /** - * Data e horário da última atualização da variante - */ - updated_at?: string; - /** - * Preço do item - */ - price?: number; - /** - * Relação das parcelas para pagamento do item parcelado - */ - installments?: number[]; - /** - * Unidades reservadas e não reservadas do item - */ - available_quantity?: number; - /** - * Massa do produto, em gramas - */ - weight?: number; - /** - * Largura do produto, em centímetros - */ - width?: number; - /** - * Altura do produto, em centímetros - */ - height?: number; - /** - * Comprimento do produito, em centímetros - */ - length?: number; - /** - * Dias de manuseio da variante - */ - handling_days?: number; - /** - * Relação de itens por estoque (armazém) - */ - inventories?: VariantInventory[]; - /** - * Preço promocional - */ - sale_price?: number; - /** - * Preço internacional - */ - intl_price?: number; - /** - * URL da imagem da variante - */ - image_url?: string; - /** - * Código identificador `ID` do produto - */ - product_id?: number; - /** - * Código de barra da variante - */ - barcode?: string; - norder?: number; - required?: []; - additionalProperties?: never; +access_token?: string +} } /** - * Modelo que representa uma propriedade customizada na API + * Retorna os dados de um usuário pelo seu ID */ -export interface VariantProperty { - /** - * Indica se a variante possui uma definição (`true`) ou se a variante não possui (`false`) - */ - defining: boolean; - /** - * Nome da propriedade - */ - name: string; - /** - * Valor da propriedade - */ - value?: string; +"GET /api/v2/users/:id": { +response: User } /** - * Model que representa um inventory da variante + * Atualiza um usuário */ -export interface VariantInventory { - id: number; - name: string; - place_id: number; - /** - * Preço do item - */ - price: number; - quantity: number; - /** - * Quantidade de itens vendidos - */ - quantity_sold: number; - /** - * Preço promocional - */ - sale_price: number; - slug: string; +"PUT /api/v2/users/:id": { +body: { +email?: string +name?: string +role_name?: ("Agente" | "Gestor" | "Local") +password?: string +password_confirmation?: string +external_code?: string +phone_area?: string +phone?: string +tags?: string[] +} } /** - * Modelo que representa um template na API + * Retorna as versões da regra de bônus cadastrada */ -export interface Template { - path: string; - body?: string; - updated_at: string; +"GET /api/v2/credits/rules/versions": { +response: { +event?: string +author?: string +created_at?: string +ip?: string +user_agent?: string +cart_id?: string +object_changes?: string +} } /** - * Modelo que representa um usuário na API + * Retorna as regras de bônus cadastradas */ -export interface User1 { - /** - * Código identificador do usuário - */ - id?: number; - /** - * Email do usuário - */ - email: string; - /** - * Token de validação de usuário logado (`access_token`) - * - * O `access_token` é gerado quando o usuário loga no Admin - */ - access_token?: string; - /** - * Nome do usuário - */ - name?: string; - /** - * Identificador de usuários administradores - * - * Esse atributo retorna `true` para um usuário administrador do ambiente de loja - */ - admin?: boolean; - /** - * Identificador de usuários que atualizaram a senha inicial - * - * Esse atributo retorna `true` para um usuário que já redefiniu sua senha pelo menos uma vez - */ - renew_password?: boolean; - /** - * Código da função do usuário na loja: - * - * - Agente: `0`; - * - Gestor: `1`; - * - Local: `2`; - * - Agente Social Selling: `3`. - */ - role?: number; - /** - * Tags para agrupamento de usuários - * As tags podem ser são utilizadas para direcionar promoções para determinados usuários, organizar os recebedores em uma divisão de pagamentos, definir regras de comissão - */ - tags?: string[]; - /** - * Código externo do Vendedor. Esse campo é destinado para cadastrar um código de vendedor já existente em outro sistema. - */ - external_code?: string; - /** - * Código de Discagem Direta a Distância (DDD) do telefone do usuário - */ - phone_area?: string; - /** - * Número de telefone do usuário - */ - phone?: string; - /** - * Data de inclusão do usuário no Admin - */ - created_at?: string; - /** - * Data de atualização das informações do usuário - */ - updated_at?: string; +"GET /api/v2/credits/rules": { +response: { +active: boolean +minimum_subtotal: number +bonus: number +delayed_for: number +valid_for: number +maximum_usage_factor: number +} } /** - * Modelo que representa um carrinho na API + * Permite atualizar as regras de bônus */ -export interface Cart { - id: number; - email: string; - shipping_method: string; - items_count: number; - quotation_responses_count: number; - payment_responses_count: number; - has_payment_responses: boolean; - has_phone: boolean; - updated_at: string; -} +"PUT /api/v2/credits/rules": { +body: { /** - * Parâmetros criação e atualização de carrinho + * Percentual em cima do total do pedido que vai ser dado de bônus para o cliente */ -export interface ParametrosDeCarrinhoResumido { - /** - * Agente que criou o carrinho - */ - agent?: string; - /** - * Código de Endereçamento Postal (CEP) do destinatário do pedido - */ - zip?: string; - /** - * Código identificador `ID` do cliente - */ - client_id?: number; - /** - * Código identificador `ID` do desconto do carrinho - */ - coupon_code?: string; - /** - * @deprecated - * Email do cliente - */ - email?: string; - /** - * Token do desconto - */ - rebate_token?: string; -} +bonus: number /** - * Modelo que representa um carrinho na API + * Número de dias em que o crédito começa a valer */ -export interface Cart1 { - /** - * Agente que criou o carrinho - */ - agent: string; - /** - * Código identificador `ID` do endereço de cobrança do carrinho - */ - billing_address_id: number; - /** - * Canal de venda que originou o carrinho - */ - channel: string; - /** - * Código identificador `ID` do cliente - */ - client_id: number; - /** - * Código identificador `ID` do carrinho - */ - code: string; - /** - * Código de cupom de desconto utilizado no carrinho - */ - coupon_code: string; - discount: Discount; - /** - * @deprecated - * Valor do desconto - */ - discount_price: number; - /** - * Campo para registro de observações, chave ou valores necessários - */ - extra: {}; - /** - * Código identificador `ID` do carrinho - */ - id: number; - /** - * Itens do carrinho - */ - items: CartItem[]; - /** - * Unidades do item no carrinho - */ - items_count: number; - /** - * Código identificador `ID` do endereço de entrega do carrinho - */ - shipping_address_id: number; - /** - * Método de envio selecionado para o carrinho, como por exemplo: normal, expressa e agendada. - */ - shipping_method: string; - /** - * Lista com as entregas disponíveis para os itens do carrinho de acordo com o endereço de envio - */ - shipping_methods: ShippingMethods[]; - /** - * Preço de envio - */ - shipping_price: number; - /** - * Valor da soma dos itens do carrinho, sem considerar descontos de cupom, carrinho e frete. - */ - subtotal: number; - /** - * Token do carrinho - */ - token: string; - /** - * Valor final do carrinho - */ - total: number; - /** - * Valor total do carrinho para pagamento por depósito - */ - total_for_deposit: number; - /** - * Valor total do carrinho para pagamento por boleto - */ - total_for_slip: number; - /** - * Valor do carrinho para pagamento por PIX - */ - total_for_pix: number; - /** - * Data da última atualização do carrinho - */ - updated_at: string; - /** - * Código identificador `ID` do desconto por bônus - */ - rebate_token: string; - /** - * Desconto por bônus do cliente - */ - rebate_discount: number; - /** - * Número de dias para manuseio dos itens - */ - handling_days: number; - /** - * Valor de desconto de promoções aplicadas ao subtotal do carrinho - */ - subtotal_discount: number; - /** - * Valor de desconto de promoções aplicadas ao valor total do carrinho - */ - total_discount: number; - installments?: CartInstallment; - /** - * Código identificador `ID` do cliente - */ - user_id?: string; - minItems?: 0; -} +valid_in: number /** - * Promoção aplicada no carrinho + * Número de dias para a expiração do crédito */ -export interface Discount { - id: number; - name: string; - description: string; - facebook: boolean; - valid_to: "store" | "cart"; - /** - * DEPRECATED - */ - seal_uid: string; - /** - * DEPRECATED - */ - seal_url: string; - start_at: string; - end_at: string; - email: string; - cpf: string; - tags: string; -} +valid_for: number /** - * Modelo que representa um item no carrinho na API + * Valor mínimo do pedido para que o bônus possa ser transferido para o cliente */ -export interface CartItem { - /** - * Unidades disponíveis do produto - */ - available_quantity: number; - /** - * Número de dias para a entrega - */ - delivery_days: number; - /** - * Campo para registro de observações, chave ou valores necessários - */ - extra: {}; - /** - * Código identificador do local do produto - */ - place_id: number; - /** - * Preço do produto - */ - price: number; - /** - * Preço internacional - */ - intl_price: number; - /** - * Código identificador `ID` do produto - */ - product_id: number; - /** - * Nome do produto - */ - product_name: string; - /** - * Código de referência do produto - */ - product_reference: string; - /** - * URL do produto no e-commerce - */ - product_url: string; - /** - * Unidades do produto no carrinho - */ - quantity: number; - /** - * Identificador do seller - */ - seller: string; - /** - * Nome do seller - */ - seller_name: string; - /** - * Valor do produto sem descontos e promoções - */ - subtotal: number; - /** - * Valor total do produto - */ - total: number; - /** - * Data da última atualização do carrinho - */ - updated_at: string; - /** - * Atributos da variante - */ - variant_attributes: {}; - /** - * Quantidade miníma de variantes para compra - */ - variant_min_quantity: number; - /** - * Nome da variante - */ - variant_name: string; - /** - * Preço da variante - */ - variant_price: number; - /** - * Preço internacional da variante - */ - variant_intl_price: number; - variant_properties: Variant1; - /** - * Código SKU da [Variante](https://developers.vnda.com.br/docs/cat%C3%A1logo-de-produtos#produto-atributo-e-variante) - */ - variant_sku: string; - /** - * Código identificador do item no carrinho - */ - id?: string; - /** - * Tipo de produto - */ - product_type?: string; - /** - * URL da imagem da variante - */ - image_url?: string; -} +minimum_subtotal?: number /** - * Modelo que representa uma variante na API + * Percentual do subtotal do pedido que pode ser pago com o bônus */ -export interface Variant1 { - /** - * Código identificador da variante - */ - id?: number; - /** - * Identifica se é a variante principal do produto. Para `true` a variante é principal e `false` a variante é secundária - */ - main?: boolean; - /** - * Identifica se a variante está ativa em `true` e desativa em `false` - */ - available?: boolean; - /** - * Código SKU da variante - */ - sku?: string; - /** - * Nome da variante - */ - name?: string; - /** - * Slug da URL da variante - */ - slug?: string; - /** - * Quantidade mínima para venda - */ - min_quantity?: number; - /** - * Quantidade física - */ - quantity?: number; - quantity_sold?: number; - /** - * Quantidade disponível - */ - stock?: number; - /** - * Customização da variante - */ - custom_attributes?: {}; - /** - * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante - */ - properties?: { - property1?: VariantProperty; - property2?: VariantProperty; - property3?: VariantProperty; - }; - /** - * Data e horário da última atualização da variante - */ - updated_at?: string; - /** - * Preço do item - */ - price?: number; - /** - * Relação das parcelas para pagamento do item parcelado - */ - installments?: number[]; - /** - * Unidades reservadas e não reservadas do item - */ - available_quantity?: number; - /** - * Massa do produto, em gramas - */ - weight?: number; - /** - * Largura do produto, em centímetros - */ - width?: number; - /** - * Altura do produto, em centímetros - */ - height?: number; - /** - * Comprimento do produito, em centímetros - */ - length?: number; - /** - * Dias de manuseio da variante - */ - handling_days?: number; - /** - * Relação de itens por estoque (armazém) - */ - inventories?: VariantInventory[]; - /** - * Preço promocional - */ - sale_price?: number; - /** - * Preço internacional - */ - intl_price?: number; - /** - * URL da imagem da variante - */ - image_url?: string; - /** - * Código identificador `ID` do produto - */ - product_id?: number; - /** - * Código de barra da variante - */ - barcode?: string; - norder?: number; - required?: []; - additionalProperties?: never; +maximum_usage_factor?: number +} } /** - * Modelo que representa as formas de entrega na API + * Permite remover as regras de bônus, desativando o recurso */ -export interface ShippingMethods { - package: string; - name: string; - label: string; - price: string; - delivery_days: string; - delivery_type: string; - description: string; - short_description: string; - fulfillment_company: string; +"DELETE /api/v2/credits/rules": { + } /** - * Parcelas para pagamento parcelado + * Retorna os dados de um pedido usando o `code` ou `token` */ -export interface CartInstallment { - /** - * Identifica se há (`true`) ou não (`false`) juros no parcelamento - */ - interest: boolean; - /** - * Taxa de juros do parcelamento - */ - interest_rate: number; - /** - * Número de parcelas - */ - number: number; - /** - * Valor de cada parcela - */ - price: number; - /** - * Valor total das parcelas - */ - total: number; -} +"GET /api/v2/orders/:code": { +searchParams: { /** - * Modelo que representa uma parcela do total de um carrinho + * Retorna as formas de entrega do pedido */ -export interface CartInstallment1 { - /** - * Identifica se há (`true`) ou não (`false`) juros no parcelamento - */ - interest: boolean; - /** - * Taxa de juros do parcelamento - */ - interest_rate: number; - /** - * Número de parcelas - */ - number: number; - /** - * Valor de cada parcela - */ - price: number; - /** - * Valor total das parcelas - */ - total: number; +include_shipping_address?: boolean +} +response: Order } /** - * Modelo que representa um local na API + * Retorna uma lista de pedidos */ -export interface Place { - id?: number; - name: string; - address_line_1: string; - address_line_2?: string; - city: string; - neighborhood?: string; - zip?: string; - home_page?: string; - latitude?: number; - longitude?: number; - images?: string[]; - description?: string; - email: string; - first_phone?: string; - second_phone?: string; - mobile_phone?: string; - only_cash?: boolean; - categories?: string[]; - marker_url?: string; - state?: string; - created_at?: string; - updated_at?: string; - opening_hours?: string; - warehouse?: boolean; - legal_name?: string; - cnpj?: string; -} +"GET /api/v2/orders": { +searchParams: { /** - * Modelo que representa uma nota fiscal na API + * Retorna os resultados a partir desta data, no formato 'yyyy-mm-dd' */ -export interface Invoice { - /** - * Número da nota fiscal - */ - number: number; - /** - * Número de série da nota fiscal - */ - series?: number; - /** - * Data e horário da criação da nota fiscal - */ - issued_at?: string; - /** - * Chave da nota fiscal - */ - key?: string; - volumes?: number; -} +start?: string /** - * Modelo que representa um recebedor na API + * Retorna os resultados até esta data, no formato 'yyyy-mm-dd' */ -export interface PaymentRecipient { - id: number; - percentage: number; - active?: boolean; - charge_processing_fee?: boolean; - liable?: boolean; - code?: string; - name?: string; - tag_name?: string; - place_id?: number; - recipient_id: number; - tag_id?: number; - user_id?: number; - /** - * Indica se o frete deve ser incluído no split do pagamento - */ - include_shipping?: boolean; -} +finish?: string /** - * Valores que o usuário possui a receber + * Se "true" retorna somente os pedidos que tenham nota fiscal. Se "false" retorna somente os pedidos que não tenham nota fiscal */ -export interface RecebiveisDoUsuario { - type?: string; - status?: string; - amount?: number; - fee?: number; - installment?: number; - credit_date?: string; - order_date?: string; - transaction_id?: number; -} +invoiced?: boolean /** - * Modelo que representa um membro do público + * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação */ -export interface AudienceMember { - id?: number; - first_name?: string; - last_name?: string; - email: string; - phone_area?: string; - phone?: string; - tags?: string[]; -} +page?: number /** - * Modelo de carcaterística de produto para item no carrinho + * Número máximo de registros que deve ser retornado por página */ -export interface Produto { - sku: string; - quantity: number; - extra?: {}; - place_id?: number; - store_coupon_code?: string; - customizations?: any[]; -} +per_page?: number /** - * Modelo que representa uma promoção na API + * Array com os códigos de cupons */ -export interface Discount1 { - /** - * Código identificador `ID` do desconto - */ - id?: number; - /** - * Nome do desconto ou promoção - */ - name: string; - /** - * Descrição do desconto - */ - description?: string; - /** - * Data de início da regra do desconto - */ - start_at: string; - /** - * Data de fim da regra do desconto - */ - end_at?: string; - /** - * Indica se o desconto está habilitado (`true`) ou desabilitado (`false`) - */ - enabled: boolean; - /** - * Em desuso - */ - facebook?: boolean; - /** - * Indica a regra da promoção: se o desconto é aplicado na vitrine ou no carrinho da loja - */ - valid_to?: string; - /** - * Email do cliente, no caso de promoções direcionadas para clientes específicos - */ - email?: string; - /** - * Cadastro de Pessoa Física (CPF) do cliente, no caso de promoções direcionadas para clientes específicos - */ - cpf?: string; - /** - * Tag de agrupamento de promoção - */ - tags?: string; -} +coupon_codes?: string[] /** - * Modelo que representa uma regra de desconto na API + * Se "true" inclui o preço dos produtos customizados no total do pedido. Se "false" retorna o total do pedido sem a somatória do preço de produtos customizados. */ -export interface DiscountRule { - id?: number; - amount: number; - type: "fixed" | "percentage"; - apply_to: string; - min_quantity: number; - product?: { - id?: number; - reference?: string; - name?: string; - }; - tag?: { - name?: string; - }; - combined_product?: { - id?: number; - reference?: string; - name?: string; - }; - min_subtotal: number; - shipping_method?: string; - shipping_rule?: "any" | "all"; - regions?: string[]; - agent_tag?: string; - channel?: string[]; +include_customizations_in_total?: boolean +} +response: Order[] } /** - * Modelo que representa um cupom de desconto + * Faz a captura do pagamento no adquirente + * Apenas para pedidos pagos com cartão de crédito */ -export interface Coupon { - id?: number; - code?: string; - uses_per_code?: number; - uses_per_user?: number; - referrer_email?: string; - user_id?: number; - updated_at?: string; - orders_count?: number; +"POST /api/v2/orders/:code/capture": { +response: { + +} } /** - * Modelo que representa um produto na API + * Altera o status do pedido para "confirmado" */ -export interface Product { - /** - * Código identificador `ID` do priduto - */ - id?: number; - /** - * Indica se o produto está ativo (`true`) ou invativo (`false`) - */ - active?: boolean; - /** - * Indica se o produto está disponível (`true`) ou indisponível (`false`) - */ - available?: boolean; - category_tags?: { - /** - * Tipo de tag - */ - tag_type?: string; - /** - * Nome da tag - */ - name?: string; - /** - * Título da tag - */ - title?: string; - }[]; - /** - * Descrição do produto - */ - description?: string; - /** - * Código de desconto - */ - discount_id?: number; - /** - * Descrição do produto em HTML - */ - html_description?: string; - /** - * URL da imagem do produto - */ - image_url?: string; - /** - * Relação das parcelas para pagamento parcelado - */ - installments?: number[]; - /** - * Quantidade mínima para venda do produto - */ - min_quantity?: string; - /** - * Nome do produto - */ - name?: string; - /** - * Indica se o produto está em promoção (`true`) ou não (`false`) - */ - on_sale?: boolean; - /** - * Descrição simplificada - */ - plain_description?: string; - /** - * Preço do item - */ - price?: number; - /** - * Média de avaliação do produto - */ - rating?: { - rating?: number; - votes?: number; - }; - /** - * Código de referência do produto - */ - reference?: string; - /** - * Preço promocional - */ - sale_price?: number; - /** - * slug do produto - */ - slug?: string; - /** - * Lista de tags que o produto é associado - */ - tag_names?: string[]; - /** - * Data e horário da última atualização do produto - */ - updated_at?: string; - /** - * URL do produto - */ - url?: string; - /** - * Variantes do produto - */ - variants?: { - "{id}"?: ProductVariant; - }[]; - /** - * Regras de desconto de uma promoção - */ - discount_rule: { - type: "fixed" | "percentage"; - amount: number; - }; - /** - * Imagens do produto - */ - images?: { - /** - * id do produto - */ - id?: number; - /** - * Url do produto - */ - url?: string; - /** - * Data e horário da última atualização do produto - */ - updated_at?: string; - variant_ids?: {}[]; - }[]; +"POST /api/v2/orders/:code/confirm": { +body: { +/** + * Para cartão de crédito deve ser enviado OBRIGATORIAMENTE o retorno da requisição para "/api/v2/orders/{code}/capture" + */ +confirmation_data?: string +} } /** - * Modelo que representa uma variante na API + * Faz o estorno do pagamento no adquirente + * Apenas para pedidos pagos com cartão de crédito */ -export interface ProductVariant { - available: boolean; - available_quantity: number; - /** - * Customização da variante - */ - custom_attributes: {}; - /** - * Dias de manuseio da variante - */ - handling_days: number; - height: number; - id?: number; - /** - * URL da imagem da variante - */ - image_url: string; - installments: number[]; - inventories?: ProductVariantInventory[]; - length: number; - main: boolean; - /** - * Quantidade mínima para venda - */ - min_quantity: number; - /** - * Nome da variante - */ - name: string; - norder: number; - /** - * Preço do item - */ - price: number; - product_id: number; - /** - * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante - */ - properties: { - property1?: VariantProperty; - property2?: VariantProperty; - property3?: VariantProperty; - }; - quantity: number; - /** - * Quantidade de itens vendidos - */ - quantity_sold?: number; - /** - * Preço promocional - */ - sale_price: number; - sku: string; - slug: string; - /** - * Quantidade de itens disponíveis - */ - stock: number; - /** - * Data e horário da última atualização da variante - */ - updated_at: string; - /** - * Massa do produto, em gramas - */ - weight: number; - /** - * Largura do produto, em centímetros - */ - width: number; - required?: []; - additionalProperties?: never; +"POST /api/v2/orders/:code/chargeback": { + } /** - * Modelo que representa um inventory da variante na API + * Altera o status do pedido para "cancelado" */ -export interface ProductVariantInventory { - /** - * Código identificador `ID` do inventário - */ - id: number; - /** - * Nome do inventário - */ - name?: string; - /** - * Código identificador do local - */ - place_id: number; - /** - * Nome do local - */ - place_name?: string; - /** - * Preço do item - */ - price: number; - /** - * Quantidade de itens no inventário - */ - quantity: number; - /** - * Quantidade de itens vendidos - */ - quantity_sold: number; - /** - * Preço promocional - */ - sale_price: number; - /** - * Slug do inventário - */ - slug: string; - /** - * Data e horário da última atualização da variante no inventário - */ - updated_at: string; - /** - * Código da variante - */ - variant_id: number; - /** - * Data de criação do inventário - */ - created_at: string; +"POST /api/v2/orders/:code/cancel": { +body: { +/** + * Deve ser enviado algo que comprove que o pagamento foi devolvido. + * Para cartão de crédito deve ser enviado OBRIGATORIAMENTE o retorno da requisição para "/api/v2/orders/{code}/chargeback" + */ +cancelation_data?: string +} +response: { + +} } /** - * Modelo simplificado de um produto para atualização e criação + * Altera o status do pacote para "enviado" */ -export interface SimpleProduct { - name: string; - description?: string; - active?: boolean; - reference: string; - tag_list?: string; +"PATCH /api/v2/orders/:orderCode/packages/:packageCode/ship": { + } /** - * Modelo que representa um produto retornado via busca no Elasticsearch + * Altera o pacote para "entregue" */ -export interface ProductSearch { - id: number; - active: boolean; - available: boolean; - subscription: boolean; - slug: string; - reference: string; - reference_lowercase: string; - name: string; - description: string; - image_url: string; - url: string; - tags: { - name: string; - title: string; - subtitle: string; - description: string; - importance: number; - type: string; - image_url: string; - }[]; - /** - * Preço do item - */ - price: number; - on_sale: boolean; - /** - * Preço promocional - */ - sale_price: number; - intl_price: number; - discount_id: number; - discount_rule: { - type: "fixed" | "percentage"; - amount: number; - }; - discount: { - name: string; - description: string; - /** - * Em desuso - */ - facebook: boolean; - valid_to: string; - }; - images: { - sku: string; - url: string; - }[]; - variants: VariantProductSearch[]; - installments: ProductInstallment[]; - created_at: string; - /** - * Data e horário da última atualização do produto - */ - updated_at: string; +"PATCH /api/v2/orders/:orderCode/packages/:packageCode/deliver": { + } /** - * Modelo que representa uma variante retornada via busca no Elasticsearch + * Recebe uma lista JSON com os SKUs que devem ser atualizados. A atualização será executada em segundo plano em aproximadamente 1 minuto */ -export interface VariantProductSearch { - id: number; - sku: string; - sku_lowercase: string; - name: string; - full_name: string; - main: boolean; - available: boolean; - image_url: string; - /** - * Preço do item - */ - price: number; - /** - * Preço promocional - */ - sale_price: number; - intl_price: number; - installments: ProductInstallment[]; - /** - * Quantidade de itens disponíveis - */ - stock: number; - quantity: number; - /** - * Quantidade de itens vendidos - */ - quantity_sold: number; - /** - * Quantidade mínima para venda - */ - min_quantity: number; - available_quantity: number; - /** - * Customização da variante - */ - custom_attributes: {}; - /** - * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante - */ - properties: { - property1?: VariantPropertyProductSearch; - property2?: VariantPropertyProductSearch; - property3?: VariantPropertyProductSearch; - }; - inventories: { - name: string; - slug: string; - available: boolean; - /** - * Preço do item - */ - price: number; - /** - * Preço promocional - */ - sale_price: number; - quantity: number; - /** - * Quantidade de itens vendidos - */ - quantity_sold: number; - place: { - id: number; - name: string; - }; - }[]; - /** - * Dias de manuseio da variante - */ - handling_days: number; - barcode: string; - /** - * Massa do produto, em gramas - */ - weight: number; - /** - * Largura do produto, em centímetros - */ - width: number; - /** - * Altura do produto, em centímetros - */ - height: number; - /** - * Comprimento do produito, em centímetros - */ - length: number; - required?: []; - additionalProperties?: never; +"POST /api/v2/variants/quantity": { +body: { +sku: string +quantity: number +/** + * Informe somente para atualizar o estoque de um local específico + */ +place_id?: number +}[] } /** - * Modelo que representa uma parcela + * Atualiza o estoque de uma variante de um produto */ -export interface ProductInstallment { - number: number; - /** - * Preço do item - */ - price: number; - interest: boolean; - interest_rate: number; - total: number; +"POST /api/v2/variants/:sku/quantity": { +searchParams: { +quantity: number +} +response: { +status?: string +} } /** - * Modelo que representa uma propriedade de uma variante quando retornada via Elasticsearch + * Atualiza o estoque específico de um local */ -export interface VariantPropertyProductSearch { - name: string; - value: string; - defining: boolean; +"PATCH /api/v2/variants/:sku/inventories/:placeId": { +searchParams: { +quantity?: number +} +response: { +status?: string +} } /** - * Modelo que representa uma propriedade de uma variante + * Permite listar as variantes de um produto */ -export interface VariantProperty1 { - /** - * Nome da propriedade - */ - name: string; - /** - * Valor da propriedade - */ - value: string; - /** - * Indica se a variante possui uma definição (`true`) ou se a variante não possui (`false`) - */ - defining: boolean; +"GET /api/v2/products/:productId/variants": { +response: Variant[] } /** - * Modelo que representa uma tag na API + * Permite criar uma variante */ -export interface Tag { - name: string; - title?: string; - subtitle?: string; - description?: string; - type?: string; - products_count?: number; - image_url?: string; - updated_at?: string; +"POST /api/v2/products/:productId/variants": { +body: { +sku: string +name?: string +quantity: number +main?: boolean +/** + * Largura do produto, em centímetros + */ +width?: number +/** + * Altura do produto, em centímetros + */ +height?: number +/** + * Comprimento do produito, em centímetros + */ +length?: number +/** + * Massa do produto, em gramas + */ +weight?: number +/** + * Dias de manuseio da variante + */ +handling_days?: number +price: number +/** + * Customização da variante + */ +custom_attributes?: { + +} +min_quantity?: number +norder?: number +property1?: string +property2?: string +property3?: string +barcode?: string } +response: { +id?: number +main?: boolean +available?: boolean +sku?: string +name?: string +slug?: string +min_quantity?: number +quantity?: number /** - * Modelo que representa um cliente na API + * Quantidade de itens disponíveis */ -export interface Client { - id?: number; - first_name?: string; - last_name?: string; - email?: string; - gender?: string; - phone_area?: string; - phone?: string; - document_type?: "CPF" | "CNPJ"; - /** - * Número de documento cadastrado pelo cliente - */ - document_number?: string; - cpf?: string; - cnpj?: string; - ie?: string; - tags?: string; - lists?: string[]; - facebook_uid?: string; - liked_facebook_page?: boolean; - updated_at?: string; - birthdate?: string; - recent_address?: { - id?: string; - first_name?: string; - last_name?: string; - company_name?: string; - street_name?: string; - street_number?: string; - neighborhood?: string; - complement?: string; - reference?: string; - city?: string; - state?: string; - zip?: string; - first_phone_area?: string; - first_phone?: string; - second_phone_area?: string; - second_phone?: string; - email?: string; - documents?: { - cpf?: string; - cnpj?: string; - }; - }[]; - auth_token?: string; - last_confirmed_order_at?: string; - received_orders_count?: number; - confirmed_orders_count?: number; - canceled_orders_count?: number; - renew_password?: boolean; +stock?: number +/** + * Customização da variante + */ +custom_attributes?: { + +} +properties?: { + } /** - * Modelo que representa um endereço na API + * Data e horário da última atualização */ -export interface Address { - id?: number; - first_name?: string; - last_name?: string; - company_name?: string; - email?: string; - documents?: { - cpf?: string; - cnpj?: string; - }; - street_name?: string; - street_number?: string; - complement?: string; - neighborhood?: string; - first_phone_area?: string; - first_phone?: string; - second_phone_area?: string; - second_phone?: string; - reference?: string; - zip?: string; - city?: string; - state?: string; - recipient_name?: string; +updated_at?: string +price?: number +installments?: number[] +available_quantity?: number +/** + * Massa do produto, em gramas + */ +weight?: number +/** + * Largura do produto, em centímetros + */ +width?: number +/** + * Altura do produto, em centímetros + */ +height?: number +/** + * Comprimento do produito, em centímetros + */ +length?: number +/** + * Dias de manuseio da variante + */ +handling_days?: number +inventories?: VariantInventory[] +sale_price?: number +image_url?: string +product_id?: number +norder?: number +} } /** - * Modelo que representa os endereços cadastrados pelo cliente na API + * Permite remover uma variante */ -export interface Client1 { - id?: number; - street_name?: string; - street_number?: string; - complement?: string; - neighborhood?: string; - label?: string; - zip?: string; - city?: string; - state?: string; - reference?: string; - client_id?: number; +"DELETE /api/v2/products/:productId/variants/:id": { + } /** - * Modelo que representa um bônus na API + * @deprecated + * Permite atualizar uma variante */ -export interface Bonus { - amount?: number; - token?: string; - valid_from?: string; - valid_thru?: string; - created_at?: string; - updated_at?: string; +"PATCH /api/v2/products/:productId/variants/:id": { +body: { +sku: string +name?: string +quantity: number +main?: boolean +width?: number +height?: number +length?: number +weight?: number +handling_days?: number +price: number +custom_attributes?: { + +} +min_quantity?: number +norder?: number +property1?: string +property2?: string +property3?: string +barcode?: string +quantity_sold?: number +} } /** - * Modelo que representa um menu na API + * Permite determinar a ordem das variantes dentro de cada produto */ -export interface Menu { - id?: number; - label?: string; - title?: string; - description?: string; - url?: string; - external?: boolean; - parent_id?: number; - tag_id?: number; - tag_name?: string; - page_id?: number; - page_slug?: string; - items_count?: number; - updated_at?: string; - tooltip?: string; - children?: Menu[]; - image_url?: string; - simple_url?: string; - position?: string; - norder?: number; - type?: string; +"POST /api/v2/variants/reorder": { +body: { +/** + * A ordem dos elementos será replicada para as variantes + */ +ids: number[] +} } /** - * Modelo que representa um menu na API quando retornado pela ação de menu em árvore + * Retorna um template usando o path dele */ -export interface MenuTree { - id?: number; - title?: string; - description?: string; - external?: boolean; - url?: string; - tag_id?: number; - page_id?: number; - items_count?: number; - children?: MenuTree[]; - updated_at?: string; - tooltip?: string; - image_url?: string; - simple_url?: string; - norder?: number; +"GET /api/v2/templates/:path": { +response: Template } /** - * Modelo que representa as mensagens do site na API + * Remove um template usando o path dele */ -export interface SiteMessage { - id?: number; - title?: string; - description?: string; - call_to_action?: string; - created_at?: string; - updated_at?: string; +"DELETE /api/v2/templates/:path": { + } /** - * Modelo que representa as imagens da loja na API + * Atualiza o conteúdo de um template usando o path dele */ -export interface ShopAsset { - id?: number; - position?: string; - file_uid?: string; - file_name?: string; - updated_at?: string; +"PATCH /api/v2/templates/:path": { +body: { +body?: string +} } /** - * Modelo que representa um atributo customizado de produto + * Retorna uma lista de templates */ -export interface ProductsAttributes { - index?: number; - name?: string; - mandatory?: boolean; - updated_at?: string; +"GET /api/v2/templates": { +response: Template[] } /** - * Modelo que representa uma customização + * Cria um novo template */ -export interface Customization { - id?: number; - group_name?: string; - name?: string; - label?: string; - image_uid?: string; - image_name?: string; - price?: number; - intl_price?: number; - quantity?: number; - handling_days?: number; - tag_id?: number; - sku?: string; - pattern?: string; +"POST /api/v2/templates": { +body: { +path: string +body?: string +} +response: Template } /** - * Modelo que representa a lista de itens do pedido + * Reativa um usuário que estiver desativado */ -export interface OrderItems { - id?: number; - variant_id?: number; - product_id?: number; - quantity?: number; - price?: number; - weight?: number; - width?: number; - height?: number; - length?: number; - extra?: { - customization?: string; - }; - picture_url?: string; - reference?: string; - sku?: string; - product_name?: string; - variant_name?: string; - original_price?: string; - place_id?: string; - place_name?: number; - place_city?: number; - total?: number; - package?: number; - has_customizations?: number; - barcode?: number; +"POST /api/v2/users/:id/activate": { + } /** - * Modelo que representa uma personalização de item do pedido na API + * Desativa um usuário */ -export interface OrderItemCustomization { - /** - * Código identificador `ID` da personalização - */ - id: number; - /** - * Número de tipos diferentes de personalizações em produtos do pedido - */ - number: number; - /** - * Grupo em que se enquadra a personalização - */ - group_name: string; - /** - * Nome do produto - */ - name: string; - /** - * Preço do produto - */ - price: number; - /** - * Preço internacional - */ - intl_price: number; - /** - * Dias de manuseio do produto - */ - handling_days: number; - /** - * Código SKU da variante de produto - */ - sku: string; +"POST /api/v2/users/:id/deactivate": { + } /** - * Modelo que representa uma personalização de item do carrinho na API + * Lista os usuários */ -export interface CartItemCustomization { - /** - * Código identificador do produto - */ - id: number; - group_name: string; - name: string; - number: number; - /** - * Preço unitário - */ - price: number; - /** - * Preço internacional - */ - intl_price: number; - /** - * Número de dias para manuseio - */ - handling_days: number; - /** - * Código SKU do produto - */ - sku: string; +"GET /api/v2/users": { +searchParams: { +/** + * Incluir usuários desativados? + */ +include_inactive?: boolean +/** + * Incluir todas as imagens dos produtos? + */ +include_images?: boolean +/** + * Exibe somente os usuários com o código externo indicado + */ +external_code?: string +/** + * Exibe somente os usuários com a função indicada + */ +role_name?: ("Agente" | "Gestor" | "Local") +/** + * Filtra usuários que contenham o valor indicado no nome, telefone, email ou código externo + */ +term?: string +} +response: User1[] } /** - * Modelo que representa um mapeamento na API + * Cria um usuário */ -export interface Mapping { - id?: number; - key: string; - from?: string[]; - to?: string; - created_at?: string; - updated_at?: string; +"POST /api/v2/users": { +body: { +email?: string +name?: string +role_name?: ("Agente" | "Gestor" | "Local") +password?: string +password_confirmation?: string +external_code?: string +phone_area?: string +phone?: string +tags?: string[] +} +response: User } /** - * Modelo que representa um banner na API + * Lista os usuários */ -export interface Banner { - big_thumb: string; - color: string; - description: string; - end_at: string; - external: boolean; - file_name: string; - file_uid: string; - html_description: string; - id: number; - norder: number; - plain_description: string; - small_thumb: string; - start_at: string; - subtitle: string; - tag: string; - title: string; - updated_at: string; - url: string; +"GET /api/v2/users/tags": { +searchParams: { +/** + * Exibe somente os usuários com a função indicada + */ +role_names?: ("Agente" | "Gestor" | "Local" | "Agente Social Selling") +} +response: { +tags?: string[] +} } /** - * Modelo que representa um banner simplificado na API + * Retorna a lista de carrinhos ativos nos últimos 60 dias */ -export interface SlimBanner { - id: number; - tag: string; - title: string; - subtitle: string; - description: string; - url: string; - external: boolean; - start_at: string; - end_at: string; - file_url: string; - norder: number; - color: string; - updated_at: string; +"GET /api/v2/carts": { +searchParams: { +/** + * Número da página + */ +page?: number +/** + * Quantidade de produtos por página + */ +per_page?: number +/** + * Inclui os carrinhos sem telefone (não enviar o campo para não incluir) + */ +without_phones?: boolean +/** + * Filtra os carrinhos que possuem tentativa de pagamento + */ +with_payments?: boolean +} +response: Cart[] } /** - * Modelo que representa as formas de entrega na API + * Permite criar um carrinho */ -export interface ShippingMethods1 { - /** - * Nome do tipo de entrega, como por exemplo Normal, Expressa e Agendada - */ - name: string; - /** - * Identificador do método de envio - */ - value: string; - /** - * Preço de envio - */ - price: number; - /** - * Descrição do tipo de envio e prazo - */ - description: string; - /** - * Número em dias do prazo de envio - */ - delivery_days: number; - /** - * Valor restante da compra para que o carrinho fique elegível para frete grátis - */ - value_needed_to_discount?: number; - /** - * Código identificador `ID` do tipo de envio - */ - shipping_method_id: number; - /** - * Mensagem ou observação sobre a forma de envio - */ - notice?: string; - /** - * Empresa responsável pelo envio - */ - fulfillment_company: string; +"POST /api/v2/carts": { +body: ParametrosDeCarrinhoResumido +response: Cart1 } /** - * Modelo de endereço de envio para carrinho e pedido + * Permite retornar um carrinho */ -export interface EnderecoDeEnvio { - id?: number; - first_name: string; - last_name: string; - company_name?: string; - email: string; - /** - * Serão retornados apenas os campos preenchidos - */ - documents?: { - cpf?: string; - cnpj?: string; - ie?: string; - }; - street_name: string; - street_number: string; - complement?: string; - neighborhood: string; - /** - * Somente números - */ - first_phone_area: string; - /** - * Somente números - */ - first_phone: string; - /** - * Somente números - */ - second_phone_area?: string; - /** - * Somente números - */ - second_phone?: string; - reference?: string; - /** - * Somente números - */ - zip: string; - city: string; - state: string; - recipient_name?: string; +"GET /api/v2/carts/:id": { +response: Cart1 } /** - * Modelo de endereço de envio para carrinho e pedido + * Permite criar um carrinho */ -export interface EnderecoDeEnvio1 { - /** - * Nome do cliente - */ - first_name?: string; - /** - * Sobrenome do cliente - */ - last_name?: string; - /** - * Nome da empresa (para clientes jurídicos) - */ - company_name?: string; - /** - * Email do cliente - */ - email?: string; - /** - * Código de Discagem Direta à Distância (DDD) - */ - first_phone_area?: string; - /** - * Telefone do cliente - */ - first_phone?: string; - /** - * Código de Discagem Direta à Distância (DDD) - */ - second_phone_area?: string; - /** - * Telefone do cliente - */ - second_phone?: string; - /** - * Nome do recebedor - */ - recipient_name?: { - [k: string]: any; - }; - /** - * Logradouro - */ - street_name?: string; - /** - * Número - */ - street_number?: string; - /** - * Complemento - */ - complement?: string; - /** - * Bairro - */ - neighborhood?: string; - /** - * Ponto de referência - */ - reference?: string; - /** - * Código de Endereçamento Postal (CEP) - */ - zip: string; - documents?: { - /** - * Cadastro de Pessoa Física - */ - cpf?: string; - /** - * Registro Geral - */ - rg?: string; - /** - * Cadastro Nacional de Pessoas Jurídicas - */ - cnpj?: string; - /** - * Inscrição Estadual - */ - ie?: string; - }[]; +"POST /api/v2/carts/:id": { +body: { +agent?: string +zip?: string +client_id?: number +coupon_code?: string +/** + * DEPRECATED: enviar o `client_id` + */ +email?: string +rebate_token?: string +} +response: Cart1 } /** - * Modelo que representa os preços de uma variante + * Permite excluir um carrinho */ -export interface ProductPriceVariant { - /** - * Define se a variante do produto é a principal - */ - main: boolean; - /** - * Código SKU da variante - */ - sku: string; - /** - * Preço do item - */ - price: number; - on_sale: boolean; - /** - * Preço promocional - */ - sale_price: number; - intl_price: number; - available: boolean; - /** - * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante - */ - properties: { - property1?: VariantProperty1; - property2?: VariantProperty1; - property3?: VariantProperty1; - }; - /** - * Quantidade de itens disponíveis - */ - stock: number; - installments: ProductInstallment[]; - required?: []; - additionalProperties?: never; +"DELETE /api/v2/carts/:id": { + } /** - * Modelo que representa uma imagem de um produto + * Permite atualizar os atributos de um carrinho */ -export interface ProductImage { - /** - * Código identificador `ID` da imagem - */ - id: number; - /** - * URL da imagem - */ - url: string; - /** - * Data e horário da última atualização da imagem do produto - */ - updated_at: string; - /** - * Códigos das variantes que utilizam a imagem - */ - variant_ids: number[]; +"PATCH /api/v2/carts/:id": { +body: { +agent?: string +zip?: string +client_id?: number +/** + * DEPRECATED: enviar o `client_id` + */ +email?: string +rebate_token?: string +} } /** - * Modelo que representa um pacote na API + * Permite calcular as parcelas referentes ao total do carrinho */ -export interface Package { - actual_shipping_method: string; - /** - * Código identificador do pacote - */ - code: string; - /** - * Data de entrega do pacote - */ - delivered_at: string; - delivered_email_sent_at: string; - /** - * Número de dias para entrega - */ - delivery_days: number; - /** - * Tipo de envio do pacote - */ - delivery_type: string; - /** - * Quantidade de dias úteis para entrega - */ - delivery_work_days: number; - /** - * Transportadora - */ - fulfillment_company: string; - /** - * Status de envio - */ - fulfillment_status: "waiting" | "shipped" | "delivered"; - integrated: boolean; - invoiced: boolean; - label: string; - properties: {}; - quoted_shipping_price: number; - shipped_at: string; - shipped_email_sent_at: string; - shipping_label: string; - shipping_name: string; - shipping_price: number; - total: number; - /** - * Data e horário da última atualização do código de rastreio do pacote - */ - tracked_at: string; - /** - * Código de rastreio do pacote - */ - tracking_code: string; - required?: []; - additionalProperties?: never; +"GET /api/v2/carts/:id/installments": { +response: CartInstallment1[] } /** - * Modelo simplificado de um produto para atualização e criação + * Lista os locais */ -export interface SimpleProduct1 { - /** - * Código de Referência do produto - */ - reference: string; - /** - * Nome do produto - */ - name: string; - /** - * Descrição do produto - */ - description?: string; - /** - * Indica se o produto está ativo (`true`) ou invativo (`false`) - */ - active?: boolean; - /** - * Tags associadas ao produto - */ - tag_list?: string; - /** - * Tipo de produto - */ - product_type?: "product" | "sample" | "subscription"; +"GET /api/v2/places": { +searchParams: { +/** + * Filtra os locais for nome + */ +names?: string[] +/** + * Filtra os locais que são/não são warehouse + */ +warehouse?: boolean +/** + * Filtra os locais que contenham determinada categoria + */ +category?: string +/** + * As lojas mais próximas da coordenada informada serão exibidas primeiro + */ +coordinates?: string +/** + * As lojas mais próximas do CEP informado serão exibidas primeiro + */ +origin_zip_code?: string +} +response: Place[] } /** - * Modelo de carcaterística de produto para item no carrinho + * Cria um local */ -export interface Produto1 { - /** - * Código SKU da variante do produto - */ - sku?: string; - /** - * Unidades do produto disponíveis fisicamente - */ - quantity?: number; - /** - * Campo para registro de observações, chave ou valores necessários - */ - extra?: {}; - /** - * Código identificador do local do produto - */ - place_id?: number; - /** - * Código de cupom - */ - store_coupon_code?: string; - /** - * [Personalização](http://ajuda.vnda.com.br/pt-BR/articles/1763398-funcionalidades-produtos-personalizados) do produto - */ - customizations?: { - /** - * [Personalização](http://ajuda.vnda.com.br/pt-BR/articles/1763398-funcionalidades-produtos-personalizados) incluídas no Admin da loja. - * Se por exemplo a customização do produto é a cor, o parâmetro para a requisição deve ser `Color` ao invés de `CUstomization`. - */ - Customization?: string; - }[]; +"POST /api/v2/places": { +body: { +name: string +address_line_1: string +address_line_2?: string +city: string +neighborhood?: string +zip?: string +home_page?: string +latitude?: number +longitude?: number +images?: string[] +description?: string +email: string +first_phone?: string +second_phone?: string +mobile_phone?: string +only_cash?: boolean +categories?: string[] +marker_url?: string +state?: string +opening_hours?: string +warehouse?: boolean +legal_name?: string +cnpj?: string +} +response: Place } /** - * Modelo de produto em um pedido + * Remove um local */ -export interface ProdutoEmUmPedido1 { - /** - * Dados extra do produto - */ - extra: {}; - /** - * Altura do produto, em centímetros. - */ - height?: number; - /** - * código identificador do produto - */ - id?: number; - /** - * Comprimento do produito, em centímetros. - */ - length?: number; - /** - * Preço original - */ - original_price?: number; - /** - * Pacote do produto - */ - package?: string; - /** - * URL da imagem do produto - */ - picture_url?: string; - /** - * Cidade que o produto está - */ - place_city?: string; - /** - * Código identificador do local do produto - */ - place_id?: number; - /** - * Nome do local do produto - */ - place_name?: string; - /** - * Preço do produto - */ - price?: number; - product_id: number; - product_name: string; - /** - * Unidades do produto - */ - quantity: number; - /** - * Código de referência do produto - */ - reference: string; - /** - * Código SKU da variante do produto - */ - sku: string; - /** - * Valor total do produto - */ - total: number; - /** - * Código identificador da variante do produto - */ - variant_id: number; - /** - * Nome da variante do produto - */ - variant_name: string; - /** - * Massa do produto, em gramas - */ - weight: number; - /** - * Largura do produto, em centímetros - */ - width: number; - /** - * Código de barras do produto - */ - barcode?: string; - /** - * Indica se o produto possui customização. - */ - has_customizations?: boolean; +"DELETE /api/v2/places/:id": { + +} +/** + * Atualiza um local + */ +"PATCH /api/v2/places/:id": { +body: { +name: string +address_line_1: string +address_line_2?: string +city: string +neighborhood?: string +zip?: string +home_page?: string +latitude?: number +longitude?: number +images?: string[] +description?: string +email: string +first_phone?: string +second_phone?: string +mobile_phone?: string +only_cash?: boolean +categories?: string[] +marker_url?: string +state?: string +opening_hours?: string +warehouse?: boolean +legal_name?: string +cnpj?: string +} +} +/** + * Lista as notas fiscais + */ +"GET /api/v2/orders/:code/packages/:packageCode/invoices": { +response: Invoice[] +} +/** + * Cria uma nota fiscal + */ +"POST /api/v2/orders/:code/packages/:packageCode/invoices": { +body: { +number: number +series?: number +issued_at?: string +key?: string +volumes?: number +} +response: Invoice +} +/** + * Remove uma nota fiscal + */ +"DELETE /api/v2/orders/:code/packages/:packageCode/invoices/:number": { + +} +/** + * Atualiza uma nota fiscal + */ +"PATCH /api/v2/orders/:code/packages/:packageCode/invoices/:number": { +body: { +number: number +series?: number +issued_at?: string +key?: string +volumes?: number +} +} +/** + * Será enviado por email um link para o cadastro da nova senha + * O link tem validade de 24 horas + */ +"POST /api/v2/users/reset_password": { +body: { +email: string +} +} +/** + * Cadastra a nova senha + */ +"PATCH /api/v2/users/reset_password": { +body: { +/** + * Token pare renovação de senha enviado por email + */ +token: string +/** + * Nova senha para o usuário + */ +password: string +/** + * Confirmação da nova senha do usuário + */ +password_confirmation: string +} +} +/** + * Retorna o endereço de entrega + */ +"GET /api/v2/orders/:code/shipping_address": { +response: { +id?: number +first_name: string +last_name: string +company_name?: string +email: string +/** + * Serão retornados apenas os campos preenchidos + */ +documents?: { +cpf?: string +cnpj?: string +ie?: string +} +street_name: string +street_number: string +complement?: string +neighborhood: string +/** + * Somente números + */ +first_phone_area: string +/** + * Somente números + */ +first_phone: string +/** + * Somente números + */ +second_phone_area?: string +/** + * Somente números + */ +second_phone?: string +reference?: string +/** + * Somente números + */ +zip: string +city: string +state: string +recipient_name?: string +} +} +/** + * Lista os recebedores + */ +"GET /api/v2/payment_recipients": { +response: PaymentRecipient[] +} +/** + * Cria um recebedor + */ +"POST /api/v2/payment_recipients": { +body: { +tag_id?: number +recipient_id?: number +percentage: number +active?: boolean +charge_processing_fee?: boolean +liable?: boolean +code?: string +place_id?: number +user_id?: number +/** + * Indica se o frete deve ser incluído no split do pagamento + */ +include_shipping?: boolean +} +response: PaymentRecipient +} +/** + * Retorna um recebedor + */ +"GET /api/v2/payment_recipients/:id": { +response: PaymentRecipient +} +/** + * Remove um recebedor + */ +"DELETE /api/v2/payment_recipients/:id": { + +} +/** + * Atualiza um recebedor + */ +"PATCH /api/v2/payment_recipients/:id": { +body: { +tag_id?: number +recipient_id?: number +percentage?: number +active?: boolean +charge_processing_fee?: boolean +liable?: boolean +code?: string +place_id?: number +user_id?: number +/** + * Indica se o frete deve ser incluído no split do pagamento + */ +include_shipping?: boolean +} +} +/** + * Permite a listagem de recebíveis do usuário + */ +"GET /api/v2/users/:userId/payables": { +response: RecebiveisDoUsuario[] +} +/** + * Lista os membros da audiência + */ +"GET /api/v2/audience_members": { +response: AudienceMember[] +} +/** + * Permite criar um membro da audiência + */ +"POST /api/v2/audience_members": { +body: { +first_name?: (null | string) +last_name?: (null | string) +email: string +phone_area?: (null | string) +phone?: (null | string) +tags?: string[] +} +response: AudienceMember +} +/** + * Permite remover um membro da audiência + */ +"DELETE /api/v2/audience_members/:id": { + +} +/** + * Permite alterar um membro da audiência + */ +"PATCH /api/v2/audience_members/:id": { +body: { +first_name?: string +last_name?: string +email?: string +phone_area?: string +phone?: string +tags?: string[] +} +} +/** + * Lista os rastreios de um pacote de um pedido + */ +"GET /api/v2/orders/:orderCode/packages/:packageCode/trackings": { +response: { +id?: number +/** + * Código de rastreio do pacote + */ +tracking_code: string +/** + * Data e horário da última atualização do código de rastreio do pacote + */ +tracked_at?: string +/** + * URL para rastreio do pedido com a transportadora + */ +url?: string +/** + * Transportadora do pacote + */ +company?: string +} +} +/** + * Adiciona um rastreio para um pacote de um pedido + */ +"POST /api/v2/orders/:orderCode/packages/:packageCode/trackings": { +body: { +/** + * Código de rastreio + */ +code: string +/** + * Transportadora + */ +company?: string +/** + * Link de rastreamento + */ +url?: string +} +response: { +/** + * Código de rastreio do pacote + */ +code: string +/** + * Transportadora + */ +company?: string +/** + * URL para rastreio do pacote na transportadora + */ +url?: string +} +} +/** + * Remove um rastreio + */ +"DELETE /api/v2/orders/:orderCode/packages/:packageCode/trackings/:id": { + +} +/** + * Lista os itens de um carrinho + */ +"GET /api/v2/carts/:cartId/items": { +response: CartItem[] +} +/** + * Permite criar um item do carrinho + */ +"POST /api/v2/carts/:cartId/items": { +body: Produto +response: CartItem +} +/** + * Remove um item do carrinho + */ +"DELETE /api/v2/carts/:cartId/items/:id": { + +} +/** + * Atualiza um item do carrinho + */ +"PATCH /api/v2/carts/:cartId/items/:id": { +body: { +quantity?: number +place_id?: number +extra?: { + +} +store_coupon_code?: string +} +} +/** + * Permite adicionar itens em bulk ao carrinho + */ +"POST /api/v2/carts/:cartId/items/bulk": { +body: { +/** + * Itens do carrinho + */ +items?: { +/** + * Código SKU da variante do produto + */ +sku: string +/** + * Unidades do produto + */ +quantity: number +/** + * [Personalização](http://ajuda.vnda.com.br/pt-BR/articles/1763398-funcionalidades-produtos-personalizados) do produto + */ +customizations?: { +/** + * Adicione a customização de acordo com a [personalização](http://ajuda.vnda.com.br/pt-BR/articles/1763398-funcionalidades-produtos-personalizados) incluídas no Admin da loja. + * Se por exemplo a customização do produto é a cor, o parâmetro para a requisição deve ser `Color` ao invés de `CUstomization`. + * Saiba mais sobre como utilizar esse parâmetro pelo exemplo de requsição localizado na seção de **Request Example** (ao lado do código da requisição). + */ +Customization?: string +}[] +}[] +minItems?: 0 +} +response: CartItem[] +} +/** + * Cria uma promoção + */ +"POST /api/v2/discounts": { +body: { +name: string +start_at: string +end_at?: string +valid_to?: ("store" | "cart") +description?: string +enabled?: boolean +email?: string +cpf?: string +tags?: string +} +response: Discount1 +} +/** + * Retorna uma promoção + */ +"GET /api/v2/discounts/:id": { +response: Discount1 +} +/** + * Remove uma promoção + */ +"DELETE /api/v2/discounts/:id": { + +} +/** + * Altera uma promoção + */ +"PATCH /api/v2/discounts/:id": { +body: { +name: string +start_at: string +end_at?: string +valid_to?: ("store" | "cart") +description?: string +enabled?: boolean +email?: string +cpf?: string +tags?: string +} +} +/** + * Lista as regras de desconto de uma promoção + */ +"GET /api/v2/discounts/:discountId/rules": { +response: DiscountRule[] +} +/** + * Cria uma regra de desconto + */ +"POST /api/v2/discounts/:discountId/rules": { +body: { +apply_to?: ("product" | "tag" | "subtotal" | "total" | "shipping") +amount_type?: ("R$" | "%") +amount?: number +product_id?: number +tag_name?: string +min_quantity?: number +shipping_method?: string +min_subtotal?: number +gift?: boolean +combinated_product_id?: number +client_tag?: string +shipping_rule?: string +gift_quantity?: number +agent_tag?: string +regions?: string[] +channel?: string[] +} +response: { +id?: number +amount?: number +apply_to?: ("product" | "tag" | "subtotal" | "total" | "shipping") +min_quantity?: number +type?: string +channel?: string[] +} +} +/** + * Remove uma regra de desconto + */ +"DELETE /api/v2/discounts/:discountId/rules/:id": { + +} +/** + * Altera uma regra de desconto + */ +"PATCH /api/v2/discounts/:discountId/rules/:id": { +body: { +apply_to?: ("product" | "tag" | "subtotal" | "total" | "shipping") +amount_type?: ("R$" | "%") +amount?: number +product_id?: number +tag_id?: number +min_quantity?: number +shipping_method?: string +min_subtotal?: number +gift?: boolean +combinated_product_id?: number +client_tag?: string +shipping_rule?: string +gift_quantity?: number +agent_tag?: string +regions?: string[] +channel?: string[] +} +} +/** + * Permite listar os cupons de desconto de uma promoção + */ +"GET /api/v2/discounts/:discountId/coupons": { +searchParams: { +/** + * Filtra os cupons pelo campo uses_per_code + */ +uses_per_code?: number +} +response: Coupon[] +} +/** + * Cria um cupom de desconto + */ +"POST /api/v2/discounts/:discountId/coupons": { +body: { +code?: string +uses_per_code?: number +uses_per_user?: number +referrer_email?: string +quantity?: number +user_id?: number +} +response: Coupon +} +/** + * Remove um cupom de desconto + */ +"DELETE /api/v2/discounts/:discountId/coupons:id": { + +} +/** + * Atualiza um cupom de desconto + */ +"PATCH /api/v2/discounts/:discountId/coupons:id": { +body: { +/** + * Caso deseje um uso ilimitado do cupom, o valor desse campo deverá ser 0 + */ +uses_per_code?: number +/** + * Caso deseje um uso ilimitado do cupom, o valor desse campo deverá ser 0 + */ +uses_per_user?: number +} +} +/** + * Lista os produtos + */ +"GET /api/v2/products": { +searchParams: { +/** + * Delimita a quantidade de itens retornados + */ +limit?: number +/** + * Número da página + */ +page?: number +/** + * Quantidade de produtos por página + */ +per_page?: number +/** + * Filtra pela referência + */ +reference?: string +/** + * Filtra pelo ID dos produtos + */ +ids?: string[] +/** + * Filtra produtos que coném a tag + */ +tag?: string +/** + * Filtra produtos alterados depois da data + */ +updated_after?: string +/** + * Exibe os produtos cadastrados recentemente primeiro + */ +sort?: "newest" +/** + * Inclui os produtos inativos na listagem + */ +include_inactive?: boolean +/** + * Inclui na requisição se deseja que venham todas as imagens do produto + */ +include_images?: boolean +} +response: Product[] +} +/** + * Cria um produto + */ +"POST /api/v2/products": { +body: SimpleProduct +response: { +id?: number +/** + * Indica se o produto está ativo (`true`) ou inativo (`false`) + */ +active?: (boolean & string) +/** + * Código de Referência do produto + */ +reference: string +/** + * Nome do produto + */ +name: string +/** + * Descrição do produto + */ +description?: string +/** + * Lista de tags associadas ao produto + */ +tag_list?: string[] +slug?: string +url?: string +updated_at?: string +/** + * Tipo de produto, entre: + * - `sample`: amostra + * - `subscription`: assinatura + * - `product`: produto em geral + */ +product_type?: ("product" | "sample" | "subscription") +} +} +/** + * Retorna um produto + */ +"GET /api/v2/products/:id": { +searchParams: { +/** + * Lista de cupons para calcular o desconto do produto + */ +coupon_codes?: string[] +/** + * Se "true", inclui o nome do local nos inventários das variantes + */ +include_inventory_place?: string +/** + * Se "true", inclui todas as imagens do produto + */ +include_images?: string +} +response: Product +} +/** + * Remove um produto + */ +"DELETE /api/v2/products/:id": { + +} +/** + * Atualiza um produto + */ +"PATCH /api/v2/products/:id": { +body: { +name: string +description?: string +active?: boolean +reference: string +tag_list?: string +} +} +/** + * Permite atualizar um produto pela referência + */ +"PATCH /api/v2/products/reference/:reference": { +body: { +reference: string +name: string +description?: string +active?: boolean +product_type?: ("product" | "sample" | "subscription") +} +} +/** + * Recebe uma avaliação e recalcula a pontuação atual + */ +"POST /api/v2/products/:id/rate": { +searchParams: { +/** + * Avaliação + */ +rate?: number +} +response: { +rating?: string +votes?: string +} +} +/** + * Busca os produtos de acordo com os parâmetros definidos + */ +"GET /api/v2/products/search": { +searchParams: { +/** + * Número da página + */ +page?: number +/** + * Quantidade de produtos por página + */ +per_page?: number +/** + * Filtra pelo ID dos produtos + */ +"ids[]"?: number[] +/** + * Filtra produtos que contenham o termo + */ +term?: string +/** + * Permite que o filtro 'term' realize filtragem de produtos por termo parcial + */ +wildcard?: boolean +/** + * Filtra pelo nome da tag dentro de um tipo de tag. Exemplo, type_tags[cor]=verde + */ +"type_tags[]"?: { + +} +/** + * Operador lógico para o filtro de tag + */ +type_tags_operator?: ("and" | "or") +/** + * Filtra pelo valor da propriedade 1 + */ +"property1_values[]"?: string[] +/** + * Operador lógico para o filtro de valor da propriedade 1 + */ +property1_operator?: ("and" | "or") +/** + * Filtra pelo valor da propriedade 2 + */ +"property2_values[]"?: string[] +/** + * Operador lógico para o filtro de valor da propriedade 2 + */ +property2_operator?: ("and" | "or") +/** + * Filtra pelo valor da propriedade 3 + */ +"property3_values[]"?: string[] +/** + * Operador lógico para o filtro de valor da propriedade 3 + */ +property3_operator?: ("and" | "or") +/** + * Filtra pelo preço de venda mínimo do produto + */ +min_price?: number +/** + * Filtra pelo preço de venda máximo do produto + */ +max_price?: number +/** + * Filtra pelo nome das tags, independente do tipo + */ +"tags[]"?: string[] +/** + * Filtra pelo nome das tags, independente do tipo + */ +parent_tags?: string[] +/** + * Filtra por produtos disponíveis + */ +show_only_available?: boolean +/** + * Ordena o resultado da busca de produtos conforme a opção escolhida + */ +sort?: ("newest" | "oldest" | "lowest_price" | "highest_price") +} +response: { +results?: ProductSearch[] +aggregations?: { +min_price?: number +max_price?: number +types?: { + +} +properties?: { +property1?: { +value?: string +count?: number +}[] +property2?: { +value?: string +count?: number +}[] +property3?: { +value?: string +count?: number +}[] +} +} +} +} +/** + * Retorna uma variante pelo SKU + */ +"GET /api/v2/variants/:sku": { +response: Variant +} +/** + * Permite atualizar uma variante pelo SKU + */ +"PATCH /api/v2/variants/:sku": { +body: { +sku: string +name?: string +quantity: number +main?: boolean +/** + * Largura do produto, em centímetros + */ +width?: number +/** + * Altura do produto, em centímetros + */ +height?: number +/** + * Comprimento do produito, em centímetros + */ +length?: number +/** + * Massa do produto, em gramas + */ +weight?: number +/** + * Dias de manuseio da variante + */ +handling_days?: number +/** + * Preço do item + */ +price: number +/** + * Customização da variante + */ +custom_attributes?: { + +} +min_quantity?: number +norder?: number +property1?: VariantProperty1 +property2?: VariantProperty1 +property3?: VariantProperty1 +barcode?: string +/** + * Quantidade de itens vendidos + */ +quantity_sold?: number +} +} +/** + * Lista as imagens de uma variante passando o SKU da mesma na URL + */ +"GET /api/v2/products/:productId/variants/:sku/images": { +response: { +url: string +/** + * Data e horário da última atualização da imagem do produto + */ +updated_at: string +}[] +} +/** + * Lista as imagens de uma variante passando o SKU da mesma nos parâmetros + */ +"GET /api/v2/products/:productId/variants/images": { +response: { +url: string +/** + * Data e horário da última atualização da imagem do produto + */ +updated_at: string +}[] +} +/** + * Calcula o frete para uma determinada variante + */ +"GET /api/v2/variants/:sku/shipping_methods": { +searchParams: { +quantity: number +zip: string +} +response: { +name: string +value: string +price: number +description: string +delivery_days: number +value_needed_to_discount: (null | number) +shipping_method_id: (null | number) +notice: (null | string) +fulfillment_company: (null | string) +countries: (null | { +country?: string +price?: string +}[]) +}[] +} +/** + * Permite listar as tags + */ +"GET /api/v2/tags": { +searchParams: { +/** + * Indica a quantidade de tags que devem ser listadas (page será ignorado) + */ +limit?: number +/** + * Número da página + */ +page?: number +/** + * Quantidade de resultados por página + */ +per_page?: number +/** + * Exibe somente as tags com o tipo indicado + */ +type?: string +/** + * Exibe somente as tags com um dos tipos indicados + */ +types?: string[] +/** + * Exibe somente as tags com um dos nomes indicados + */ +names?: string[] +/** + * Quando passado qualquer valor filtra as tags que contenham imagens + */ +images?: string +/** + * Quando passado qualquer valor filtra as tags marcadas para serem exibidas no carrinho + */ +show_in_carts?: string +/** + * Exibe somente as tags do produto indicado + */ +product_id?: number +/** + * Texto livre que permite filtrar as tags pelo nome + */ +name?: string +/** + * String no formato , que determina o campo a ser ordenado e qual a ordem (asc,desc) + */ +sort?: ("name,asc" | "name,desc" | "type,asc" | "type,desc" | "title,asc" | "title,desc" | "products_count,asc" | "products_count,desc") +} +response: Tag[] +} +/** + * Cria uma tag + */ +"POST /api/v2/tags": { +body: { +name: string +title?: string +/** + * Equivalente ao subtítulo + */ +blurb?: string +description?: string +tag_type?: string +show_in_carts?: boolean +} +response: Tag +} +/** + * Lista os tipos de tags usados em alguma tag + */ +"GET /api/v2/tags/types": { +searchParams: { +/** + * Número da página + */ +page?: number +/** + * Quantidade de resultados por página + */ +per_page?: number +} +response: string[] +} +/** + * Retorna uma tag + */ +"GET /api/v2/tags/:name": { +response: Tag +} +/** + * Remove uma tag + */ +"DELETE /api/v2/tags/:name": { + +} +/** + * Permite atualizar uma tag + */ +"PATCH /api/v2/tags/:name": { + +} +/** + * Retorna os dados de um cupom usando o seu código + */ +"GET /api/v2/coupon_codes/:code": { +response: { +id: number +code: string +discount_id: number +updated_at: string +} +} +/** + * Cria um pedido no Paypal para que posteriormente possa receber um pagamento + */ +"POST /api/v2/carts/:cartId/payment/paypal": { +response: { +status?: string +id?: string +links?: { +href?: string +rel?: string +method?: string +}[] +} +} +/** + * Retorna uma lista de clientes. Caso seja informado o parâmetro "email", então apenas o cliente com esse email será retornado + */ +"GET /api/v2/clients": { +searchParams: { +/** + * Retorna somente o cliente com o email informado + */ +email?: string +/** + * Número da página + */ +page?: number +/** + * Registros por página + */ +per_page?: number +/** + * Filtra os clientes pela menor data de atualização + */ +min_updated_at?: string +/** + * Filtra os clientes pela maior data de atualização + */ +max_updated_at?: string +/** + * Data de inicío da filtragem de clientes pela data de aniversário + */ +birthday_start?: string +/** + * Data final da filtragem de clientes pela data de aniversário + */ +birthday_end?: string +/** + * Filtra os clientes que possuem telefone + */ +has_phone?: string +/** + * Filtra os clientes que possuem first name + */ +has_first_name?: string +/** + * Filtra os clientes por vendedor + */ +user_id?: number +/** + * Filtra os clientes que possuem o termo em alguns dos campos + */ +term?: string +/** + * Ordena o resultado da busca de clientes conforme a opção escolhida + */ +sort?: ("name" | "birthdate") +} +response: Client[] +} +/** + * Permite criar um cliente + */ +"POST /api/v2/clients": { +body: { +email?: string +first_name?: string +last_name?: string +birthdate?: string +gender?: ("M" | "F") +/** + * separado por vírgula + */ +tags?: string +lists?: string[] +password?: string +password_confirmation?: string +terms?: boolean +} +response: { +id?: number +first_name?: string +last_name?: string +email?: string +gender?: string +phone_area?: string +phone?: string +cpf?: string +cnpj?: string +ie?: string +tags?: string +lists?: string[] +facebook_uid?: string +liked_facebook_page?: boolean +updated_at?: string +birthdate?: string +recent_address?: { +id?: string +first_name?: string +last_name?: string +company_name?: string +street_name?: string +street_number?: string +neighborhood?: string +complement?: string +reference?: string +city?: string +state?: string +zip?: string +first_phone_area?: string +first_phone?: string +second_phone_area?: string +second_phone?: string +email?: string +documents?: { +cpf?: string +cnpj?: string +} +}[] +} +} +/** + * Permite retornar as informações do cliente + * O auth_token do cliente pode ser informado no lugar do ID na URL + */ +"GET /api/v2/clients/:id": { +response: Client +} +/** + * Permite remover um cliente + */ +"DELETE /api/v2/clients/:id": { + +} +/** + * Permite atualizar as informações do cliente + */ +"PATCH /api/v2/clients/:id": { +body: { +email?: string +first_name?: string +last_name?: string +birthdate?: string +gender?: ("M" | "F") +/** + * separado por vírgula + */ +tags?: string +lists?: string[] +password?: string +password_confirmation?: string +terms?: boolean +} +} +/** + * Retorna a lista de pedidos do cliente + */ +"GET /api/v2/clients/:id/orders": { +response: Order[] +} +/** + * Lista os endereços do cliente utilizados nos pedidos que foram confirmados + */ +"GET /api/v2/clients/:id/addresses": { +searchParams: { +status?: string +} +response: Address +} +/** + * Lista os endereços cadastrados pelo cliente + */ +"GET /api/v2/clients/:clientId/registered_addresses": { +response: Client1 +} +/** + * Permite criar um endereço do cliente + */ +"POST /api/v2/clients/:clientId/registered_addresses": { +body: { +street_name?: string +street_number?: string +complement?: string +neighborhood?: string +label?: string +zip?: string +reference?: string +} +response: Client1 +} +/** + * Delete o endereço cadastrado pelo cliente + */ +"DELETE /api/v2/clients/:clientId/registered_addresses/:id": { + +} +/** + * Permite atualizar um endereço do cliente + */ +"PATCH /api/v2/clients/:clientId/registered_addresses/:id": { +body: { +street_name?: string +street_number?: string +complement?: string +neighborhood?: string +label?: string +zip?: string +reference?: string +} +response: Client1 +} +/** + * Cria uma senha para o cliente e envia por email + */ +"POST /api/v2/clients/recover_password": { +searchParams: { +/** + * Email do cliente + */ +email: string +/** + * Preencher para pular o envio do email de senha para o cliente + */ +no_send?: string +} +response: Client +} +/** + * Retorna o saldo de crétitos do cliente + */ +"GET /api/v2/clients/:id/credits": { +response: { +balance?: number +} +} +/** + * Retorna as transfertências de crétidos realizadas + */ +"GET /api/v2/clients/:id/credits/transfers": { +response: { +from?: { +account?: string +amount?: number +} +to?: { +account?: string +amount?: number +} +}[] +} +/** + * Lista os bônus do cliente que ainda não foram utilizados + */ +"GET /api/v2/clients/:id/bonuses": { +searchParams: { +/** + * Número da página + */ +page?: string +/** + * Registros por página + */ +per_page?: string +} +response: Bonus[] +} +/** + * Solicita a remoção (esquecimento) dos dados pessoais de um cliente, de acordo com a LGPD + */ +"PATCH /api/v2/clients/:id/remove_personal_data": { + +} +/** + * Faz o login do cliente pelo token salvo no campo auth_token + */ +"GET /api/v2/auth/email/:token": { +response: { +id: number +token: string +} +} +/** + * Faz o login do cliente por usuário e senha + */ +"POST /api/v2/auth/client": { +body: { +email: string +password: string +} +response: { +id: number +auth_token: string +} +} +/** + * Faz o pagamento do carrinho usando a forma de pagamento informada + */ +"POST /api/v2/carts/:cartId/payment": { +body: { +/** + * Meio de pagamento + */ +payment_method: "pix" +/** + * Canal de venda do carrinho + */ +channel?: ("ecommerce" | "direct") +} +} +/** + * Lista os menus + */ +"GET /api/v2/menus": { +searchParams: { +parent_id?: number +position?: string +} +response: Menu[] +} +/** + * Cria um menu + */ +"POST /api/v2/menus": { +body: { +label: string +tooltip?: string +description?: string +type: string +url?: string +page_id?: number +parent_id?: number +position: string +new_position?: string +external?: boolean +tag_id?: number +} +response: Menu +} +/** + * Retorna um menu + */ +"GET /api/v2/menus/:id": { +response: Menu +} +/** + * Remove um menu + */ +"DELETE /api/v2/menus/:id": { + +} +/** + * Atualiza um menu + */ +"PATCH /api/v2/menus/:id": { +body: { +label: string +tooltip?: string +description?: string +type: string +url?: string +page_id?: number +parent_id?: number +position: string +new_position?: string +external?: boolean +tag_id?: number +} +} +/** + * Lista as posições dos menus + */ +"GET /api/v2/menus/positions": { +response: string[] +} +/** + * Reordena os menus na ordem em que seus ids são listados no request + */ +"POST /api/v2/menus/reorder": { +body: { +/** + * A ordem dos elementos será replicada para os menus + */ +ids: number[] +} +} +/** + * Retorna os menus em árvore, organizados pela posição + */ +"GET /api/v2/menus/tree": { +response: { +/** + * Posição + */ +[k: string]: MenuTree[] +} +} +/** + * Retorna uma mensagem do site + */ +"GET /api/v2/site_message": { +response: SiteMessage +} +/** + * Remove uma mensagem do site + */ +"DELETE /api/v2/site_message": { + +} +/** + * Cria ou atualiza uma mensagem do site + */ +"PATCH /api/v2/site_message": { +body: { +title?: string +description?: string +call_to_action?: string +} +} +/** + * Lista as imagens associadas a loja + */ +"GET /api/v2/shop/images": { +searchParams: { +/** + * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação + */ +page?: number +/** + * Número máximo de registros que deve ser retornado por página + */ +per_page?: number +/** + * Ordena o resultado da busca de produtos em ordem crescente de cadastro + */ +sort?: "newest" +} +response: ShopAsset[] +} +/** + * Permite cadastrar uma imagem + */ +"POST /api/v2/shop/images": { +body: { +position?: string +file_uid?: string +} +response: ShopAsset +} +/** + * Permite remover uma imagem da loja + */ +"DELETE /api/v2/shop/images/:id": { + +} +/** + * Permite adicionar um atributo customizado de produto + */ +"POST /api/v2/shop/product_attributes": { +body: { +index: number +name: string +mandatory: boolean +} +response: ProductsAttributes +} +/** + * Permite listar as personalizações + */ +"GET /api/v2/customizations": { +searchParams: { +/** + * Filtra por produto + */ +product_id?: number +} +response: Customization[] +} +/** + * Permite criar uma personalização + */ +"POST /api/v2/customizations": { +body: { +group_name: string +group_type: string +name: string +label?: string +image_uid?: string +image_name?: string +price?: number +quantity?: number +handling_days?: number +tag_id: number +sku?: string +pattern?: string +} +response: Customization +} +/** + * Permite retornar uma personalização + */ +"GET /api/v2/customizations/:id": { +response: Customization +} +/** + * Permite remover uma personalização + */ +"DELETE /api/v2/customizations/:id": { + +} +/** + * Permite alterar uma personalização + */ +"PATCH /api/v2/customizations/:id": { +body: { +group_name?: string +group_type?: string +name?: string +label?: string +image_uid?: string +image_name?: string +price?: string +quantity?: string +handling_days?: string +tag_id?: string +sku?: string +pattern?: string +} +} +/** + * Permite listar os itens do pedido + */ +"GET /api/v2/orders/:orderId/items": { +response: OrderItems[] +} +/** + * Permite listar as personalizações de cada item do pedido + */ +"GET /api/v2/orders/:orderId/items/:itemId/customizations": { +response: OrderItemCustomization[] +} +/** + * Permite listar as personalizações de cada item do carrinho + */ +"GET /api/v2/carts/:cartId/items/:itemId/customizations": { +response: { +[k: string]: CartItemCustomization[] +} +} +/** + * Permite remover uma customização do item do carrinho + */ +"DELETE /api/v2/carts/:cartId/items/:itemId/customizations": { + +} +/** + * Lista os mapeamentos + */ +"GET /api/v2/mappings": { +searchParams: { +/** + * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação + */ +page?: number +/** + * Número máximo de registros que deve ser retornado por página + */ +per_page?: number +} +response: Mapping[] +} +/** + * Cria um mapeamento + */ +"POST /api/v2/mappings": { +body: { +key: string +from?: string[] +to?: string +} +response: Mapping +} +/** + * Retorna os dados de um mapeamento + */ +"GET /api/v2/mappings/:id": { +response: Mapping +} +/** + * Remove um mapeamento + */ +"DELETE /api/v2/mappings/:id": { + +} +/** + * Atualiza um mapeamento + */ +"PATCH /api/v2/mappings/:id": { +body: { +key: string +from?: string[] +to?: string +} +} +/** + * Retorna a lista de banners + */ +"GET /api/v2/banners": { +searchParams: { +/** + * Booleano indicando para filtrar banners fora do prazo de validade + */ +only_valid?: string +/** + * Booleano indicando para filtrar banners com prazo de validade expirados + */ +only_expired?: string +/** + * Booleano indicando para filtrar banners agendados + */ +only_scheduled?: string +/** + * Lista separada por vírgula com nomes de tags + */ +tag?: string +/** + * Texto livre que permite filtrar os banners pelo título + */ +title?: string +/** + * Booleano indicando para não fazer paginação dos resultados + */ +no_paginate?: string +/** + * Número da página atual. Os dados de paginação estarão disponíveis, em formato JSON, no header X-Pagination no response da API, caso exista paginação + */ +page?: number +/** + * Número máximo de registros que deve ser retornado por página + */ +per_page?: number +} +response: Banner[] +} +/** + * Retorna os dados de um banner + */ +"GET /api/v2/banners/:id": { +response: Banner +} +/** + * Retorna todos os banners disponíveis agrupados por tag + */ +"GET /api/v2/banners/all": { +response: { +[k: string]: SlimBanner[] +} +} +/** + * Permite calcular o frete para pedidos internacionais + */ +"GET /api/v2/carts/:cartId/shipping_methods/intl": { +searchParams: { +/** + * Código do país de destino + */ +country: string +} +response: { +"{package_label}"?: ShippingMethods1[] +} +} +/** + * Lista as amostras disponíveis para determinado carrinho + */ +"GET /api/v2/carts/:cartId/samples": { +response: { +id: number +image_url: (null | string) +name: string +reference: string +updated_at: string +url: string +variants: { +id: number +main: boolean +sku: string +name: string +updated_at: string +image_url: (null | string) +product_id: number +norder: number +}[] +} +} +/** + * Retorna o endereço de entrega + */ +"GET /api/v2/carts/:cartId/shipping_address": { +response: EnderecoDeEnvio +} +/** + * Adiciona um endereço de entrega no carrinho + */ +"POST /api/v2/carts/:cartId/shipping_address": { +body: EnderecoDeEnvio1 +response: CartItem +} +/** + * Associa um código de cupom ao carrinho + */ +"POST /api/v2/carts/:cartId/coupon_code": { +body: { +/** + * Código do cupom + */ +code: string +} +response: { +/** + * Código do cupom + */ +code: string +discount: number +rebate_token: string +rebate_discount: number +} +} +/** + * Lista todos os channels usados nos pedidos criados + */ +"GET /api/v2/orders/channels": { +response: string[] +} +/** + * Lista todos os estados usados nos pedidos criados + */ +"GET /api/v2/orders/states": { +response: string[] +} +/** + * Retorna o preço do produto e das variantes + */ +"GET /api/v2/products/:productId/price": { +searchParams: { +/** + * Array com os códigos de cupons + */ +coupon_codes?: string[] +} +response: { +available: boolean +on_sale: boolean +price: number +sale_price: number +intl_price: number +discount_rule?: any +/** + * @minItems 1 + */ +installments: [ProductInstallment, ...(ProductInstallment)[]] +/** + * Data e horário da última atualização + */ +updated_at: string +/** + * @minItems 1 + */ +variants: [ProductPriceVariant, ...(ProductPriceVariant)[]] +} +} +/** + * Lista as imagens do produto + */ +"GET /api/v2/products/:productId/images": { +response: ProductImage[] +} +/** + * Cria uma imagem do produto + */ +"POST /api/v2/products/:productId/images": { +body: { +file_url: string +/** + * IDs da variantes associadas a imagem + */ +variant_ids?: number[] +} +response: ProductImage[] +} +/** + * Deleta uma imagem do produto + */ +"DELETE /api/v2/products/:productId/images/:id": { + +} +/** + * Reordena as imagens do produto + */ +"POST /api/v2/products/:productId/images/reorder": { +body: { +ids: number[] +} +} +/** + * Associa a imagem com uma variante + */ +"POST /api/v2/products/:productId/images/:id/add_variant": { +body: { +variant_id: number +} +} +/** + * Remove a associação da imagem com uma variante + */ +"POST /api/v2/products/:productId/images/:id/remove_variant": { +body: { +variant_id: number +} +} +/** + * Retorna uma lista de pacotes de um pedido + */ +"GET /api/v2/orders/:orderCode/packages": { +response: Package[] +} +/** + * Indica para a API que dererminado evento aconteceu e que ela deve disparar as ações relacionadas + */ +"POST /api/v2/events": { +searchParams: { +/** + * Evento que ocorreu + */ +event_type: string +/** + * ID do recurso selacionado ao evento + */ +id: string +/** + * IP do usuário + */ +browser_ip?: string +/** + * User agent do usuário + */ +user_agent?: string +} +} +/** + * Permite a listagem de recebíveis (comissão) de um usuário vendedor da loja, quando ocorre split de pagamentos via Pagarme + */ +"GET /api/v2/users/:id/payables": { +response: RecebiveisDoUsuario[] +} +/** + * Retorna um produto pelo código identificador (`product_id`) + */ +"GET /api/v2/products/:productId": { +searchParams: { +/** + * Array com os códigos de cupons + */ +coupon_codes?: string[] +/** + * Selecione `true` para incluir o nome do local de armazenamento no retorno da requisição + */ +include_inventory_place?: string +/** + * Selecione `true` para incluir todas as imagens do produto + */ +include_images?: string +} +response: Product +} +/** + * Remove um produto do catálogo pelo código indentificador (`product_id`) + */ +"DELETE /api/v2/products/:productId": { + +} +/** + * Atualiza informações de um produto no catálogo pelo código identificador (`product_id`) + */ +"PATCH /api/v2/products/:productId": { +body: SimpleProduct1 +} +/** + * Recebe uma avaliação e recalcula a pontuação atual + */ +"POST /api/v2/products/:productId/rate": { +searchParams: { +/** + * Avaliação + */ +rate?: number +} +response: { +/** + * Média das avaliações + */ +rating?: string +/** + * Número de avaliações recebidas + */ +votes?: string +} +} +/** + * Permite remover uma variante + */ +"DELETE /api/v2/products/:productId/variants/:variantId": { + +} +/** + * @deprecated + * Atualiza as informações de um variante + */ +"PATCH /api/v2/products/:productId/variants/:variantId": { +body: { +sku: string +name?: string +quantity: number +main?: boolean +/** + * Massa do produto, em gramas + */ +weight?: number +/** + * Largura do produto, em centímetros + */ +width?: number +/** + * Altura do produto, em centímetros + */ +height?: number +/** + * Comprimento do produito, em centímetros + */ +length?: number +/** + * Dias de manuseio da variante + */ +handling_days?: number +price: number +/** + * Customização da variante + */ +custom_attributes?: { + +} +min_quantity?: number +norder?: number +property1?: { +name?: string +value?: string +defining?: boolean +} +property2?: { +name?: string +value?: string +defining?: boolean +} +property3?: { +name?: string +value?: string +defining?: boolean +} +barcode?: string +/** + * Quantidade de itens vendidos + */ +quantity_sold?: number +} +} +/** + * Deleta uma imagem do produto + */ +"DELETE /api/v2/products/:productId/images/:imageId": { + +} +/** + * Associa a imagem com uma variante + */ +"POST /api/v2/products/:productId/images/:imageId/add_variant": { +body: { +variant_id: number +} +} +/** + * Remove a associação da imagem com uma variante + */ +"POST /api/v2/products/:productId/images/:imageId/remove_variant": { +body: { +variant_id: number +} +} +/** + * Retorna as informações de um carrinho pelo seu `id` ou `token` + */ +"GET /api/v2/carts/:cartId": { +response: Cart1 +} +/** + * Permite excluir um carrinho + */ +"DELETE /api/v2/carts/:cartId": { + +} +/** + * Permite atualizar os atributos de um carrinho + */ +"PATCH /api/v2/carts/:cartId": { +body: ParametrosDeCarrinhoResumido +} +/** + * Remove um item do carrinho + */ +"DELETE /api/v2/carts/:cartId/items/:itemId": { + +} +/** + * Atualiza um item do carrinho + */ +"PATCH /api/v2/carts/:cartId/items/:itemId": { +body: Produto1 +} +/** + * Atualiza o método para o envio dos itens do carrinho + */ +"PATCH /api/v2/carts/:cartId/shipping_methods/:valueMethod": { +body: ShippingMethods1 +} +/** + * Calculo os método de envio disponíveis para o carrinho + */ +"GET /api/v2/carts/:cartId/shipping_methods": { +response: { +"{package_label}"?: ShippingMethods1[] +} +} +/** + * Calcula as parcelas de pagamento para valor total do carrinho + */ +"GET /api/v2/carts/:cartId/installments": { +response: CartInstallment1[] +} +/** + * Retorna os dados de um pedido pelo `code` ou `token` do pedido + */ +"GET /api/v2/orders/:orderCode": { +searchParams: { +/** + * Inclui as formas de entrega do pedido + */ +include_shipping_address?: boolean +} +response: Order +} +/** + * Atualiza o campo de dados extras de um pedido pelo `code` do pedido + */ +"PATCH /api/v2/orders/:orderCode": { +body: { +/** + * Campo para registro de observações, chave ou valores necessários + */ +extra?: { + +} +} +} +/** + * Retorna a *timeline* de eventos ocorridos em um pedido + */ +"GET /api/v2/orders/:orderCode/events": { +response: { + +}[] +} +/** + * Retorna a avaliação que o cliente fez em um pedido + */ +"GET /api/v2/orders/:orderCode/reviews": { + +} +/** + * Retorna os descontos de um pedido pelo `code` ou `token` do pedido + */ +"GET /api/v2/orders/:orderCode/discounts": { +response: { + +}[] +} +/** + * Retorna o endereço de envio pelo `code` do pedido + */ +"GET /api/v2/orders/:orderCode/shipping_address": { +response: EnderecoDeEnvio1 +} +/** + * Atualiza dados de endereço do pedido + */ +"PATCH /api/v2/orders/:orderCode/shipping_address": { +body: EnderecoDeEnvio1 +} +/** + * Captura o pagamento no adquirente para pedidos com pagamento por cartão de crédito. + */ +"POST /api/v2/orders/:orderCode/capture": { +response: { + +} +} +/** + * Confirma um pedido + */ +"POST /api/v2/orders/:orderCode/confirm": { +body: { +/** + * Parâmetro para incluir o retorno [da requisição de captura do pagamento](https://developers.vnda.com.br/reference/post-api-v2-orders-capture). + * Esse parâmetro é **obrigatório** para pedidos com pagamento por cartão de crédito. + */ +confirmation_data?: string +} +} +/** + * Faz o estorno do pagamento no adquirente do cartão de crédito + * Operação válida para pedidos pagos com cartão de crédito + */ +"POST /api/v2/orders/:orderCode/chargeback": { + +} +/** + * Altera o status do pedido para `cancelado` + */ +"POST /api/v2/orders/:orderCode/cancel": { +body: { +/** + * Parâmetro para incluir uma confirmação de estorno de pagamento para o cliente. + * Para pedidos com pagamento via cartão de crédito, é obrigatório que nesse campo seja incluído no parâmetro o retorno [da requisição de estorno de pagamento](https://developers.vnda.com.br/reference/post-api-v2-orders-order-code-chargeback). + */ +cancelation_data?: string +} +response: { + +} +} +/** + * Retorna os itens de um pedido pelo código do pedido + */ +"GET /api/v2/orders/:orderCode/items": { +response: ProdutoEmUmPedido1[][] +} +/** + * Lista as personalizações de um item do pedido pelos códigos do item e do pedido + */ +"GET /api/v2/orders/:orderCode/items/:itemId/customizations": { +response: OrderItemCustomization[] +} +/** + * Retorna os pedidos de um cliente pelo seu `id_client` + */ +"GET /api/v2/clients/:idClient/orders": { +response: Order[] +} +/** + * Retorna as notas fisicais de um pacote do pedido + */ +"GET /api/v2/orders/:orderCode/packages/:packageCode/invoices": { +response: Invoice[] +} +/** + * Inclui nota fiscal no pacote de um pedido + */ +"POST /api/v2/orders/:orderCode/packages/:packageCode/invoices": { +body: Invoice +response: Invoice +} +/** + * Remove uma nota fiscal + */ +"DELETE /api/v2/orders/:orderCode/packages/:packageCode/invoices/:number": { + +} +/** + * Atualiza uma nota fiscal + */ +"PATCH /api/v2/orders/:orderCode/packages/:packageCode/invoices/:number": { +body: Invoice +} +/** + * Permite listar os pedidos pendentes do feed + */ +"GET /api/feed/orders": { +searchParams: { +/** + * Selecione `true` para incluir o endereço na resposta + */ +include_shipping_address?: true +/** + * Filtra os pedidos por status + */ +status?: ("received" | "confirmed" | "canceled") +} +response: Order[] +} +/** + * Permite marcar os pedidos para que eles sejam filtrados da listagem do feed + */ +"POST /api/feed/orders": { +body: { +orders?: { +/** + * Código do pedido + */ +code: string +}[] +} +} +} +/** + * Modelo que representa um usuário na API + */ +export interface User { +/** + * Código identificador do usuário + */ +id?: number +/** + * Email do usuário + */ +email: string +/** + * Token de validação de usuário logado (`access_token`) + * + * O `access_token` é gerado quando o usuário loga no Admin + */ +access_token?: string +/** + * Nome do usuário + */ +name?: string +/** + * Identificador de usuários administradores + * + * Esse atributo retorna `true` para um usuário administrador do ambiente de loja + */ +admin?: boolean +/** + * Identificador de usuários que atualizaram a senha inicial + * + * Esse atributo retorna `true` para um usuário que já redefiniu sua senha pelo menos uma vez + */ +renew_password?: boolean +/** + * Código da função do usuário na loja: + * + * - Agente: `0`; + * - Gestor: `1`; + * - Local: `2`; + * - Agente Social Selling: `3`. + */ +role?: number +/** + * Tags para agrupamento de usuários + * As tags podem ser são utilizadas para direcionar promoções para determinados usuários, organizar os recebedores em uma divisão de pagamentos, definir regras de comissão + */ +tags?: string[] +/** + * Código externo do Vendedor. Esse campo é destinado para cadastrar um código de vendedor já existente em outro sistema. + */ +external_code?: string +/** + * Código de Discagem Direta a Distância (DDD) do telefone do usuário + */ +phone_area?: string +/** + * Número de telefone do usuário + */ +phone?: string +/** + * Data de inclusão do usuário no Admin + */ +created_at?: string +/** + * Data de atualização das informações do usuário + */ +updated_at?: string +} +/** + * Modelo que representa um pedido na API + */ +export interface Order { +/** + * Desconto por bônus do cliente + */ +rebate_discount: number +/** + * Código identificador `ID` do desconto por bônus + */ +rebate_token?: string +/** + * Código identificador `ID` do cliente + */ +user_id?: number +/** + * Data da última atualização do pedido + */ +updated_at: string +/** + * Lista com os códigos de rastreio dos pacotes do pedido + */ +tracking_code_list?: string[] +/** + * Código de rastreio do pacote + */ +tracking_code?: string +/** + * Valor final do pedido + */ +total: number +token: string +taxes: number +/** + * Valor da soma dos itens do pedido, desconsiderando descontos e frete. + */ +subtotal: number +/** + * Status do pedido + */ +status: ("received" | "confirmed" | "canceled") +payment_due_date?: string +slip_url?: string +slip_token?: string +slip_due_date?: string +slip: boolean +shipping_tracked_at?: string +shipping_price?: number +shipping_label?: string +/** + * Data e horário de envio do pedido + */ +shipped_at: string +/** + * Data e horário de recebimento do pedido + */ +received_at: string +payment_tid?: string +/** + * Método de pagamento do pedido + */ +payment_method: string +payment_gateway: string +payment_authorization: string +/** + * Data e horário do pagamento do pedido + */ +paid_at: string +items?: ProdutoEmUmPedido[] +/** + * Parcelas do pagamento parcelado + */ +installments?: number +/** + * Código identificador do pedido + */ +id?: number +/** + * Campo de observações do pedido + */ +extra?: { + +} +expected_delivery_date?: string +/** + * Email do cliente + */ +email: string +/** + * Valor do desconto aplicado no pedido + */ +discount_price: number +deposit: boolean +delivery_type?: string +delivery_message?: string +/** + * Dias para entrega + */ +delivery_days?: number +/** + * Data de entrega do pedido + */ +delivered_at: string +/** + * Código de cupom do pedido + */ +coupon_code: string +/** + * Data e horário de confirmação do pedido + */ +confirmed_at: string +/** + * Código do pedido + */ +code: string +/** + * Código identificador (`ID`) do cliente + */ +client_id: number +/** + * Canal de venda que originou o pedido + */ +channel: ("ecommerce" | "direct") +/** + * Código identificador do carrinho que originou o pedido + */ +cart_id: number +/** + * Data de validade do cartão de crédito + */ +card_validity: string +/** + * Número do cartão de crédito + */ +card_number: string +/** + * Retorna `true` se o método de pagamento do pedido é por cartão de crédito. + */ +card: boolean +/** + * Data e horário do cancelamento do pedido + */ +canceled_at?: string +/** + * Endereço IP de origem do pedido + */ +browser_ip: string +/** + * Agente do pedido + */ +agent?: string +affiliate_tag?: string +pix_qr_code?: string +/** + * Código de autorização do pagamento + */ +payment_authorization_code?: string +/** + * Indica se o pedido gerou bônus + */ +bonus_granted?: boolean +has_split?: boolean +/** + * Indica se o pedido foi pago usando o Pix + */ +pix: boolean +ame_qr_code?: string +/** + * Indica se o pedido foi pago usando o Ame + */ +ame: boolean +antifraud_assurance?: string +minItems?: 0 +} +/** + * Modelo de produto em um pedido + */ +export interface ProdutoEmUmPedido { +extra: { + +} +height?: number +id?: number +length?: number +original_price?: number +package?: string +picture_url?: string +place_city?: string +place_id?: number +place_name?: string +price?: number +product_id: number +product_name: string +quantity: number +reference: string +sku: string +total: number +variant_id: number +variant_name: string +weight: number +width: number +barcode?: string +} +/** + * Modelo que representa uma variante na API + */ +export interface Variant { +/** + * Código identificador da variante + */ +id?: number +/** + * Identifica se é a variante principal do produto. Para `true` a variante é principal e `false` a variante é secundária + */ +main?: boolean +/** + * Identifica se a variante está ativa em `true` e desativa em `false` + */ +available?: boolean +/** + * Código SKU da variante + */ +sku?: string +/** + * Nome da variante + */ +name?: string +/** + * Slug da URL da variante + */ +slug?: string +/** + * Quantidade mínima para venda + */ +min_quantity?: number +/** + * Quantidade física + */ +quantity?: number +quantity_sold?: number +/** + * Quantidade disponível + */ +stock?: number +/** + * Customização da variante + */ +custom_attributes?: { + +} +/** + * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante + */ +properties?: { +property1?: VariantProperty +property2?: VariantProperty +property3?: VariantProperty +} +/** + * Data e horário da última atualização da variante + */ +updated_at?: string +/** + * Preço do item + */ +price?: number +/** + * Relação das parcelas para pagamento do item parcelado + */ +installments?: number[] +/** + * Unidades reservadas e não reservadas do item + */ +available_quantity?: number +/** + * Massa do produto, em gramas + */ +weight?: number +/** + * Largura do produto, em centímetros + */ +width?: number +/** + * Altura do produto, em centímetros + */ +height?: number +/** + * Comprimento do produito, em centímetros + */ +length?: number +/** + * Dias de manuseio da variante + */ +handling_days?: number +/** + * Relação de itens por estoque (armazém) + */ +inventories?: VariantInventory[] +/** + * Preço promocional + */ +sale_price?: number +/** + * Preço internacional + */ +intl_price?: number +/** + * URL da imagem da variante + */ +image_url?: string +/** + * Código identificador `ID` do produto + */ +product_id?: number +/** + * Código de barra da variante + */ +barcode?: string +norder?: number +required?: [] +additionalProperties?: never +} +/** + * Modelo que representa uma propriedade customizada na API + */ +export interface VariantProperty { +/** + * Indica se a variante possui uma definição (`true`) ou se a variante não possui (`false`) + */ +defining: boolean +/** + * Nome da propriedade + */ +name: string +/** + * Valor da propriedade + */ +value?: string +} +/** + * Model que representa um inventory da variante + */ +export interface VariantInventory { +id: number +name: string +place_id: number +/** + * Preço do item + */ +price: number +quantity: number +/** + * Quantidade de itens vendidos + */ +quantity_sold: number +/** + * Preço promocional + */ +sale_price: number +slug: string +} +/** + * Modelo que representa um template na API + */ +export interface Template { +path: string +body?: string +updated_at: string +} +/** + * Modelo que representa um usuário na API + */ +export interface User1 { +/** + * Código identificador do usuário + */ +id?: number +/** + * Email do usuário + */ +email: string +/** + * Token de validação de usuário logado (`access_token`) + * + * O `access_token` é gerado quando o usuário loga no Admin + */ +access_token?: string +/** + * Nome do usuário + */ +name?: string +/** + * Identificador de usuários administradores + * + * Esse atributo retorna `true` para um usuário administrador do ambiente de loja + */ +admin?: boolean +/** + * Identificador de usuários que atualizaram a senha inicial + * + * Esse atributo retorna `true` para um usuário que já redefiniu sua senha pelo menos uma vez + */ +renew_password?: boolean +/** + * Código da função do usuário na loja: + * + * - Agente: `0`; + * - Gestor: `1`; + * - Local: `2`; + * - Agente Social Selling: `3`. + */ +role?: number +/** + * Tags para agrupamento de usuários + * As tags podem ser são utilizadas para direcionar promoções para determinados usuários, organizar os recebedores em uma divisão de pagamentos, definir regras de comissão + */ +tags?: string[] +/** + * Código externo do Vendedor. Esse campo é destinado para cadastrar um código de vendedor já existente em outro sistema. + */ +external_code?: string +/** + * Código de Discagem Direta a Distância (DDD) do telefone do usuário + */ +phone_area?: string +/** + * Número de telefone do usuário + */ +phone?: string +/** + * Data de inclusão do usuário no Admin + */ +created_at?: string +/** + * Data de atualização das informações do usuário + */ +updated_at?: string +} +/** + * Modelo que representa um carrinho na API + */ +export interface Cart { +id: number +email: string +shipping_method: string +items_count: number +quotation_responses_count: number +payment_responses_count: number +has_payment_responses: boolean +has_phone: boolean +updated_at: string +} +/** + * Parâmetros criação e atualização de carrinho + */ +export interface ParametrosDeCarrinhoResumido { +/** + * Agente que criou o carrinho + */ +agent?: string +/** + * Código de Endereçamento Postal (CEP) do destinatário do pedido + */ +zip?: string +/** + * Código identificador `ID` do cliente + */ +client_id?: number +/** + * Código identificador `ID` do desconto do carrinho + */ +coupon_code?: string +/** + * @deprecated + * Email do cliente + */ +email?: string +/** + * Token do desconto + */ +rebate_token?: string +/** + * Id do agente + */ +user_id?: number +} +/** + * Modelo que representa um carrinho na API + */ +export interface Cart1 { +/** + * Agente que criou o carrinho + */ +agent: string +/** + * Código identificador `ID` do endereço de cobrança do carrinho + */ +billing_address_id: number +/** + * Canal de venda que originou o carrinho + */ +channel: string +/** + * Código identificador `ID` do cliente + */ +client_id: number +/** + * Código identificador `ID` do carrinho + */ +code: string +/** + * Código de cupom de desconto utilizado no carrinho + */ +coupon_code: string +discount: Discount +/** + * @deprecated + * Valor do desconto + */ +discount_price: number +/** + * Campo para registro de observações, chave ou valores necessários + */ +extra: { + +} +/** + * Código identificador `ID` do carrinho + */ +id: number +/** + * Itens do carrinho + */ +items: CartItem[] +/** + * Unidades do item no carrinho + */ +items_count: number +/** + * Código identificador `ID` do endereço de entrega do carrinho + */ +shipping_address_id: number +/** + * Método de envio selecionado para o carrinho, como por exemplo: normal, expressa e agendada. + */ +shipping_method: string +/** + * Lista com as entregas disponíveis para os itens do carrinho de acordo com o endereço de envio + */ +shipping_methods: ShippingMethods[] +/** + * Preço de envio + */ +shipping_price: number +/** + * Valor da soma dos itens do carrinho, sem considerar descontos de cupom, carrinho e frete. + */ +subtotal: number +/** + * Token do carrinho + */ +token: string +/** + * Valor final do carrinho + */ +total: number +/** + * Valor total do carrinho para pagamento por depósito + */ +total_for_deposit: number +/** + * Valor total do carrinho para pagamento por boleto + */ +total_for_slip: number +/** + * Valor do carrinho para pagamento por PIX + */ +total_for_pix: number +/** + * Data da última atualização do carrinho + */ +updated_at: string +/** + * Código identificador `ID` do desconto por bônus + */ +rebate_token: string +/** + * Desconto por bônus do cliente + */ +rebate_discount: number +/** + * Número de dias para manuseio dos itens + */ +handling_days: number +/** + * Valor de desconto de promoções aplicadas ao subtotal do carrinho + */ +subtotal_discount: number +/** + * Valor de desconto de promoções aplicadas ao valor total do carrinho + */ +total_discount: number +installments?: CartInstallment +/** + * Código identificador `ID` do cliente + */ +user_id?: string +minItems?: 0 +} +/** + * Promoção aplicada no carrinho + */ +export interface Discount { +id: number +name: string +description: string +facebook: boolean +valid_to: ("store" | "cart") +/** + * DEPRECATED + */ +seal_uid: string +/** + * DEPRECATED + */ +seal_url: string +start_at: string +end_at: string +email: string +cpf: string +tags: string +} +/** + * Modelo que representa um item no carrinho na API + */ +export interface CartItem { +/** + * Unidades disponíveis do produto + */ +available_quantity: number +/** + * Número de dias para a entrega + */ +delivery_days: number +/** + * Campo para registro de observações, chave ou valores necessários + */ +extra: { + +} +/** + * Código identificador do local do produto + */ +place_id: number +/** + * Preço do produto + */ +price: number +/** + * Preço internacional + */ +intl_price: number +/** + * Código identificador `ID` do produto + */ +product_id: number +/** + * Nome do produto + */ +product_name: string +/** + * Código de referência do produto + */ +product_reference: string +/** + * URL do produto no e-commerce + */ +product_url: string +/** + * Unidades do produto no carrinho + */ +quantity: number +/** + * Identificador do seller + */ +seller: string +/** + * Nome do seller + */ +seller_name: string +/** + * Valor do produto sem descontos e promoções + */ +subtotal: number +/** + * Valor total do produto + */ +total: number +/** + * Data da última atualização do carrinho + */ +updated_at: string +/** + * Atributos da variante + */ +variant_attributes: { + +} +/** + * Quantidade miníma de variantes para compra + */ +variant_min_quantity: number +/** + * Nome da variante + */ +variant_name: string +/** + * Preço da variante + */ +variant_price: number +/** + * Preço internacional da variante + */ +variant_intl_price: number +variant_properties: Variant1 +/** + * Código SKU da [Variante](https://developers.vnda.com.br/docs/cat%C3%A1logo-de-produtos#produto-atributo-e-variante) + */ +variant_sku: string +/** + * Código identificador do item no carrinho + */ +id?: string +/** + * Tipo de produto + */ +product_type?: string +/** + * URL da imagem da variante + */ +image_url?: string +} +/** + * Modelo que representa uma variante na API + */ +export interface Variant1 { +/** + * Código identificador da variante + */ +id?: number +/** + * Identifica se é a variante principal do produto. Para `true` a variante é principal e `false` a variante é secundária + */ +main?: boolean +/** + * Identifica se a variante está ativa em `true` e desativa em `false` + */ +available?: boolean +/** + * Código SKU da variante + */ +sku?: string +/** + * Nome da variante + */ +name?: string +/** + * Slug da URL da variante + */ +slug?: string +/** + * Quantidade mínima para venda + */ +min_quantity?: number +/** + * Quantidade física + */ +quantity?: number +quantity_sold?: number +/** + * Quantidade disponível + */ +stock?: number +/** + * Customização da variante + */ +custom_attributes?: { + +} +/** + * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante + */ +properties?: { +property1?: VariantProperty +property2?: VariantProperty +property3?: VariantProperty +} +/** + * Data e horário da última atualização da variante + */ +updated_at?: string +/** + * Preço do item + */ +price?: number +/** + * Relação das parcelas para pagamento do item parcelado + */ +installments?: number[] +/** + * Unidades reservadas e não reservadas do item + */ +available_quantity?: number +/** + * Massa do produto, em gramas + */ +weight?: number +/** + * Largura do produto, em centímetros + */ +width?: number +/** + * Altura do produto, em centímetros + */ +height?: number +/** + * Comprimento do produito, em centímetros + */ +length?: number +/** + * Dias de manuseio da variante + */ +handling_days?: number +/** + * Relação de itens por estoque (armazém) + */ +inventories?: VariantInventory[] +/** + * Preço promocional + */ +sale_price?: number +/** + * Preço internacional + */ +intl_price?: number +/** + * URL da imagem da variante + */ +image_url?: string +/** + * Código identificador `ID` do produto + */ +product_id?: number +/** + * Código de barra da variante + */ +barcode?: string +norder?: number +required?: [] +additionalProperties?: never +} +/** + * Modelo que representa as formas de entrega na API + */ +export interface ShippingMethods { +package: string +name: string +label: string +price: string +delivery_days: string +delivery_type: string +description: string +short_description: string +fulfillment_company: string +} +/** + * Parcelas para pagamento parcelado + */ +export interface CartInstallment { +/** + * Identifica se há (`true`) ou não (`false`) juros no parcelamento + */ +interest: boolean +/** + * Taxa de juros do parcelamento + */ +interest_rate: number +/** + * Número de parcelas + */ +number: number +/** + * Valor de cada parcela + */ +price: number +/** + * Valor total das parcelas + */ +total: number +} +/** + * Modelo que representa uma parcela do total de um carrinho + */ +export interface CartInstallment1 { +/** + * Identifica se há (`true`) ou não (`false`) juros no parcelamento + */ +interest: boolean +/** + * Taxa de juros do parcelamento + */ +interest_rate: number +/** + * Número de parcelas + */ +number: number +/** + * Valor de cada parcela + */ +price: number +/** + * Valor total das parcelas + */ +total: number +} +/** + * Modelo que representa um local na API + */ +export interface Place { +id?: number +name: string +address_line_1: string +address_line_2?: string +city: string +neighborhood?: string +zip?: string +home_page?: string +latitude?: number +longitude?: number +images?: string[] +description?: string +email: string +first_phone?: string +second_phone?: string +mobile_phone?: string +only_cash?: boolean +categories?: string[] +marker_url?: string +state?: string +created_at?: string +updated_at?: string +opening_hours?: string +warehouse?: boolean +legal_name?: string +cnpj?: string +} +/** + * Modelo que representa uma nota fiscal na API + */ +export interface Invoice { +/** + * Número da nota fiscal + */ +number: number +/** + * Número de série da nota fiscal + */ +series?: number +/** + * Data e horário da criação da nota fiscal + */ +issued_at?: string +/** + * Chave da nota fiscal + */ +key?: string +volumes?: number +} +/** + * Modelo que representa um recebedor na API + */ +export interface PaymentRecipient { +id: number +percentage: number +active?: boolean +charge_processing_fee?: boolean +liable?: boolean +code?: string +name?: string +tag_name?: string +place_id?: number +recipient_id: number +tag_id?: number +user_id?: number +/** + * Indica se o frete deve ser incluído no split do pagamento + */ +include_shipping?: boolean +} +/** + * Valores que o usuário possui a receber + */ +export interface RecebiveisDoUsuario { +type?: string +status?: string +amount?: number +fee?: number +installment?: number +credit_date?: string +order_date?: string +transaction_id?: number +} +/** + * Modelo que representa um membro do público + */ +export interface AudienceMember { +id?: number +first_name?: string +last_name?: string +email: string +phone_area?: string +phone?: string +tags?: string[] +} +/** + * Modelo de carcaterística de produto para item no carrinho + */ +export interface Produto { +sku: string +quantity: number +extra?: { + +} +place_id?: number +store_coupon_code?: string +customizations?: any[] +} +/** + * Modelo que representa uma promoção na API + */ +export interface Discount1 { +/** + * Código identificador `ID` do desconto + */ +id?: number +/** + * Nome do desconto ou promoção + */ +name: string +/** + * Descrição do desconto + */ +description?: string +/** + * Data de início da regra do desconto + */ +start_at: string +/** + * Data de fim da regra do desconto + */ +end_at?: string +/** + * Indica se o desconto está habilitado (`true`) ou desabilitado (`false`) + */ +enabled: boolean +/** + * Em desuso + */ +facebook?: boolean +/** + * Indica a regra da promoção: se o desconto é aplicado na vitrine ou no carrinho da loja + */ +valid_to?: string +/** + * Email do cliente, no caso de promoções direcionadas para clientes específicos + */ +email?: string +/** + * Cadastro de Pessoa Física (CPF) do cliente, no caso de promoções direcionadas para clientes específicos + */ +cpf?: string +/** + * Tag de agrupamento de promoção + */ +tags?: string +} +/** + * Modelo que representa uma regra de desconto na API + */ +export interface DiscountRule { +id?: number +amount: number +type: ("fixed" | "percentage") +apply_to: string +min_quantity: number +product?: { +id?: number +reference?: string +name?: string +} +tag?: { +name?: string +} +combined_product?: { +id?: number +reference?: string +name?: string +} +min_subtotal: number +shipping_method?: string +shipping_rule?: ("any" | "all") +regions?: string[] +agent_tag?: string +channel?: string[] +} +/** + * Modelo que representa um cupom de desconto + */ +export interface Coupon { +id?: number +code?: string +uses_per_code?: number +uses_per_user?: number +referrer_email?: string +user_id?: number +updated_at?: string +orders_count?: number +} +/** + * Modelo que representa um produto na API + */ +export interface Product { +/** + * Código identificador `ID` do priduto + */ +id?: number +/** + * Indica se o produto está ativo (`true`) ou invativo (`false`) + */ +active?: boolean +/** + * Indica se o produto está disponível (`true`) ou indisponível (`false`) + */ +available?: boolean +category_tags?: { +/** + * Tipo de tag + */ +tag_type?: string +/** + * Nome da tag + */ +name?: string +/** + * Título da tag + */ +title?: string +}[] +/** + * Descrição do produto + */ +description?: string +/** + * Código de desconto + */ +discount_id?: number +/** + * Descrição do produto em HTML + */ +html_description?: string +/** + * URL da imagem do produto + */ +image_url?: string +/** + * Relação das parcelas para pagamento parcelado + */ +installments?: number[] +/** + * Quantidade mínima para venda do produto + */ +min_quantity?: string +/** + * Nome do produto + */ +name?: string +/** + * Indica se o produto está em promoção (`true`) ou não (`false`) + */ +on_sale?: boolean +/** + * Descrição simplificada + */ +plain_description?: string +/** + * Preço do item + */ +price?: number +/** + * Média de avaliação do produto + */ +rating?: { +rating?: number +votes?: number +} +/** + * Código de referência do produto + */ +reference?: string +/** + * Preço promocional + */ +sale_price?: number +/** + * slug do produto + */ +slug?: string +/** + * Lista de tags que o produto é associado + */ +tag_names?: string[] +/** + * Data e horário da última atualização do produto + */ +updated_at?: string +/** + * URL do produto + */ +url?: string +/** + * Variantes do produto + */ +variants?: { +"{id}"?: ProductVariant +}[] +/** + * Regras de desconto de uma promoção + */ +discount_rule: { +type: ("fixed" | "percentage") +amount: number +} +/** + * Imagens do produto + */ +images?: { +/** + * id do produto + */ +id?: number +/** + * Url do produto + */ +url?: string +/** + * Data e horário da última atualização do produto + */ +updated_at?: string +variant_ids?: { + +}[] +}[] +} +/** + * Modelo que representa uma variante na API + */ +export interface ProductVariant { +available: boolean +available_quantity: number +/** + * Customização da variante + */ +custom_attributes: { + +} +/** + * Dias de manuseio da variante + */ +handling_days: number +height: number +id?: number +/** + * URL da imagem da variante + */ +image_url: string +installments: number[] +inventories?: ProductVariantInventory[] +length: number +main: boolean +/** + * Quantidade mínima para venda + */ +min_quantity: number +/** + * Nome da variante + */ +name: string +norder: number +/** + * Preço do item + */ +price: number +product_id: number +/** + * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante + */ +properties: { +property1?: VariantProperty +property2?: VariantProperty +property3?: VariantProperty +} +quantity: number +/** + * Quantidade de itens vendidos + */ +quantity_sold?: number +/** + * Preço promocional + */ +sale_price: number +sku: string +slug: string +/** + * Quantidade de itens disponíveis + */ +stock: number +/** + * Data e horário da última atualização da variante + */ +updated_at: string +/** + * Massa do produto, em gramas + */ +weight: number +/** + * Largura do produto, em centímetros + */ +width: number +required?: [] +additionalProperties?: never +} +/** + * Modelo que representa um inventory da variante na API + */ +export interface ProductVariantInventory { +/** + * Código identificador `ID` do inventário + */ +id: number +/** + * Nome do inventário + */ +name?: string +/** + * Código identificador do local + */ +place_id: number +/** + * Nome do local + */ +place_name?: string +/** + * Preço do item + */ +price: number +/** + * Quantidade de itens no inventário + */ +quantity: number +/** + * Quantidade de itens vendidos + */ +quantity_sold: number +/** + * Preço promocional + */ +sale_price: number +/** + * Slug do inventário + */ +slug: string +/** + * Data e horário da última atualização da variante no inventário + */ +updated_at: string +/** + * Código da variante + */ +variant_id: number +/** + * Data de criação do inventário + */ +created_at: string +} +/** + * Modelo simplificado de um produto para atualização e criação + */ +export interface SimpleProduct { +name: string +description?: string +active?: boolean +reference: string +tag_list?: string +} +/** + * Modelo que representa um produto retornado via busca no Elasticsearch + */ +export interface ProductSearch { +id: number +active: boolean +available: boolean +subscription: boolean +slug: string +reference: string +reference_lowercase: string +name: string +description: string +image_url: string +url: string +tags: { +name: string +title: string +subtitle: string +description: string +importance: number +type: string +image_url: string +}[] +/** + * Preço do item + */ +price: number +on_sale: boolean +/** + * Preço promocional + */ +sale_price: number +intl_price: number +discount_id: number +discount_rule: { +type: ("fixed" | "percentage") +amount: number +} +discount: { +name: string +description: string +/** + * Em desuso + */ +facebook: boolean +valid_to: string +} +images: { +sku: string +url: string +}[] +variants: VariantProductSearch[] +installments: ProductInstallment[] +created_at: string +/** + * Data e horário da última atualização do produto + */ +updated_at: string +} +/** + * Modelo que representa uma variante retornada via busca no Elasticsearch + */ +export interface VariantProductSearch { +id: number +sku: string +sku_lowercase: string +name: string +full_name: string +main: boolean +available: boolean +image_url: string +/** + * Preço do item + */ +price: number +/** + * Preço promocional + */ +sale_price: number +intl_price: number +installments: ProductInstallment[] +/** + * Quantidade de itens disponíveis + */ +stock: number +quantity: number +/** + * Quantidade de itens vendidos + */ +quantity_sold: number +/** + * Quantidade mínima para venda + */ +min_quantity: number +available_quantity: number +/** + * Customização da variante + */ +custom_attributes: { + +} +/** + * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante + */ +properties: { +property1?: VariantPropertyProductSearch +property2?: VariantPropertyProductSearch +property3?: VariantPropertyProductSearch +} +inventories: { +name: string +slug: string +available: boolean +/** + * Preço do item + */ +price: number +/** + * Preço promocional + */ +sale_price: number +quantity: number +/** + * Quantidade de itens vendidos + */ +quantity_sold: number +place: { +id: number +name: string +} +}[] +/** + * Dias de manuseio da variante + */ +handling_days: number +barcode: string +/** + * Massa do produto, em gramas + */ +weight: number +/** + * Largura do produto, em centímetros + */ +width: number +/** + * Altura do produto, em centímetros + */ +height: number +/** + * Comprimento do produito, em centímetros + */ +length: number +required?: [] +additionalProperties?: never +} +/** + * Modelo que representa uma parcela + */ +export interface ProductInstallment { +number: number +/** + * Preço do item + */ +price: number +interest: boolean +interest_rate: number +total: number +} +/** + * Modelo que representa uma propriedade de uma variante quando retornada via Elasticsearch + */ +export interface VariantPropertyProductSearch { +name: string +value: string +defining: boolean +} +/** + * Modelo que representa uma propriedade de uma variante + */ +export interface VariantProperty1 { +/** + * Nome da propriedade + */ +name: string +/** + * Valor da propriedade + */ +value: string +/** + * Indica se a variante possui uma definição (`true`) ou se a variante não possui (`false`) + */ +defining: boolean +} +/** + * Modelo que representa uma tag na API + */ +export interface Tag { +name: string +title?: string +subtitle?: string +description?: string +type?: string +products_count?: number +image_url?: string +updated_at?: string +} +/** + * Modelo que representa um cliente na API + */ +export interface Client { +id?: number +first_name?: string +last_name?: string +email?: string +gender?: string +phone_area?: string +phone?: string +document_type?: ("CPF" | "CNPJ") +/** + * Número de documento cadastrado pelo cliente + */ +document_number?: string +cpf?: string +cnpj?: string +ie?: string +tags?: string +lists?: string[] +facebook_uid?: string +liked_facebook_page?: boolean +updated_at?: string +birthdate?: string +recent_address?: { +id?: string +first_name?: string +last_name?: string +company_name?: string +street_name?: string +street_number?: string +neighborhood?: string +complement?: string +reference?: string +city?: string +state?: string +zip?: string +first_phone_area?: string +first_phone?: string +second_phone_area?: string +second_phone?: string +email?: string +documents?: { +cpf?: string +cnpj?: string +} +}[] +auth_token?: string +last_confirmed_order_at?: string +received_orders_count?: number +confirmed_orders_count?: number +canceled_orders_count?: number +renew_password?: boolean +} +/** + * Modelo que representa um endereço na API + */ +export interface Address { +id?: number +first_name?: string +last_name?: string +company_name?: string +email?: string +documents?: { +cpf?: string +cnpj?: string +} +street_name?: string +street_number?: string +complement?: string +neighborhood?: string +first_phone_area?: string +first_phone?: string +second_phone_area?: string +second_phone?: string +reference?: string +zip?: string +city?: string +state?: string +recipient_name?: string +} +/** + * Modelo que representa os endereços cadastrados pelo cliente na API + */ +export interface Client1 { +id?: number +street_name?: string +street_number?: string +complement?: string +neighborhood?: string +label?: string +zip?: string +city?: string +state?: string +reference?: string +client_id?: number +} +/** + * Modelo que representa um bônus na API + */ +export interface Bonus { +amount?: number +token?: string +valid_from?: string +valid_thru?: string +created_at?: string +updated_at?: string +} +/** + * Modelo que representa um menu na API + */ +export interface Menu { +id?: number +label?: string +title?: string +description?: string +url?: string +external?: boolean +parent_id?: number +tag_id?: number +tag_name?: string +page_id?: number +page_slug?: string +items_count?: number +updated_at?: string +tooltip?: string +children?: Menu[] +image_url?: string +simple_url?: string +position?: string +norder?: number +type?: string +} +/** + * Modelo que representa um menu na API quando retornado pela ação de menu em árvore + */ +export interface MenuTree { +id?: number +title?: string +description?: string +external?: boolean +url?: string +tag_id?: number +page_id?: number +items_count?: number +children?: MenuTree[] +updated_at?: string +tooltip?: string +image_url?: string +simple_url?: string +norder?: number +} +/** + * Modelo que representa as mensagens do site na API + */ +export interface SiteMessage { +id?: number +title?: string +description?: string +call_to_action?: string +created_at?: string +updated_at?: string +} +/** + * Modelo que representa as imagens da loja na API + */ +export interface ShopAsset { +id?: number +position?: string +file_uid?: string +file_name?: string +updated_at?: string +} +/** + * Modelo que representa um atributo customizado de produto + */ +export interface ProductsAttributes { +index?: number +name?: string +mandatory?: boolean +updated_at?: string +} +/** + * Modelo que representa uma customização + */ +export interface Customization { +id?: number +group_name?: string +name?: string +label?: string +image_uid?: string +image_name?: string +price?: number +intl_price?: number +quantity?: number +handling_days?: number +tag_id?: number +sku?: string +pattern?: string +} +/** + * Modelo que representa a lista de itens do pedido + */ +export interface OrderItems { +id?: number +variant_id?: number +product_id?: number +quantity?: number +price?: number +weight?: number +width?: number +height?: number +length?: number +extra?: { +customization?: string +} +picture_url?: string +reference?: string +sku?: string +product_name?: string +variant_name?: string +original_price?: string +place_id?: string +place_name?: number +place_city?: number +total?: number +package?: number +has_customizations?: number +barcode?: number +} +/** + * Modelo que representa uma personalização de item do pedido na API + */ +export interface OrderItemCustomization { +/** + * Código identificador `ID` da personalização + */ +id: number +/** + * Número de tipos diferentes de personalizações em produtos do pedido + */ +number: number +/** + * Grupo em que se enquadra a personalização + */ +group_name: string +/** + * Nome do produto + */ +name: string +/** + * Preço do produto + */ +price: number +/** + * Preço internacional + */ +intl_price: number +/** + * Dias de manuseio do produto + */ +handling_days: number +/** + * Código SKU da variante de produto + */ +sku: string +} +/** + * Modelo que representa uma personalização de item do carrinho na API + */ +export interface CartItemCustomization { +/** + * Código identificador do produto + */ +id: number +group_name: string +name: string +number: number +/** + * Preço unitário + */ +price: number +/** + * Preço internacional + */ +intl_price: number +/** + * Número de dias para manuseio + */ +handling_days: number +/** + * Código SKU do produto + */ +sku: string +} +/** + * Modelo que representa um mapeamento na API + */ +export interface Mapping { +id?: number +key: string +from?: string[] +to?: string +created_at?: string +updated_at?: string +} +/** + * Modelo que representa um banner na API + */ +export interface Banner { +big_thumb: string +color: string +description: string +end_at: string +external: boolean +file_name: string +file_uid: string +html_description: string +id: number +norder: number +plain_description: string +small_thumb: string +start_at: string +subtitle: string +tag: string +title: string +updated_at: string +url: string +} +/** + * Modelo que representa um banner simplificado na API + */ +export interface SlimBanner { +id: number +tag: string +title: string +subtitle: string +description: string +url: string +external: boolean +start_at: string +end_at: string +file_url: string +norder: number +color: string +updated_at: string +} +/** + * Modelo que representa as formas de entrega na API + */ +export interface ShippingMethods1 { +/** + * Nome do tipo de entrega, como por exemplo Normal, Expressa e Agendada + */ +name: string +/** + * Identificador do método de envio + */ +value: string +/** + * Preço de envio + */ +price: number +/** + * Descrição do tipo de envio e prazo + */ +description: string +/** + * Número em dias do prazo de envio + */ +delivery_days: number +/** + * Valor restante da compra para que o carrinho fique elegível para frete grátis + */ +value_needed_to_discount?: number +/** + * Código identificador `ID` do tipo de envio + */ +shipping_method_id: number +/** + * Mensagem ou observação sobre a forma de envio + */ +notice?: string +/** + * Empresa responsável pelo envio + */ +fulfillment_company: string +} +/** + * Modelo de endereço de envio para carrinho e pedido + */ +export interface EnderecoDeEnvio { +id?: number +first_name: string +last_name: string +company_name?: string +email: string +/** + * Serão retornados apenas os campos preenchidos + */ +documents?: { +cpf?: string +cnpj?: string +ie?: string +} +street_name: string +street_number: string +complement?: string +neighborhood: string +/** + * Somente números + */ +first_phone_area: string +/** + * Somente números + */ +first_phone: string +/** + * Somente números + */ +second_phone_area?: string +/** + * Somente números + */ +second_phone?: string +reference?: string +/** + * Somente números + */ +zip: string +city: string +state: string +recipient_name?: string +} +/** + * Modelo de endereço de envio para carrinho e pedido + */ +export interface EnderecoDeEnvio1 { +/** + * Nome do cliente + */ +first_name?: string +/** + * Sobrenome do cliente + */ +last_name?: string +/** + * Nome da empresa (para clientes jurídicos) + */ +company_name?: string +/** + * Email do cliente + */ +email?: string +/** + * Código de Discagem Direta à Distância (DDD) + */ +first_phone_area?: string +/** + * Telefone do cliente + */ +first_phone?: string +/** + * Código de Discagem Direta à Distância (DDD) + */ +second_phone_area?: string +/** + * Telefone do cliente + */ +second_phone?: string +/** + * Nome do recebedor + */ +recipient_name?: { +[k: string]: any +} +/** + * Logradouro + */ +street_name?: string +/** + * Número + */ +street_number?: string +/** + * Complemento + */ +complement?: string +/** + * Bairro + */ +neighborhood?: string +/** + * Ponto de referência + */ +reference?: string +/** + * Código de Endereçamento Postal (CEP) + */ +zip: string +documents?: { +/** + * Cadastro de Pessoa Física + */ +cpf?: string +/** + * Registro Geral + */ +rg?: string +/** + * Cadastro Nacional de Pessoas Jurídicas + */ +cnpj?: string +/** + * Inscrição Estadual + */ +ie?: string +}[] +} +/** + * Modelo que representa os preços de uma variante + */ +export interface ProductPriceVariant { +/** + * Define se a variante do produto é a principal + */ +main: boolean +/** + * Código SKU da variante + */ +sku: string +/** + * Preço do item + */ +price: number +on_sale: boolean +/** + * Preço promocional + */ +sale_price: number +intl_price: number +available: boolean +/** + * [Atributos](https://developers.vnda.com.br/docs/atributos-de-produto) da variante + */ +properties: { +property1?: VariantProperty1 +property2?: VariantProperty1 +property3?: VariantProperty1 +} +/** + * Quantidade de itens disponíveis + */ +stock: number +installments: ProductInstallment[] +required?: [] +additionalProperties?: never +} +/** + * Modelo que representa uma imagem de um produto + */ +export interface ProductImage { +/** + * Código identificador `ID` da imagem + */ +id: number +/** + * URL da imagem + */ +url: string +/** + * Data e horário da última atualização da imagem do produto + */ +updated_at: string +/** + * Códigos das variantes que utilizam a imagem + */ +variant_ids: number[] +} +/** + * Modelo que representa um pacote na API + */ +export interface Package { +actual_shipping_method: string +/** + * Código identificador do pacote + */ +code: string +/** + * Data de entrega do pacote + */ +delivered_at: string +delivered_email_sent_at: string +/** + * Número de dias para entrega + */ +delivery_days: number +/** + * Tipo de envio do pacote + */ +delivery_type: string +/** + * Quantidade de dias úteis para entrega + */ +delivery_work_days: number +/** + * Transportadora + */ +fulfillment_company: string +/** + * Status de envio + */ +fulfillment_status: ("waiting" | "shipped" | "delivered") +integrated: boolean +invoiced: boolean +label: string +properties: { + +} +quoted_shipping_price: number +shipped_at: string +shipped_email_sent_at: string +shipping_label: string +shipping_name: string +shipping_price: number +total: number +/** + * Data e horário da última atualização do código de rastreio do pacote + */ +tracked_at: string +/** + * Código de rastreio do pacote + */ +tracking_code: string +required?: [] +additionalProperties?: never +} +/** + * Modelo simplificado de um produto para atualização e criação + */ +export interface SimpleProduct1 { +/** + * Código de Referência do produto + */ +reference: string +/** + * Nome do produto + */ +name: string +/** + * Descrição do produto + */ +description?: string +/** + * Indica se o produto está ativo (`true`) ou invativo (`false`) + */ +active?: boolean +/** + * Tags associadas ao produto + */ +tag_list?: string +/** + * Tipo de produto + */ +product_type?: ("product" | "sample" | "subscription") +} +/** + * Modelo de carcaterística de produto para item no carrinho + */ +export interface Produto1 { +/** + * Código SKU da variante do produto + */ +sku?: string +/** + * Unidades do produto disponíveis fisicamente + */ +quantity?: number +/** + * Campo para registro de observações, chave ou valores necessários + */ +extra?: { + +} +/** + * Código identificador do local do produto + */ +place_id?: number +/** + * Código de cupom + */ +store_coupon_code?: string +/** + * [Personalização](http://ajuda.vnda.com.br/pt-BR/articles/1763398-funcionalidades-produtos-personalizados) do produto + */ +customizations?: { +/** + * [Personalização](http://ajuda.vnda.com.br/pt-BR/articles/1763398-funcionalidades-produtos-personalizados) incluídas no Admin da loja. + * Se por exemplo a customização do produto é a cor, o parâmetro para a requisição deve ser `Color` ao invés de `CUstomization`. + */ +Customization?: string +}[] +} +/** + * Modelo de produto em um pedido + */ +export interface ProdutoEmUmPedido1 { +/** + * Dados extra do produto + */ +extra: { + +} +/** + * Altura do produto, em centímetros. + */ +height?: number +/** + * código identificador do produto + */ +id?: number +/** + * Comprimento do produito, em centímetros. + */ +length?: number +/** + * Preço original + */ +original_price?: number +/** + * Pacote do produto + */ +package?: string +/** + * URL da imagem do produto + */ +picture_url?: string +/** + * Cidade que o produto está + */ +place_city?: string +/** + * Código identificador do local do produto + */ +place_id?: number +/** + * Nome do local do produto + */ +place_name?: string +/** + * Preço do produto + */ +price?: number +product_id: number +product_name: string +/** + * Unidades do produto + */ +quantity: number +/** + * Código de referência do produto + */ +reference: string +/** + * Código SKU da variante do produto + */ +sku: string +/** + * Valor total do produto + */ +total: number +/** + * Código identificador da variante do produto + */ +variant_id: number +/** + * Nome da variante do produto + */ +variant_name: string +/** + * Massa do produto, em gramas + */ +weight: number +/** + * Largura do produto, em centímetros + */ +width: number +/** + * Código de barras do produto + */ +barcode?: string +/** + * Indica se o produto possui customização. + */ +has_customizations?: boolean } diff --git a/vnda/utils/openapi/vnda.openapi.json b/vnda/utils/openapi/vnda.openapi.json index 3c0d21adb..cb8536cc3 100644 --- a/vnda/utils/openapi/vnda.openapi.json +++ b/vnda/utils/openapi/vnda.openapi.json @@ -24,6 +24,55 @@ } ], "paths": { + "/api/v2/products/{product_id}/videos": { + "parameters": [ + { + "schema": { + "type": "string" + }, + "name": "product_id", + "in": "path", + "required": true + } + ], + "get": { + "responses": { + "200": { + "description": "Retorna os videos do produto", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "integer" + }, + "url": { + "type": "string" + }, + "embed_url": { + "type": "string" + }, + "thumbnail_url": { + "type": "string" + }, + "updated_at": { + "type": "integer" + }, + "variant_ids": { + "type": "number" + } + } + } + } + } + } + } + } + } + }, "/api/v2/seo_data": { "get": { "responses": { @@ -727,7 +776,7 @@ "card_pin_mode": null, "card_magstripe_fallback": false, "cvm_pin": false, - "postback_url": "https://demo.vnda.com.br/api/v2/payments/pagarme/notifications", + "postback_url": "https://demo.vnda.com.br/v2/payments/pagarme/notifications", "payment_method": "credit_card", "capture_method": "ecommerce", "antifraud_score": null, @@ -946,7 +995,7 @@ "card_pin_mode": null, "card_magstripe_fallback": false, "cvm_pin": false, - "postback_url": "https://demo.vnda.com.br/api/v2/payments/pagarme/notifications", + "postback_url": "https://demo.vnda.com.br/v2/payments/pagarme/notifications", "payment_method": "credit_card", "capture_method": "ecommerce", "antifraud_score": null, @@ -5060,27 +5109,11 @@ "schema": { "type": "object", "properties": { - "sku": { - "type": "string" - }, - "quantity": { - "type": "integer", - "minimum": 0, - "exclusiveMinimum": true - }, - "extra": { - "type": "object" - }, - "place_id": { - "type": "integer", - "minimum": 0, - "exclusiveMinimum": true - }, "items": { "type": "array", "description": "Itens do carrinho", "items": { - "type": "array", + "type": "object", "properties": { "sku": { "type": "string", @@ -5107,39 +5140,31 @@ "sku", "quantity" ] - }, - "example": { - "itemcustomizado": { - "items": { - "value": [ - { - "sku": "variante.sku1", - "quantity": 1, - "customizations": [ - { - "Color": "Black" - } - ] - }, - { - "sku": "variante.sku2", - "quantity": 10, - "customizations": [ - { - "Color": "Red" - } - ] - } - ] - } - } } } }, - "required": [ - "sku", - "quantity" - ] + "example": { + "items": [ + { + "sku": "teste", + "quantity": 1, + "customizations": [ + { + "Color": "Black" + } + ] + }, + { + "sku": "variante.sku2", + "quantity": 10, + "customizations": [ + { + "Color": "Red" + } + ] + } + ] + } } } } @@ -7061,7 +7086,7 @@ "type": "object" }, "in": "query", - "name": "type_tags", + "name": "type_tags[]", "description": "Filtra pelo nome da tag dentro de um tipo de tag. Exemplo, type_tags[cor]=verde" }, { @@ -7084,7 +7109,7 @@ } }, "in": "query", - "name": "property1_values", + "name": "property1_values[]", "description": "Filtra pelo valor da propriedade 1" }, { @@ -7107,7 +7132,7 @@ } }, "in": "query", - "name": "property2_values", + "name": "property2_values[]", "description": "Filtra pelo valor da propriedade 2" }, { @@ -7130,7 +7155,7 @@ } }, "in": "query", - "name": "property3_values", + "name": "property3_values[]", "description": "Filtra pelo valor da propriedade 3" }, { @@ -12997,7 +13022,7 @@ "card_pin_mode": null, "card_magstripe_fallback": false, "cvm_pin": false, - "postback_url": "https://demo.vnda.com.br/api/v2/payments/pagarme/notifications", + "postback_url": "https://demo.vnda.com.br/v2/payments/pagarme/notifications", "payment_method": "credit_card", "capture_method": "ecommerce", "antifraud_score": null, @@ -13202,7 +13227,7 @@ "card_pin_mode": null, "card_magstripe_fallback": false, "cvm_pin": false, - "postback_url": "https://demo.vnda.com.br/api/v2/payments/pagarme/notifications", + "postback_url": "https://demo.vnda.com.br/v2/payments/pagarme/notifications", "payment_method": "credit_card", "capture_method": "ecommerce", "antifraud_score": null, @@ -17946,6 +17971,10 @@ "rebate_token": { "type": "string", "description": "Token do desconto" + }, + "user_id": { + "type": "number", + "description": "Id do agente" } } }, diff --git a/vnda/utils/segment.ts b/vnda/utils/segment.ts new file mode 100644 index 000000000..9a6b7d4b0 --- /dev/null +++ b/vnda/utils/segment.ts @@ -0,0 +1,51 @@ +import { getCookies, setCookie } from "std/http/mod.ts"; +import { AppContext } from "../mod.ts"; + +interface Segment { + agent: string; +} + +export const SEGMENT_COOKIE_NAME = "vnda_segment"; +const SEGMENT = Symbol("segment"); +const SIXTYDAYS = new Date(Date.now() + 60 * 24 * 60 * 60 * 1000); + +export const getSegmentFromBag = (ctx: AppContext): string => + ctx.bag?.get(SEGMENT); +export const setSegmentInBag = (ctx: AppContext, segment: string) => + ctx.bag?.set(SEGMENT, segment); + +export const parse = (cookie: string) => JSON.parse(atob(cookie)); + +export const buildSegmentCookie = (req: Request): string | null => { + const url = new URL(req.url); + const param = url.searchParams.get("agent"); + if (param) { + const partialSegment: string = param; + return partialSegment; + } + return null; +}; + +export const getSegmentFromCookie = ( + req: Request, +): string | undefined => { + const cookies = getCookies(req.headers); + const cookie = cookies[SEGMENT_COOKIE_NAME]; + return cookie; +}; + +export const setSegmentCookie = ( + segment: string, + headers: Headers = new Headers(), +): Headers => { + setCookie(headers, { + value: segment, + name: SEGMENT_COOKIE_NAME, + path: "/", + secure: true, + httpOnly: true, + expires: SIXTYDAYS, + }); + + return headers; +}; diff --git a/vnda/utils/transform.ts b/vnda/utils/transform.ts index 559d09e08..84133429f 100644 --- a/vnda/utils/transform.ts +++ b/vnda/utils/transform.ts @@ -1,12 +1,15 @@ import { Filter, + ImageObject, Offer, Product, PropertyValue, Seo, UnitPriceSpecification, } from "../../commerce/types.ts"; -import { ProductGroup, SEO } from "./client/types.ts"; +import { STALE } from "../../utils/fetch.ts"; +import { AppContext } from "../mod.ts"; +import { ProductGroup, ProductPrice, SEO } from "./client/types.ts"; import { OpenAPI, Product as OProduct, @@ -15,34 +18,63 @@ import { ProductVariant, VariantProductSearch, } from "./openapi/vnda.openapi.gen.ts"; +import { getSegmentFromCookie, parse } from "./segment.ts"; -type VNDAProductGroup = ProductSearch | OProduct; +export type VNDAProductGroup = ProductSearch | OProduct; type VNDAProduct = VariantProductSearch | ProductVariant; interface ProductOptions { url: URL; /** Price coded currency, e.g.: USD, BRL */ priceCurrency: string; + productPrice?: ProductPrice | null; } +type TypeTags = (string | { + key: string; + value: string; + isProperty: boolean; +})[]; + export const getProductCategoryTag = ({ tags }: ProductGroup) => tags?.filter(({ type }) => type === "categoria")[0]; +export const canonicalFromTags = ( + tags: Pick[], + url: URL, +) => { + const pathname = tags.map((t) => t.name).join("/"); + return new URL(`/${pathname}`, url); +}; + export const getSEOFromTag = ( - tag: Pick, - req: Request, -): Seo => ({ - title: tag.title || "", - description: tag.description || "", - canonical: req.url, -}); + tags: Pick[], + url: URL, + seo: OpenAPI["GET /api/v2/seo_data"]["response"][0] | undefined, + hasTypeTags: boolean, + isSearchPage?: boolean, +): Seo => { + const tag = tags.at(-1); + const canonical = canonicalFromTags(tags, url); + + if (url.searchParams.has("page")) { + canonical.searchParams.set("page", url.searchParams.get("page")!); + } + + return { + title: isSearchPage ? "" : seo?.title || tag?.title || "", + description: isSearchPage ? "" : seo?.description || tag?.description || "", + canonical: canonical.href, + noIndexing: hasTypeTags, + }; +}; export const parseSlug = (slug: string) => { const segments = slug.split("-"); const id = Number(segments.at(-1)); if (!id) { - throw new Error("Malformed slug. Expecting {slug}-{id} format"); + return null; } return { @@ -51,15 +83,21 @@ export const parseSlug = (slug: string) => { }; }; -const pickVariant = (product: VNDAProductGroup, variantId: string | null) => { - const variants = normalizeVariants(product.variants); - const [head] = variants; +export const pickVariant = ( + variants: VNDAProductGroup["variants"], + variantId: string | null, + normalize = true, +) => { + const normalizedVariants = normalize + ? normalizeVariants(variants) + : variants as VariantProductSearch[]; + const [head] = normalizedVariants; let [target, main, available]: Array< VNDAProduct | null > = [null, head, null]; - for (const variant of variants) { + for (const variant of normalizedVariants) { if (variant.sku === variantId) target = variant; else if (variant.main) main = variant; else if (variant.available && !available) available = variant; @@ -94,15 +132,16 @@ const normalizeInstallments = ( const toURL = (src: string) => src.startsWith("//") ? `https:${src}` : src; -const toOffer = ({ +export const toOffer = ({ price, sale_price, + intl_price, available_quantity, available, installments = [], -}: VNDAProduct): Offer | null => { +}: VNDAProduct & { intl_price?: number }): Offer[] => { if (!price || !sale_price) { - return null; + return []; } const priceSpecification: UnitPriceSpecification[] = [{ @@ -132,8 +171,8 @@ const toOffer = ({ }); } - return { - "@type": "Offer", + const offers: Offer[] = [{ + "@type": "Offer" as const, seller: "VNDA", price, priceSpecification, @@ -143,7 +182,30 @@ const toOffer = ({ availability: available ? "https://schema.org/InStock" : "https://schema.org/OutOfStock", - }; + }]; + + if (intl_price) { + offers.push({ + "@type": "Offer", + seller: "VNDA_INTL", + price: intl_price, + priceSpecification: [{ + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/SalePrice", + price: intl_price, + }], + inventoryLevel: { + value: available_quantity, + }, + availability: available + ? "https://schema.org/InStock" + : "https://schema.org/OutOfStock", + // Static since VNDA only have a BRL price and USD when intl_price is available + priceCurrency: "USD", + }); + } + + return offers; }; const toPropertyValue = (variant: VNDAProduct): PropertyValue[] => @@ -168,6 +230,22 @@ const toPropertyValueTags = (tags: ProductSearch["tags"]): PropertyValue[] => } as PropertyValue) ); +const toPropertyValueCategoryTags = ( + categoryTags: OProduct["category_tags"], +) => { + if (!categoryTags) return []; + + return categoryTags.map((tag) => { + return { + "@type": "PropertyValue", + name: tag.tag_type, + value: tag.name, + description: tag.title, + valueReference: "TAGS", + } as PropertyValue; + }); +}; + // deno-lint-ignore no-explicit-any const isProductVariant = (p: any): p is VariantProductSearch => typeof p.id === "number"; @@ -179,29 +257,52 @@ const normalizeVariants = ( isProductVariant(v) ? [v] : Object.values(v) as VNDAProduct[] ); +const toImageObjectVideo = ( + video: OpenAPI["GET /api/v2/products/:productId/videos"]["response"], +): ImageObject[] => + video?.map(({ url, embed_url, thumbnail_url }) => ({ + "@type": "ImageObject", + encodingFormat: "video", + contentUrl: url, + thumbnailUrl: thumbnail_url, + embedUrl: embed_url, + } as ImageObject)); + export const toProduct = ( product: VNDAProductGroup, variantId: string | null, options: ProductOptions, level = 0, ): Product => { - const { url, priceCurrency } = options; - const variant = pickVariant(product, variantId); + const { url, priceCurrency, productPrice } = options; + const variant = pickVariant(product.variants, variantId); const variants = normalizeVariants(product.variants); + const variantPrices = productPrice?.variants + ? pickVariant( + productPrice.variants as VNDAProductGroup["variants"], + variantId, + false, + ) + : null; + const offers = toOffer(variantPrices ?? variant); + const variantUrl = new URL( `/produto/${product.slug}-${product.id}?skuId=${variant.sku}`, url.origin, ).href; + const productUrl = new URL( `/produto/${product.slug}-${product.id}`, url.origin, ).href; + const productID = `${variant.sku}`; const productGroupID = `${product.id}`; - const offer = toOffer(variant); - const offers = offer ? [offer] : []; const myTags = "tags" in product ? product.tags : []; + const myCategoryTags = "category_tags" in product + ? product.category_tags + : []; return { "@type": "Product", @@ -213,6 +314,7 @@ export const toProduct = ( additionalProperty: [ ...toPropertyValue(variant), ...toPropertyValueTags(myTags), + ...toPropertyValueCategoryTags(myCategoryTags), ], inProductGroupWithID: productGroupID, gtin: product.reference, @@ -230,12 +332,14 @@ export const toProduct = ( image: product.images?.length ?? 0 > 1 ? product.images?.map((img) => ({ "@type": "ImageObject" as const, + encodingFormat: "image", alternateName: `${img.url}`, url: toURL(img.url!), })) : [ { "@type": "ImageObject", + encodingFormat: "image", alternateName: product.name ?? "", url: toURL(product.image_url ?? ""), }, @@ -244,8 +348,8 @@ export const toProduct = ( offers: { "@type": "AggregateOffer", priceCurrency: priceCurrency, - highPrice: product.price!, - lowPrice: product.sale_price!, + highPrice: productPrice?.price ?? product.price!, + lowPrice: productPrice?.sale_price ?? product.sale_price!, offerCount: offers.length, offers: offers, }, @@ -271,8 +375,7 @@ const removeFilter = ( filter: { key: string; value: string }, ) => typeTagsInUse.filter((inUse) => - inUse.key !== filter.key && - inUse.value !== filter.value + !(inUse.key === filter.key && inUse.value === filter.value) ); export const toFilters = ( @@ -295,13 +398,37 @@ export const toFilters = ( }, }; - const types = Object.keys(aggregations.types ?? {}).map((typeKey) => { - // deno-lint-ignore no-explicit-any - const typeValues = (aggregations.types as any)[typeKey] as { + const combinedFiltersKeys = Object.keys(aggregations.types ?? {}).concat( + ...Object.keys(aggregations.properties ?? {}), + ); + + const types = combinedFiltersKeys.map((typeKey) => { + const isProperty = typeKey.includes("property"); + + interface AggregationType { name: string; title: string; count: number; - }[]; + value: string; + } + const typeValues: AggregationType[] = isProperty + // deno-lint-ignore no-explicit-any + ? ((aggregations.properties as any)[ + typeKey as string + ] as AggregationType[]) + // deno-lint-ignore no-explicit-any + : ((aggregations.types as any)[ + typeKey as string + ] as AggregationType[]); + + if (isProperty) { + typeValues.forEach((obj) => { + if (obj.value) { + obj.title = obj.value; + obj.name = obj.value; + } + }); + } return { "@type": "FilterToggle" as const, @@ -338,25 +465,93 @@ export const toFilters = ( ]; }; -export const typeTagExtractor = (url: URL) => { +export const typeTagExtractor = (url: URL, tags: { type?: string }[]) => { + const cleanUrl = new URL(url); const keysToDestroy: string[] = []; - const typeTags: { key: string; value: string }[] = []; - const typeTagRegex = /\btype_tags\[(\S+)\]\[\]/; + const typeTags: { key: string; value: string; isProperty: boolean }[] = []; + const typeTagRegex = /\btype_tags\[(.*?)\]\[\]/; - url.searchParams.forEach((value, key) => { + cleanUrl.searchParams.forEach((value, key) => { const match = typeTagRegex.exec(key); if (match) { - keysToDestroy.push(key); - typeTags.push({ key, value }); + const tagValue = match[1]; + const isProperty = tagValue.includes("property"); + if (tags.some((tag) => tag.type === tagValue) || isProperty) { + keysToDestroy.push(key); + typeTags.push({ key, value, isProperty }); + } } }); - // it can't be done inside the forEach instruction above - typeTags.forEach((tag) => url.searchParams.delete(tag.key)); + keysToDestroy.forEach((key) => cleanUrl.searchParams.delete(key)); + + cleanUrl.searchParams.delete("page"); return { typeTags, - cleanUrl: url, + cleanUrl, }; }; + +export const addVideoToProduct = ( + product: Product, + video: OpenAPI["GET /api/v2/products/:productId/videos"]["response"] | null, +): Product => ({ + ...product, + image: [ + ...(product?.image ?? []), + ...(video ? toImageObjectVideo(video) : []), + ], +}); + +export const fetchAndApplyPrices = async ( + products: Product[], + priceCurrency: string, + req: Request, + ctx: AppContext, +): Promise => { + const segmentCookie = getSegmentFromCookie(req); + const segment = segmentCookie ? parse(segmentCookie) : null; + + const pricePromises = products.map((product) => + ctx.api["GET /api/v2/products/:productId/price"]({ + productId: product.sku, + coupon_codes: segment?.cc ? [segment.cc] : [], + }, STALE) + ); + + const priceResults = await Promise.all(pricePromises); + + return products.map((product) => { + const matchingPriceInfo = priceResults.find((priceResult) => + (priceResult as unknown as ProductPrice).variants.some((variant) => + variant.sku === product.sku + ) + ) as unknown as ProductPrice; + + const variantPrices = matchingPriceInfo?.variants + ? pickVariant( + matchingPriceInfo.variants as VNDAProductGroup["variants"], + product.sku, + false, + ) + : null; + + if (!variantPrices) return product; + + const offers = toOffer(variantPrices); + + return { + ...product, + offers: { + "@type": "AggregateOffer" as const, + priceCurrency: priceCurrency, + highPrice: variantPrices?.price ?? product.offers?.highPrice ?? 0, + lowPrice: variantPrices?.sale_price ?? product.offers?.lowPrice ?? 0, + offerCount: offers.length, + offers: offers, + }, + }; + }); +}; diff --git a/vtex/README.md b/vtex/README.md index 2127d19c0..c3faab1e3 100644 --- a/vtex/README.md +++ b/vtex/README.md @@ -1,54 +1,6 @@ -

-

- - VTEX - -

-

- -

- - VTEX Commerce Platform for B2B & B2C Ecommerce Solution - -

-

- Loaders, actions and workflows for adding VTEX Commerce Platform to your deco.cx website. -

- -

VTEX is a cloud-based e-commerce platform and digital commerce company that provides a comprehensive set of tools and services for businesses looking to establish and manage their online retail operations. This app wrapps VTEX API into a comprehensive set of loaders/actions/workflows empowering non technical users to interact and act upon their headless commerce. -

- -# Installation - -1. Install via decohub -2. Fill the necessary fields: - -1. Account name. More info on how to retrieve this param, take a look at this - [article](https://help.vtex.com/en/tutorial/what-is-an-account-name--i0mIGLcg3QyEy8OCicEoC?&utm_source=autocomplete) -2. Public URL: A public URL pointing to your VTEX installation. If your store is - accessible via www.store.com, create a secure.store.com domain pointing to - your VTEX account - -Optional Step: The previous config will allow you to have a headless storefront -(home page, product details page, product listing page and cart). If you want to -use a custom search engine (Algolia, Typesense etc), you will need to fill the -App Key & App Token properties. For these, follow this -[guide](https://help.vtex.com/tutorial/application-keys--2iffYzlvvz4BDMr6WGUtet#generating-app-keys-in-your-account) - -Configure VTEX to send updates to this app by adding deco as an affiliate. To do -this, follow -[this guide](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187?&utm_source=autocomplete) -and use the following endpoint as the notification url. - -https://{account}.deco.site/live/invoke/vtex/actions/trigger.ts - -Configure the event listener at deco. For this: - Open Blocks > Workflows - -Create a new instance of `events.ts` by clicking on `+` - Create the block and -name it `vtex-trigger`. Note this name is important and should not be changed - -🎉 Your VTEX setup is complete. You should now see VTEX -loaders/actions/workflows available for your sections. +If you want to use a custom search engine (Algolia, Typesense etc), you will need to fill the App Key & App Token properties. For these, follow this guide diff --git a/vtex/actions/address/create.ts b/vtex/actions/address/create.ts new file mode 100644 index 000000000..414cf4a40 --- /dev/null +++ b/vtex/actions/address/create.ts @@ -0,0 +1,144 @@ +import { PostalAddress } from "../../../commerce/types.ts"; +import type { AppContext } from "../../mod.ts"; +import { toPostalAddress } from "../../utils/transform.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 extends AddressInput { + id: string; + cacheId: string; +} + +interface Props { + /** + * Address name. + */ + addressName: string; + /** + * 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; + /** + * City of the shipping address. + */ + city?: string; + /** + * State of the shipping address. + */ + state?: string; + /** + * Three letter ISO code of the country of the shipping address. + */ + country?: string; + /** + * Postal Code. + */ + postalCode?: string; + /** + * Street of the address. + */ + street?: string; + /** + * Number of the building, house or apartment in the shipping address. + */ + number?: string; + /** + * Neighborhood of the address. + */ + neighborhood?: string; + /** + * Complement to the shipping address in case it applies. + */ + complement?: string; + /** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ + reference?: string; + /** + * Geo coordinates of the address. + */ + geoCoordinates?: number[]; +} + +const mutation = `mutation SaveAddress($address: AddressInput!) { + saveAddress(address: $address) @context(provider: "vtex.store-graphql") { + addressId + cacheId + id + userId + receiverName + complement + neighborhood + country + state + number + street + geoCoordinates + postalCode + city + name + addressName + addressType + } +}`; + +/** + * @title Create Address + * @description Create a new address + */ +async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + throw new Error("User cookie is invalid"); + } + + const { saveAddress: savedAddress } = await io.query< + { saveAddress: SavedAddress }, + { address: AddressInput } + >( + { + query: mutation, + operationName: "SaveAddress", + variables: { + address: props, + }, + }, + { headers: { cookie } }, + ); + + return toPostalAddress({ + ...savedAddress, + addressId: savedAddress.id || "", + complement: savedAddress.complement || null, + receiverName: savedAddress.receiverName || null, + }); +} + +export const defaultVisibility = "private"; +export default action; 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/delete.ts b/vtex/actions/address/delete.ts new file mode 100644 index 000000000..a09899ee4 --- /dev/null +++ b/vtex/actions/address/delete.ts @@ -0,0 +1,73 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface DeleteAddress { + cacheId: string; + addresses: { + addressId: string; + addressType: string | null; + addressName: string; + city: string | null; + complement: string | null; + country: string | null; + neighborhood: string | null; + number: string | null; + postalCode: string | null; + geoCoordinates: number[] | null; + receiverName: string | null; + reference: string | null; + state: string | null; + street: string | null; + }[]; +} + +const mutation = `mutation DeleteAddress($addressId: String) { + deleteAddress(id: $addressId) { + cacheId + addresses { + addressId: id + addressType + addressName + city + complement + country + neighborhood + number + postalCode + geoCoordinates + receiverName + reference + state + street + } + } +}`; + +interface Props { + addressId: string; +} + +/** + * @title Delete Address + * @description Delete an address + */ +async function action({ addressId }: Props, req: Request, ctx: AppContext) { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + throw new Error("User cookie is invalid"); + } + + return await io.query( + { + query: mutation, + operationName: "DeleteAddress", + variables: { addressId }, + }, + { headers: { cookie } }, + ); +} + +export const defaultVisibility = "private"; +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/update.ts b/vtex/actions/address/update.ts new file mode 100644 index 000000000..41f7783db --- /dev/null +++ b/vtex/actions/address/update.ts @@ -0,0 +1,128 @@ +import type { PostalAddress } from "../../../commerce/types.ts"; +import type { AppContext } from "../../mod.ts"; +import { toPostalAddress } from "../../utils/transform.ts"; +import { Address } from "../../utils/types.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +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 + } + } +}`; + +interface Props { + /** + * Address ID. + */ + addressId: string; + /** + * Address name. + */ + addressName?: string; + /** + * 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; + /** + * City of the shipping address. + */ + city?: string; + /** + * State of the shipping address. + */ + state?: string; + /** + * Three letter ISO code of the country of the shipping address. + */ + country?: string; + /** + * Postal Code. + */ + postalCode?: string; + /** + * Street of the address. + */ + street?: string; + /** + * Number of the building, house or apartment in the shipping address. + */ + number?: string; + /** + * Neighborhood of the address. + */ + neighborhood?: string; + /** + * Complement to the shipping address in case it applies. + */ + complement?: string; + /** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ + reference?: string; + /** + * Latitude and longitude of the shipping address. + */ + geoCoordinates?: number[]; +} + +/** + * @title Update Address + * @description Update an address + */ +async function action( + { addressId, ...props }: Props, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + throw new Error("User cookie is invalid"); + } + + const { updateAddress: updatedAddress } = await io.query< + { updateAddress: Address }, + { addressId: string; addressFields: Omit } + >( + { + query: mutation, + operationName: "UpdateAddress", + variables: { + addressId, + addressFields: { + ...props, + receiverName: props.receiverName || null, + complement: props.complement || null, + }, + }, + }, + { headers: { cookie } }, + ); + + return toPostalAddress(updatedAddress); +} + +export const defaultVisibility = "private"; +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/analytics/sendEvent.ts b/vtex/actions/analytics/sendEvent.ts index d7caab1df..61b6bf228 100644 --- a/vtex/actions/analytics/sendEvent.ts +++ b/vtex/actions/analytics/sendEvent.ts @@ -1,10 +1,33 @@ // Intelligent Search analytics integration import { AppContext } from "../../mod.ts"; -import { getOrSetISCookie } from "../../utils/intelligentSearch.ts"; +import { getISCookiesFromBag } from "../../utils/intelligentSearch.ts"; export type Props = | { type: "session.ping"; + url: string; + } + | { + type: "page.cart"; + products: { + productId: string; + quantity: number; + }[]; + } + | { + type: "page.empty_cart"; + // Empty array is converted to a invalid json schema... so, let it be anything. + // deno-lint-ignore ban-types + products: {}; + } + | { + type: "page.confirmation"; + order: string; + products: { + productId: string; + quantity: number; + price: number; + }[]; } | { type: "search.click"; @@ -15,6 +38,7 @@ export type Props = } | { type: "search.query"; + url: string; text: string; misspelled: boolean; match: number; @@ -24,6 +48,8 @@ export type Props = /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items + * @title Send Analytics Event + * @description Send an analytics event */ const action = async ( props: Props, @@ -31,14 +57,17 @@ const action = async ( ctx: AppContext, ): Promise => { const { sp } = ctx; - const { anonymous, session } = getOrSetISCookie(req, ctx.response.headers); + const cookies = getISCookiesFromBag(ctx); + + if (!cookies) { + throw new Error("Missing IS Cookies"); + } await sp["POST /event-api/v1/:account/event"]({ account: ctx.account }, { body: { ...props, - anonymous, - session, - agent: "deco-sites/apps", + ...cookies, + agent: req.headers.get("user-agent") || "deco-sites/apps", }, headers: { "content-type": "application/json", diff --git a/vtex/actions/authentication/accessKeySignIn.ts b/vtex/actions/authentication/accessKeySignIn.ts new file mode 100644 index 000000000..17c28cb0f --- /dev/null +++ b/vtex/actions/authentication/accessKeySignIn.ts @@ -0,0 +1,61 @@ +import { getCookies, getSetCookies } from "std/http/cookie.ts"; +import { AppContext } from "../../mod.ts"; +import { AuthResponse } from "../../utils/types.ts"; +import setLoginCookies from "../../utils/login/setLoginCookies.ts"; + +export interface Props { + email: string; + accessKey: string; +} + +/** + * @title Authenticate with Email and AcessKey + * @description Return authStatus that show if user is logged or something wrong happens. + */ +export default async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated } = ctx; + + if (!props.email || !props.accessKey) { + throw new Error("Email and/or accessKey is missing"); + } + + const cookies = getCookies(req.headers); + const VtexSessionToken = cookies?.["VtexSessionToken"] ?? null; + + if (!VtexSessionToken) { + throw new Error('"VtexSessionToken" cookie is missing'); + } + + const body = new URLSearchParams(); + body.append("login", props.email); + body.append("accessKey", props.accessKey); + body.append("authenticationToken", VtexSessionToken); + + const response = await vcsDeprecated + ["POST /api/vtexid/pub/authentication/accesskey/validate"]( + {}, + { + body, + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "application/json", + }, + }, + ); + + if (!response.ok) { + throw new Error( + `Authentication request failed: ${response.status} ${response.statusText}`, + ); + } + + const data: AuthResponse = await response.json(); + const setCookies = getSetCookies(response.headers); + await setLoginCookies(data, ctx, setCookies); + + return data; +} diff --git a/vtex/actions/authentication/classicSignIn.ts b/vtex/actions/authentication/classicSignIn.ts new file mode 100644 index 000000000..6c86a9ca8 --- /dev/null +++ b/vtex/actions/authentication/classicSignIn.ts @@ -0,0 +1,65 @@ +import { AppContext } from "../../mod.ts"; +import { AuthResponse } from "../../utils/types.ts"; +import setLoginCookies from "../../utils/login/setLoginCookies.ts"; +import { getSetCookies } from "std/http/cookie.ts"; + +export interface Props { + email: string; + password: string; +} + +/** + * @title Authenticate with Email and Password + * @description This function authenticates a user using their email and password. + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated } = ctx; + + if (!props.email || !props.password) { + throw new Error("Email and/or password is missing"); + } + + const startAuthentication = await ctx.invoke.vtex.actions.authentication + .startAuthentication({}); + + const authenticationToken = startAuthentication?.authenticationToken; + + if (!authenticationToken) { + throw new Error( + "No authentication token returned from startAuthentication", + ); + } + + const urlencoded = new URLSearchParams(); + urlencoded.append("email", props.email); + urlencoded.append("password", props.password); + urlencoded.append("authenticationToken", authenticationToken); + + const response = await vcsDeprecated + ["POST /api/vtexid/pub/authentication/classic/validate"]( + {}, + { + body: urlencoded, + headers: { + "Content-Type": "application/x-www-form-urlencoded", + "Accept": "application/json", + }, + }, + ); + + if (!response.ok) { + throw new Error( + `Authentication request failed: ${response.status} ${response.statusText}`, + ); + } + + const data: AuthResponse = await response.json(); + const setCookies = getSetCookies(response.headers); + await setLoginCookies(data, ctx, setCookies); + + return data; +} diff --git a/vtex/actions/authentication/logout.ts b/vtex/actions/authentication/logout.ts new file mode 100644 index 000000000..39f3d5747 --- /dev/null +++ b/vtex/actions/authentication/logout.ts @@ -0,0 +1,34 @@ +import { getCookies, setCookie } from "std/http/mod.ts"; +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +/** + * @title Logout + * @description Logout the user + */ +export default async function action( + _: unknown, + req: Request, + ctx: AppContext, +) { + const cookies = getCookies(req.headers); + const { payload } = parseCookie(req.headers, ctx.account); + + for (const cookieName in cookies) { + if (cookieName.startsWith("VtexIdclientAutCookie")) { + setCookie(ctx.response.headers, { + name: cookieName, + value: "", + expires: new Date(0), + path: "/", + }); + } + } + + const sessionId = payload?.sess; + if (!sessionId) { + return; + } + + await ctx.invoke.vtex.actions.session.deleteSession({ sessionId }); +} diff --git a/vtex/actions/authentication/recoveryPassword.ts b/vtex/actions/authentication/recoveryPassword.ts new file mode 100644 index 000000000..cc23175e3 --- /dev/null +++ b/vtex/actions/authentication/recoveryPassword.ts @@ -0,0 +1,68 @@ +import { getCookies, getSetCookies } from "std/http/cookie.ts"; +import { AppContext } from "../../mod.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; +import { AuthResponse } from "../../utils/types.ts"; +import setLoginCookies from "../../utils/login/setLoginCookies.ts"; + +export interface Props { + email: string; + newPassword: string; + accessKey: string; +} + +/** + * @title Recovery Password + * @description Recovery password + */ +export default async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated, account } = ctx; + const segment = getSegmentFromBag(ctx); + + if (!props.email || !props.accessKey || !props.newPassword) { + throw new Error("Email, accessKey and/or newPassword is missing"); + } + + const cookies = getCookies(req.headers); + const VtexSessionToken = cookies?.["VtexSessionToken"] ?? null; + + if (!VtexSessionToken) { + throw new Error('"VtexSessionToken" cookie is missing'); + } + + const urlencoded = new URLSearchParams(); + urlencoded.append("login", props.email); + urlencoded.append("accessKey", props.accessKey); + urlencoded.append("newPassword", props.newPassword); + urlencoded.append("authenticationToken", VtexSessionToken); + + const response = await vcsDeprecated + ["POST /api/vtexid/pub/authentication/classic/setpassword"]( + { + locale: segment?.payload.cultureInfo || "pt-BR", + scope: account, + }, + { + body: urlencoded, + headers: { + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }, + }, + ); + + if (!response.ok) { + throw new Error( + `Authentication request failed: ${response.status} ${response.statusText}`, + ); + } + + const data: AuthResponse = await response.json(); + const setCookies = getSetCookies(response.headers); + await setLoginCookies(data, ctx, setCookies); + + return data; +} diff --git a/vtex/actions/authentication/refreshToken.ts b/vtex/actions/authentication/refreshToken.ts new file mode 100644 index 000000000..13a01ffdd --- /dev/null +++ b/vtex/actions/authentication/refreshToken.ts @@ -0,0 +1,86 @@ +import { getCookies, setCookie } from "std/http/cookie.ts"; +import { AppContext } from "../../mod.ts"; +import getLoginCookies from "../../utils/login/getLoginCookies.ts"; +import { getSetCookies } from "std/http/mod.ts"; +import { VID_RT_COOKIE_NAME } from "../../utils/login/setLoginCookies.ts"; + +interface Props { + fingerprint?: string; +} + +/** + * @title Refresh Authentication Token + * @description This function refreshes the VTEX authentication token using current session cookies. + */ +export default async function refreshToken( + props: Props, + req: Request, + ctx: AppContext, +) { + const { fingerprint } = props; + const { vcsDeprecated } = ctx; + const cookies = getLoginCookies({ cookies: getCookies(req.headers) }); + + if (!cookies.vid_rt) { + throw new Error("Refresh token cookie is missing"); + } + + const response = await vcsDeprecated + ["POST /api/vtexid/refreshtoken/webstore"]({}, { + body: { + fingerprint, + }, + headers: { + cookie: Object.entries(cookies) + .map(([name, value]) => `${name}=${value}`) + .join("; "), + }, + }); + + if (!response.ok) { + throw new Error( + `Authentication request failed: ${response.status} ${response.statusText}`, + ); + } + + const data = await response.json(); + const setCookies = getSetCookies(response.headers); + const vidRtCookie = setCookies?.find((cookie) => + cookie.name === VID_RT_COOKIE_NAME + ); + const authCookies = setCookies?.filter((cookie) => + cookie.name.startsWith("VtexIdclientAutCookie") + ).filter((cookie) => cookie !== undefined); + + if (!vidRtCookie) { + return; + } + + const expiresDate = new Date(vidRtCookie.expires ?? 0); + const maxAge = Math.max( + 0, + Math.floor((expiresDate.getTime() - Date.now()) / 1000), + ); + + setCookie(ctx.response.headers, { + name: VID_RT_COOKIE_NAME, + value: vidRtCookie.value, + httpOnly: true, + maxAge: maxAge, + path: "/", + secure: true, + }); + + for (const cookie of authCookies) { + setCookie(ctx.response.headers, { + name: cookie.name, + value: cookie.value, + httpOnly: true, + maxAge: maxAge, + path: "/", + secure: true, + }); + } + + return data; +} diff --git a/vtex/actions/authentication/resetPassword.ts b/vtex/actions/authentication/resetPassword.ts new file mode 100644 index 000000000..440534dff --- /dev/null +++ b/vtex/actions/authentication/resetPassword.ts @@ -0,0 +1,72 @@ +import { AppContext } from "../../mod.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; +import { AuthResponse } from "../../utils/types.ts"; +import setLoginCookies from "../../utils/login/setLoginCookies.ts"; +import { getSetCookies } from "std/http/cookie.ts"; + +export interface Props { + email: string; + currentPassword: string; + newPassword: string; +} + +/** + * @title Redefine Password + * @description Redefine password + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated, account } = ctx; + const segment = getSegmentFromBag(ctx); + + if (!props.email || !props.currentPassword || !props.newPassword) { + throw new Error("Email and/or password is missing"); + } + + const startAuthentication = await ctx.invoke.vtex.actions.authentication + .startAuthentication({}); + + if (!startAuthentication?.authenticationToken) { + throw new Error( + "No authentication token returned from startAuthentication", + ); + } + + const authenticationToken = startAuthentication.authenticationToken; + + const urlencoded = new URLSearchParams(); + urlencoded.append("login", props.email); + urlencoded.append("currentPassword", props.currentPassword); + urlencoded.append("newPassword", props.newPassword); + urlencoded.append("authenticationToken", authenticationToken); + + const response = await vcsDeprecated + ["POST /api/vtexid/pub/authentication/classic/setpassword"]( + { + locale: segment?.payload.cultureInfo || "pt-BR", + scope: account, + }, + { + body: urlencoded, + headers: { + "Accept": "application/json", + "Content-Type": "application/x-www-form-urlencoded", + }, + }, + ); + + if (!response.ok) { + throw new Error( + `Authentication request failed: ${response.status} ${response.statusText}`, + ); + } + + const data: AuthResponse = await response.json(); + const setCookies = getSetCookies(response.headers); + await setLoginCookies(data, ctx, setCookies); + + return data; +} diff --git a/vtex/actions/authentication/sendEmailVerification.ts b/vtex/actions/authentication/sendEmailVerification.ts new file mode 100644 index 000000000..b7fe37cea --- /dev/null +++ b/vtex/actions/authentication/sendEmailVerification.ts @@ -0,0 +1,87 @@ +import { setCookie } from "std/http/mod.ts"; +import type { AppContext } from "../../mod.ts"; + +export interface Props { + email: string; + locale?: string; + parentAppId?: string; +} + +export type SendEmailVerificationResult = boolean; + +/** + * @title Send Email Verification + * @description Sends an email verification request via VTEX API + */ +export default async function action( + props: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated } = ctx; + + if (!props.email) { + throw new Error("Email is missing"); + } + + const startAuthentication = await ctx.invoke.vtex.actions.authentication + .startAuthentication({}); + + if (!startAuthentication?.authenticationToken) { + throw new Error( + "No authentication token returned from startAuthentication", + ); + } + + const authenticationToken = startAuthentication.authenticationToken; + + const formData = new FormData(); + formData.append("authenticationToken", authenticationToken); + formData.append("email", props.email); + if (props.locale) { + formData.append("locale", props.locale); + } + if (props.parentAppId) { + formData.append("parentAppId", props.parentAppId); + } + + try { + const response = await vcsDeprecated[ + "POST /api/vtexid/pub/authentication/accesskey/send" + ]({ + deliveryMethod: "email", + }, { + body: formData, + headers: { + "Accept": "application/json", + }, + }); + + if (!response.ok) { + throw new Error( + `Authentication request failed: ${response.status} ${response.statusText}`, + ); + } + + const data = await response.json(); + if (data?.authStatus === "InvalidToken") { + throw new Error('"Authentication Token" is invalid'); + } + + // VtexSessionToken is valid for 10 minutes + const SESSION_TOKEN_EXPIRES = 600; + setCookie(ctx.response.headers, { + name: "VtexSessionToken", + value: authenticationToken, + httpOnly: true, + maxAge: SESSION_TOKEN_EXPIRES, + path: "/", + secure: true, + }); + + return true; + } catch (error) { + console.error(error); + return false; + } +} diff --git a/vtex/actions/authentication/startAuthentication.ts b/vtex/actions/authentication/startAuthentication.ts new file mode 100644 index 000000000..55d946bf8 --- /dev/null +++ b/vtex/actions/authentication/startAuthentication.ts @@ -0,0 +1,44 @@ +import { AppContext } from "../../mod.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; +import { StartAuthentication } from "../../utils/types.ts"; + +export interface Props { + callbackUrl?: string; + returnUrl?: string; + appStart?: boolean; +} + +/** + * @title Start Authentication + * @description Initiates the authentication process with VTEX. + */ +export default async function action( + { + callbackUrl = "/", + returnUrl = "/", + appStart = true, + }: Props, + _req: Request, + ctx: AppContext, +): Promise { + const { vcsDeprecated, account } = ctx; + const segment = getSegmentFromBag(ctx); + + const response = await vcsDeprecated + ["GET /api/vtexid/pub/authentication/start"]({ + locale: segment?.payload.cultureInfo ?? "pt-BR", + scope: account, + appStart, + callbackUrl, + returnUrl, + }); + + if (!response.ok) { + throw new Error( + `Failed to start authentication. ${response.status} ${response.statusText}`, + ); + } + + const data = await response.json(); + return data; +} diff --git a/vtex/actions/cart/addItems.ts b/vtex/actions/cart/addItems.ts index ed7fcb118..c8b883f7c 100644 --- a/vtex/actions/cart/addItems.ts +++ b/vtex/actions/cart/addItems.ts @@ -1,7 +1,9 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { forceHttpsOnAssets } from "../../utils/transform.ts"; export interface Item { quantity: number; @@ -18,6 +20,8 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items + * @title Add Items to Cart + * @description Add items to the cart */ const action = async ( props: Props, @@ -31,12 +35,14 @@ const action = async ( } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); try { const response = await vcsDeprecated ["POST /api/checkout/pub/orderForm/:orderFormId/items"]({ orderFormId, allowedOutdatedData, + sc: segment?.payload.channel, }, { body: { orderItems }, headers: { @@ -48,7 +54,7 @@ const action = async ( proxySetCookie(response.headers, ctx.response.headers, req.url); - return response.json(); + return forceHttpsOnAssets((await response.json()) as OrderForm); } catch (error) { console.error(error); diff --git a/vtex/actions/cart/addOfferings.ts b/vtex/actions/cart/addOfferings.ts new file mode 100644 index 000000000..7c3f427fd --- /dev/null +++ b/vtex/actions/cart/addOfferings.ts @@ -0,0 +1,56 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../utils/cookies.ts"; +import { parseCookie } from "../../utils/orderForm.ts"; +import { forceHttpsOnAssets } from "../../utils/transform.ts"; +import { OrderForm } from "../../utils/types.ts"; +import { DEFAULT_EXPECTED_SECTIONS } from "./updateItemAttachment.ts"; + +export interface Props { + index: number; + id: number; + expectedOrderFormSections?: string[]; +} + +/** + * @title Add Offerings to Cart + * @description Add offerings to the cart + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +) => { + const { index, id, expectedOrderFormSections = DEFAULT_EXPECTED_SECTIONS } = + props; + const { vcsDeprecated } = ctx; + + const { orderFormId } = parseCookie(req.headers); + const cookie = req.headers.get("cookie") ?? ""; + + try { + const response = await vcsDeprecated + ["POST /api/checkout/pub/orderForm/:orderFormId/items/:index/offerings"]({ + orderFormId, + index, + }, { + body: { + expectedOrderFormSections, + id, + info: null, + }, + headers: { + "content-type": "application/json", + accept: "application/json", + cookie, + }, + }); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return forceHttpsOnAssets((await response.json()) as OrderForm); + } catch (error) { + throw error; + } +}; + +export default action; diff --git a/vtex/actions/cart/clearOrderformMessages.ts b/vtex/actions/cart/clearOrderformMessages.ts new file mode 100644 index 000000000..115966593 --- /dev/null +++ b/vtex/actions/cart/clearOrderformMessages.ts @@ -0,0 +1,34 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../utils/cookies.ts"; +import { parseCookie } from "../../utils/orderForm.ts"; +import type { OrderForm } from "../../utils/types.ts"; + +/** + * @title Clear OrderForm Messages + * @description Clear the messages from the orderForm + */ +const action = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise => { + const { vcsDeprecated } = ctx; + const { orderFormId } = parseCookie(req.headers); + const cookie = req.headers.get("cookie") ?? ""; + + const response = await vcsDeprecated[ + "POST /api/checkout/pub/orderForm/:orderFormId/messages/clear" + ]( + { orderFormId }, + { + headers: { accept: "application/json", cookie }, + body: {}, + }, + ); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return response.json(); +}; + +export default action; diff --git a/vtex/actions/cart/getInstallment.ts b/vtex/actions/cart/getInstallment.ts index 8511d4eaf..17beb3838 100644 --- a/vtex/actions/cart/getInstallment.ts +++ b/vtex/actions/cart/getInstallment.ts @@ -1,7 +1,8 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; -import type { OrderForm } from "../../utils/types.ts"; +import type { InstallmentOption } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { paymentSystem: number; @@ -9,20 +10,23 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/orderForm/-orderFormId-/installments + * @title Get Installment + * @description Get the installment options for a given cart with a given payment method */ const action = async ( props: Props, req: Request, ctx: AppContext, -): Promise => { +): Promise => { const { vcsDeprecated } = ctx; const { paymentSystem } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["GET /api/checkout/pub/orderForm/:orderFormId/installments"]( - { orderFormId, paymentSystem }, + { orderFormId, paymentSystem, sc: segment?.payload.channel }, { headers: { accept: "application/json", cookie } }, ); diff --git a/vtex/actions/cart/removeItemAttachment.ts b/vtex/actions/cart/removeItemAttachment.ts index 6ea380cbc..16be3a213 100644 --- a/vtex/actions/cart/removeItemAttachment.ts +++ b/vtex/actions/cart/removeItemAttachment.ts @@ -2,6 +2,7 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { /** @description index of the item in the cart.items array you want to edit */ @@ -31,6 +32,10 @@ export const DEFAULT_EXPECTED_SECTIONS = [ "customData", ]; +/** + * @title Remove Item Attachment + * @description Remove an attachment from an item in the cart + */ const action = async ( props: Props, req: Request, @@ -46,10 +51,11 @@ const action = async ( } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["DELETE /api/checkout/pub/orderForm/:orderFormId/items/:index/attachments/:attachment"]( - { orderFormId, attachment, index }, + { orderFormId, attachment, index, sc: segment?.payload.channel }, { body: { content, noSplitItem, expectedOrderFormSections }, headers: { diff --git a/vtex/actions/cart/removeItems.ts b/vtex/actions/cart/removeItems.ts index 3bdc70dcb..5ad34095c 100644 --- a/vtex/actions/cart/removeItems.ts +++ b/vtex/actions/cart/removeItems.ts @@ -2,9 +2,12 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items/removeAll + * @title Remove Items from Cart + * @description Remove all items from the cart */ const action = async ( _props: unknown, @@ -14,17 +17,19 @@ const action = async ( const { vcsDeprecated } = ctx; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated - ["POST /api/checkout/pub/orderForm/:orderFormId/items/removeAll"]({ - orderFormId, - }, { - headers: { - "content-type": "application/json", - accept: "application/json", - cookie, + ["POST /api/checkout/pub/orderForm/:orderFormId/items/removeAll"]( + { orderFormId, sc: segment?.payload.channel }, + { + headers: { + "content-type": "application/json", + accept: "application/json", + cookie, + }, }, - }); + ); proxySetCookie(response.headers, ctx.response.headers, req.url); diff --git a/vtex/actions/cart/removeOffering.ts b/vtex/actions/cart/removeOffering.ts new file mode 100644 index 000000000..016818b24 --- /dev/null +++ b/vtex/actions/cart/removeOffering.ts @@ -0,0 +1,58 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../utils/cookies.ts"; +import { parseCookie } from "../../utils/orderForm.ts"; +import { forceHttpsOnAssets } from "../../utils/transform.ts"; +import { OrderForm } from "../../utils/types.ts"; +import { DEFAULT_EXPECTED_SECTIONS } from "./updateItemAttachment.ts"; + +export interface Props { + index: number; + id: number; + expectedOrderFormSections?: string[]; +} + +/** + * @title Remove Offering from Cart + * @description Remove an offering from an item in the cart + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +) => { + const { index, id, expectedOrderFormSections = DEFAULT_EXPECTED_SECTIONS } = + props; + const { vcsDeprecated } = ctx; + + const { orderFormId } = parseCookie(req.headers); + const cookie = req.headers.get("cookie") ?? ""; + + try { + const response = await vcsDeprecated + ["POST /api/checkout/pub/orderForm/:orderFormId/items/:index/offerings/:id/remove"]( + { + orderFormId, + id, + index: index, + }, + { + body: { + expectedOrderFormSections, + }, + headers: { + "content-type": "application/json", + accept: "application/json", + cookie, + }, + }, + ); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return forceHttpsOnAssets((await response.json()) as OrderForm); + } catch (error) { + throw error; + } +}; + +export default action; diff --git a/vtex/actions/cart/simulation.ts b/vtex/actions/cart/simulation.ts index 9a8385966..4bb75b72c 100644 --- a/vtex/actions/cart/simulation.ts +++ b/vtex/actions/cart/simulation.ts @@ -1,5 +1,6 @@ import { AppContext } from "../../mod.ts"; import type { SimulationOrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Item { id: number; @@ -16,6 +17,8 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForms/simulation + * @title Simulation OrderForm + * @description Simulate an orderForm, used for shipping and pricing simulation */ const action = async ( props: Props, @@ -25,12 +28,14 @@ const action = async ( const cookie = req.headers.get("cookie") ?? ""; const { vcsDeprecated } = ctx; const { items, postalCode, country, RnbBehavior = 1 } = props; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated[ "POST /api/checkout/pub/orderForms/simulation" ]( { RnbBehavior, + sc: segment?.payload.channel, }, { body: { items, country, postalCode }, diff --git a/vtex/actions/cart/updateAttachment.ts b/vtex/actions/cart/updateAttachment.ts index 8ebe1fb9a..37cf4c40b 100644 --- a/vtex/actions/cart/updateAttachment.ts +++ b/vtex/actions/cart/updateAttachment.ts @@ -3,6 +3,7 @@ import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; import { DEFAULT_EXPECTED_SECTIONS } from "./updateItemAttachment.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { attachment: string; @@ -11,6 +12,10 @@ export interface Props { body: any; } +/** + * @title Update Attachment + * @description Update an attachment in the cart + */ const action = async ( props: Props, req: Request, @@ -23,12 +28,19 @@ const action = async ( expectedOrderFormSections = DEFAULT_EXPECTED_SECTIONS, } = props; const { orderFormId } = parseCookie(req.headers); + + if (!orderFormId || orderFormId === "") { + throw new Error("Order form ID is required"); + } + const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["POST /api/checkout/pub/orderForm/:orderFormId/attachments/:attachment"]({ orderFormId, attachment, + sc: segment?.payload.channel, }, { body: { expectedOrderFormSections, ...body }, headers: { diff --git a/vtex/actions/cart/updateCoupons.ts b/vtex/actions/cart/updateCoupons.ts index a7ee4092c..852c42065 100644 --- a/vtex/actions/cart/updateCoupons.ts +++ b/vtex/actions/cart/updateCoupons.ts @@ -2,6 +2,7 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { text: string; @@ -9,6 +10,8 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/coupons + * @title Update Coupons + * @description Update the coupons in the cart */ const action = async ( props: Props, @@ -19,9 +22,13 @@ const action = async ( const { text } = props; const cookie = req.headers.get("cookie") ?? ""; const { orderFormId } = parseCookie(req.headers); + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated - ["POST /api/checkout/pub/orderForm/:orderFormId/coupons"]({ orderFormId }, { + ["POST /api/checkout/pub/orderForm/:orderFormId/coupons"]({ + orderFormId, + sc: segment?.payload.channel, + }, { body: { text }, headers: { accept: "application/json", diff --git a/vtex/actions/cart/updateGifts.ts b/vtex/actions/cart/updateGifts.ts new file mode 100644 index 000000000..64ff219d9 --- /dev/null +++ b/vtex/actions/cart/updateGifts.ts @@ -0,0 +1,44 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../utils/cookies.ts"; +import { parseCookie } from "../../utils/orderForm.ts"; +import type { OrderForm, SelectableGifts } from "../../utils/types.ts"; +import { DEFAULT_EXPECTED_SECTIONS } from "./updateItemAttachment.ts"; + +export interface Props extends SelectableGifts { + expectedOrderFormSections?: string[]; +} + +/** + * @title Update Gifts + * @description Update the gifts in the cart + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { vcsDeprecated } = ctx; + const { + expectedOrderFormSections = DEFAULT_EXPECTED_SECTIONS, + id, + selectedGifts, + } = props; + const { orderFormId } = parseCookie(req.headers); + const cookie = req.headers.get("cookie") ?? ""; + + const response = await vcsDeprecated[ + "POST /api/checkout/pub/orderForm/:orderFormId/selectable-gifts/:giftId" + ]( + { orderFormId, giftId: id }, + { + headers: { accept: "application/json", cookie }, + body: { expectedOrderFormSections, selectedGifts, id }, + }, + ); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return response.json(); +}; + +export default action; diff --git a/vtex/actions/cart/updateItemAttachment.ts b/vtex/actions/cart/updateItemAttachment.ts index 054db71ed..3b20412fe 100644 --- a/vtex/actions/cart/updateItemAttachment.ts +++ b/vtex/actions/cart/updateItemAttachment.ts @@ -2,6 +2,7 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { /** @description index of the item in the cart.items array you want to edit */ @@ -31,6 +32,10 @@ export const DEFAULT_EXPECTED_SECTIONS = [ "customData", ]; +/** + * @title Update Item Attachment + * @description Update an attachment in an item in the cart + */ const action = async ( props: Props, req: Request, @@ -46,6 +51,7 @@ const action = async ( } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["POST /api/checkout/pub/orderForm/:orderFormId/items/:index/attachments/:attachment"]( @@ -53,6 +59,7 @@ const action = async ( orderFormId, attachment, index, + sc: segment?.payload.channel, }, { body: { content, noSplitItem, expectedOrderFormSections }, diff --git a/vtex/actions/cart/updateItemPrice.ts b/vtex/actions/cart/updateItemPrice.ts index 471932098..034bcbc84 100644 --- a/vtex/actions/cart/updateItemPrice.ts +++ b/vtex/actions/cart/updateItemPrice.ts @@ -2,6 +2,7 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { itemIndex: number; @@ -10,6 +11,8 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#put-/api/checkout/pub/orderForm/-orderFormId-/items/-itemIndex-/price + * @title Update Item Price + * @description Update the price of an item in the cart */ const action = async ( props: Props, @@ -23,11 +26,13 @@ const action = async ( } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["PUT /api/checkout/pub/orderForm/:orderFormId/items/:index/price"]({ orderFormId, index: itemIndex, + sc: segment?.payload.channel, }, { body: { price }, headers: { diff --git a/vtex/actions/cart/updateItems.ts b/vtex/actions/cart/updateItems.ts index 693b7ab1c..bb0ea3e8c 100644 --- a/vtex/actions/cart/updateItems.ts +++ b/vtex/actions/cart/updateItems.ts @@ -1,6 +1,7 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; import type { OrderForm } from "../../utils/types.ts"; export interface Item { @@ -11,10 +12,13 @@ export interface Item { export interface Props { orderItems: Item[]; allowedOutdatedData?: Array<"paymentData">; + noSplitItem?: boolean; } /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items/update + * @title Update Items + * @description Update the items in the cart */ const action = async ( props: Props, @@ -25,16 +29,19 @@ const action = async ( const { orderItems, allowedOutdatedData = ["paymentData"], + noSplitItem, } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["POST /api/checkout/pub/orderForm/:orderFormId/items/update"]({ orderFormId, allowedOutdatedData, + sc: segment?.payload.channel, }, { - body: { orderItems }, + body: { orderItems, noSplitItem: Boolean(noSplitItem) }, headers: { "content-type": "application/json", accept: "application/json", diff --git a/vtex/actions/cart/updateProfile.ts b/vtex/actions/cart/updateProfile.ts index 6466929df..cb621dc91 100644 --- a/vtex/actions/cart/updateProfile.ts +++ b/vtex/actions/cart/updateProfile.ts @@ -2,6 +2,7 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; export interface Props { ignoreProfileData: boolean; @@ -9,6 +10,8 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#patch-/api/checkout/pub/orderForm/-orderFormId-/profile + * @title Update Profile + * @description Update the profile in the cart */ const action = async ( props: Props, @@ -19,10 +22,12 @@ const action = async ( const { ignoreProfileData } = props; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["PATCH /api/checkout/pub/orderForm/:orderFormId/profile"]({ orderFormId, + sc: segment?.payload.channel, }, { body: { ignoreProfileData }, headers: { diff --git a/vtex/actions/cart/updateUser.ts b/vtex/actions/cart/updateUser.ts index d7db7b9b5..dca9184e8 100644 --- a/vtex/actions/cart/updateUser.ts +++ b/vtex/actions/cart/updateUser.ts @@ -2,9 +2,12 @@ import { AppContext } from "../../mod.ts"; import { proxySetCookie } from "../../utils/cookies.ts"; import { parseCookie } from "../../utils/orderForm.ts"; import type { OrderForm } from "../../utils/types.ts"; +import { getSegmentFromBag } from "../../utils/segment.ts"; /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#get-/checkout/changeToAnonymousUser/-orderFormId- + * @title Update User + * @description Update the user */ const action = async ( _props: unknown, @@ -14,10 +17,12 @@ const action = async ( const { vcsDeprecated } = ctx; const { orderFormId } = parseCookie(req.headers); const cookie = req.headers.get("cookie") ?? ""; + const segment = getSegmentFromBag(ctx); const response = await vcsDeprecated ["GET /api/checkout/changeToAnonymousUser/:orderFormId"]({ orderFormId, + sc: segment?.payload.channel, }, { headers: { accept: "application/json", diff --git a/vtex/actions/masterdata/createDocument.ts b/vtex/actions/masterdata/createDocument.ts index c2204ab08..6f8914ae7 100644 --- a/vtex/actions/masterdata/createDocument.ts +++ b/vtex/actions/masterdata/createDocument.ts @@ -1,38 +1,50 @@ import { AppContext } from "../../mod.ts"; -import type { CreateNewDocument } from "../../utils/types.ts"; import { parseCookie } from "../../utils/vtexId.ts"; +import type { CreateNewDocument } from "../../utils/types.ts"; export interface Props { data: Record; acronym: string; + isPrivateEntity?: boolean; } /** * @docs https://developers.vtex.com/docs/api-reference/masterdata-api#post-/api/dataentities/-acronym-/documents + * @title Create Document in MasterData + * @description Create a new document in MasterData */ const action = async ( props: Props, req: Request, ctx: AppContext, + /* no-explicit-any */ ): Promise => { - const { vcsDeprecated } = ctx; - const { data, acronym } = props; + const { vcs, vcsDeprecated } = ctx; + const { data, acronym, isPrivateEntity } = props; const { cookie } = parseCookie(req.headers, ctx.account); - const response = await vcsDeprecated - [`POST /api/dataentities/:acronym/documents`]( - { acronym }, - { - body: data, - headers: { - accept: "application/json", - "content-type": "application/json", - cookie, - }, - }, - ); + const requestOptions = { + body: data, + headers: { + accept: "application/json", + "content-type": "application/json", + cookie, + }, + }; + + const response = + await (isPrivateEntity + ? vcs[`POST /api/dataentities/:acronym/documents`]( + { acronym }, + requestOptions, + ) + : vcsDeprecated[`POST /api/dataentities/:acronym/documents`]( + { acronym }, + requestOptions, + )); return response.json(); }; +export const defaultVisibility = "private"; export default action; diff --git a/vtex/actions/masterdata/updateDocument.ts b/vtex/actions/masterdata/updateDocument.ts new file mode 100644 index 000000000..6a8add491 --- /dev/null +++ b/vtex/actions/masterdata/updateDocument.ts @@ -0,0 +1,58 @@ +import { AppContext } from "../../mod.ts"; +import type { IdHrefDocumentID } from "../../utils/openapi/vcs.openapi.gen.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface Props { + /** + * Unique identifier of the document to be created. + */ + id: string; + acronym: string; + data: Record; + createIfNotExists?: boolean; +} + +/** + * @docs https://developers.vtex.com/docs/api-reference/masterdata-api#patch-/api/dataentities/-acronym-/documents?endpoint=patch-/api/dataentities/-acronym-/documents + * @docs https://developers.vtex.com/docs/api-reference/masterdata-api#patch-/api/dataentities/-acronym-/documents/-id-?endpoint=patch-/api/dataentities/-acronym-/documents/-id- + * @title Update Document in MasterData + * @description Update a document in MasterData + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { vcs } = ctx; + const { id, data, acronym, createIfNotExists } = props; + const { cookie } = parseCookie(req.headers, ctx.account); + + const requestOptions = { + body: createIfNotExists ? { ...data, id } : data, + headers: { + accept: "application/json", + "content-type": "application/json", + cookie, + }, + }; + + const response = + await (createIfNotExists + ? vcs["PATCH /api/dataentities/:acronym/documents"]( + { acronym }, + requestOptions, + ) + : vcs["PATCH /api/dataentities/:acronym/documents/:id"]( + { acronym, id }, + requestOptions, + )); + + if (response.headers.get("content-type")?.includes("application/json")) { + return response.json(); + } + + return; +}; + +export const defaultVisibility = "private"; +export default action; diff --git a/vtex/actions/masterdata/updatePartialDocument.ts b/vtex/actions/masterdata/updatePartialDocument.ts new file mode 100644 index 000000000..445b9f0dc --- /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/:id"]( + { acronym, id: documentId }, + requestOptions, + ) + : vcsDeprecated[`PATCH /api/dataentities/:acronym/documents/:documentId`]( + { acronym, documentId }, + requestOptions, + )); +}; + +export default action; diff --git a/vtex/actions/newsletter/subscribe.ts b/vtex/actions/newsletter/subscribe.ts index 7195bbbba..7459c2f77 100644 --- a/vtex/actions/newsletter/subscribe.ts +++ b/vtex/actions/newsletter/subscribe.ts @@ -8,6 +8,10 @@ export interface Props { campaing?: string; } +/** + * @title Subscribe to Newsletter + * @description Subscribe to the newsletter + */ const action = async ( props: Props, _req: Request, diff --git a/vtex/actions/newsletter/updateNewsletterOptIn.ts b/vtex/actions/newsletter/updateNewsletterOptIn.ts new file mode 100644 index 000000000..e54229735 --- /dev/null +++ b/vtex/actions/newsletter/updateNewsletterOptIn.ts @@ -0,0 +1,47 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +const mutation = + `mutation SubscribeNewsletter($email: String!, $isNewsletterOptIn: Boolean!) { + subscribeNewsletter(email: $email, isNewsletterOptIn: $isNewsletterOptIn) @context(provider: "vtex.store-graphql@2.x") +}`; + +interface Props { + /** + * If true, the user will be subscribed to the newsletter. + */ + subscribe: boolean; +} + +/** + * @title Update Newsletter Opt In + * @description Update the newsletter opt in + */ +async function loader( + props: Props, + req: Request, + ctx: AppContext, +): Promise<{ subscribed: boolean }> { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + throw new Error("User cookie is invalid"); + } + + await io.query( + { + query: mutation, + operationName: "SubscribeNewsletter", + variables: { + email: payload.sub, + isNewsletterOptIn: props.subscribe, + }, + }, + { headers: { cookie } }, + ); + + return { subscribed: props.subscribe }; +} + +export default loader; diff --git a/vtex/actions/notifyme.ts b/vtex/actions/notifyme.ts index 07d626bd5..3c7b7c3ff 100644 --- a/vtex/actions/notifyme.ts +++ b/vtex/actions/notifyme.ts @@ -8,6 +8,8 @@ export interface Props { /** * @docs https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForm/-orderFormId-/items + * @title Notify Me + * @description Notify me when the product is back in stock */ const action = async ( props: Props, diff --git a/vtex/actions/orders/cancel.ts b/vtex/actions/orders/cancel.ts new file mode 100644 index 000000000..6d2ae0d2a --- /dev/null +++ b/vtex/actions/orders/cancel.ts @@ -0,0 +1,40 @@ +import type { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface Props { + orderId: string; + reason: string; +} + +/** + * @title Cancel Order + * @description Cancel an order + */ +async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { orderId, reason } = props; + const { vcsDeprecated } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + const response = await vcsDeprecated + ["POST /api/checkout/pub/orders/:orderId/user-cancel-request"]( + { orderId }, + { + body: { reason }, + headers: { cookie }, + }, + ); + + if (!response.ok) { + throw new Error( + `Failed to cancel order: ${response.status} ${response.statusText}`, + ); + } + + return new Response(null, { status: 204 }); +} + +export default action; diff --git a/vtex/actions/payment/deletePaymentToken.ts b/vtex/actions/payment/deletePaymentToken.ts new file mode 100644 index 000000000..1fc989a2d --- /dev/null +++ b/vtex/actions/payment/deletePaymentToken.ts @@ -0,0 +1,39 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface DeleteCard { + deletePaymentToken: boolean; +} + +const mutation = `mutation DeleteCreditCardToken($tokenId: ID!) { + deletePaymentToken(tokenId: $tokenId) @context(provider: "vtex.my-cards-graphql@2.x") +}`; + +interface Props { + id: string; +} + +/** + * @title Delete Payment Token + * @description Delete a payment token + */ +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) { + throw new Error("User cookie is invalid"); + } + + return await io.query({ + query: mutation, + variables: { tokenId: id }, + }, { headers: { cookie } }); +} + +export const defaultVisibility = "private"; +export default loader; 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..06194d936 --- /dev/null +++ b/vtex/actions/profile/updateProfile.ts @@ -0,0 +1,60 @@ +import { AppContext } from "../../mod.ts"; +import type { Profile, ProfileInput } from "../../utils/types.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +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 + } +}`; + +/** + * @title Update Profile + * @description Update the profile + */ +async function action( + props: Omit, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + throw new Error("User cookie is invalid"); + } + + const { updateProfile } = await io.query< + { updateProfile: Profile }, + { input: ProfileInput } + >( + { + query: mutation, + operationName: "UpdateProfile", + variables: { + input: { + ...props, + email: payload.sub, + }, + }, + }, + { headers: { cookie } }, + ); + + return updateProfile; +} + +export default action; diff --git a/vtex/actions/review/submit.ts b/vtex/actions/review/submit.ts new file mode 100644 index 000000000..a1a132e9b --- /dev/null +++ b/vtex/actions/review/submit.ts @@ -0,0 +1,48 @@ +import { getCookies } from "std/http/cookie.ts"; +import { AppContext } from "../../../vtex/mod.ts"; +import { VTEX_ID_CLIENT_COOKIE } from "../../utils/vtexId.ts"; + +export interface Props { + data: { + productId: string; + rating: number; + title: string; + text: string; + reviewerName: string; + approved: boolean; + }; +} + +// docs https://developers.vtex.com/docs/api-reference/reviews-and-ratings-api#post-/reviews-and-ratings/api/review?endpoint=post-/reviews-and-ratings/api/review + +/** + * @title Submit Review + * @description Submit a review + */ +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +) => { + const { data } = props; + const cookies = getCookies(req.headers); + const authCookie = cookies[VTEX_ID_CLIENT_COOKIE] || + cookies[`${VTEX_ID_CLIENT_COOKIE}_${ctx.account}`]; + + const requestOptions = { + body: data, + headers: { + "accept": "application/json", + "content-type": "application/json", + "VtexidClientAutCookie": authCookie, + }, + }; + + const response = await ( + ctx.my[`POST /reviews-and-ratings/api/review`]({}, requestOptions) + ); + + return response.json(); +}; + +export default action; diff --git a/vtex/actions/session/createSession.ts b/vtex/actions/session/createSession.ts new file mode 100644 index 000000000..cf1b0222f --- /dev/null +++ b/vtex/actions/session/createSession.ts @@ -0,0 +1,37 @@ +import type { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../utils/cookies.ts"; +import type { CreateEditSessionResponse } from "../../utils/openapi/vcs.openapi.gen.ts"; + +interface Props { + publicProperties: Record; +} + +/** + * @title Create Session + * @description Create a new session + */ +async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcs } = ctx; + + const response = await vcs["POST /api/sessions"]({}, { + body: { + public: { + ...props.publicProperties, + }, + }, + }); + + if (!response.ok) { + throw new Error(`Failed to create session: ${response.status}`); + } + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return await response.json(); +} + +export default action; diff --git a/vtex/actions/session/deleteSession.ts b/vtex/actions/session/deleteSession.ts new file mode 100644 index 000000000..0d24516f2 --- /dev/null +++ b/vtex/actions/session/deleteSession.ts @@ -0,0 +1,38 @@ +import { AppContext } from "../../mod.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +export interface DeleteSession { + logOutFromSession: string; +} + +const mutation = `mutation LogOutFromSession($sessionId: ID) { + logOutFromSession(sessionId: $sessionId) @context(provider: "vtex.store-graphql@2.x") +}`; + +interface Props { + sessionId: string; +} + +/** + * @title Delete Session + * @description Delete a session + */ +async function action( + { sessionId }: Props, + req: Request, + ctx: AppContext, +): Promise { + const { io } = ctx; + const { cookie, payload } = parseCookie(req.headers, ctx.account); + + if (!payload?.sub || !payload?.userId) { + throw new Error("User cookie is invalid"); + } + + return await io.query({ + query: mutation, + variables: { sessionId }, + }, { headers: { cookie } }); +} + +export default action; diff --git a/vtex/actions/session/editSession.ts b/vtex/actions/session/editSession.ts new file mode 100644 index 000000000..c97e0d1bb --- /dev/null +++ b/vtex/actions/session/editSession.ts @@ -0,0 +1,40 @@ +import type { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../utils/cookies.ts"; +import type { CreateEditSessionResponse } from "../../utils/openapi/vcs.openapi.gen.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +interface Props { + publicProperties: Record; +} + +/** + * @title Edit Session + * @description Edit a session + */ +async function action( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcs } = ctx; + const { cookie } = parseCookie(req.headers, ctx.account); + + const response = await vcs["PATCH /api/sessions"]({}, { + body: { + public: { + ...props.publicProperties, + }, + }, + headers: { cookie }, + }); + + if (!response.ok) { + throw new Error(`Failed to edit session: ${response.status}`); + } + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return await response.json(); +} + +export default action; 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/actions/trigger.ts b/vtex/actions/trigger.ts index 6d72fb81f..a69b78828 100644 --- a/vtex/actions/trigger.ts +++ b/vtex/actions/trigger.ts @@ -1,36 +1,36 @@ import { AppContext } from "../mod.ts"; -export interface Notification { +export interface VTEXNotificationPayload { /** @description SKU ID in VTEX **/ - idSKU: string; - /** @description Product ID in VTEX **/ - productId: string; + IdSku: string; /** @description Seller’s account name in VTEX, shown in the store’s VTEX Admin url. **/ - an: string; + An: string; /** @description Affiliate ID generated automatically in the configuration. **/ - idAffiliate: string; + IdAffiliate: string; + /** @description Product ID in VTEX **/ + ProductId: number; /** @description Date when the item was updated **/ DateModified: string; /** @description Identifies whether the product is active or not. In case it is “false”, it means the product was deactivated in VTEX and should be blocked in the marketplace. We recommend that the inventory level is zeroed in the marketplace, and the product is blocked. In case the marketplace doesn’t allow it to be deactivated, the product should be excluded, along with any existing correspondences in the connector. **/ - isActive: string; + IsActive: boolean; /** @description Identifies that the inventory level has been altered. Connectors should send an Fulfillment Simulation request to collect updated information. **/ - StockModified: string; + StockModified: boolean; /** @description Identifies that the price has been altered. Connectors should send an Fulfillment Simulation request to collect updated information. **/ - PriceModified: string; + PriceModified: boolean; /** @description Identifies that the product/SKU registration data has changed, like name, description, weight, etc **/ - HasStockKeepingUnitModified: string; + HasStockKeepingUnitModified: boolean; /** @description Identifies that the product is no longer associated with the trade policy. In case the marketplace doesn’t allow it to be deactivated, the product should be excluded, along with any existing correspondences in the connector. **/ - HasStockKeepingUnitRemovedFromAffiliate: string; + HasStockKeepingUnitRemovedFromAffiliate: boolean; } const action = async ( - props: Notification, + props: VTEXNotificationPayload, _req: Request, ctx: AppContext, ): Promise<{ id: string }> => { - const { idSKU } = props; + const { IdSku } = props; - if (!idSKU) { + if (!IdSku) { throw new Error("Missing idSKU"); } diff --git a/vtex/actions/wishlist/addItem.ts b/vtex/actions/wishlist/addItem.ts index 66de71dfd..a89075375 100644 --- a/vtex/actions/wishlist/addItem.ts +++ b/vtex/actions/wishlist/addItem.ts @@ -1,4 +1,3 @@ -import wishlistLoader from "../../loaders/wishlist.ts"; import { AppContext } from "../../mod.ts"; import type { WishlistItem } from "../../utils/types.ts"; import { parseCookie } from "../../utils/vtexId.ts"; @@ -8,6 +7,10 @@ export interface Props { sku: string; } +/** + * @title Add Item to Wishlist + * @description Add an item to the wishlist + */ const action = async ( props: Props, req: Request, @@ -32,7 +35,7 @@ const action = async ( `mutation AddToWishlist($listItem: ListItemInputType!, $shopperId: String!, $name: String!, $public: Boolean) { addToList(listItem: $listItem, shopperId: $shopperId, name: $name, public: $public) @context(provider: "vtex.wish-list@1.x") }`, }, { headers: { cookie } }); - return wishlistLoader({ count: Infinity }, req, ctx); + return ctx.invoke.vtex.loaders.wishlist({ allRecords: true }); }; export default action; diff --git a/vtex/actions/wishlist/removeItem.ts b/vtex/actions/wishlist/removeItem.ts index ecdb51987..7d8cbd59c 100644 --- a/vtex/actions/wishlist/removeItem.ts +++ b/vtex/actions/wishlist/removeItem.ts @@ -5,6 +5,10 @@ import { parseCookie } from "../../utils/vtexId.ts"; export type Props = { id: string }; +/** + * @title Remove Item from Wishlist + * @description Remove an item from the wishlist + */ const action = async ( props: Props, req: Request, diff --git a/vtex/components/VTEXPortalDataLayerCompatibility.tsx b/vtex/components/VTEXPortalDataLayerCompatibility.tsx new file mode 100644 index 000000000..d9ca176d3 --- /dev/null +++ b/vtex/components/VTEXPortalDataLayerCompatibility.tsx @@ -0,0 +1,200 @@ +import { type JSX } from "preact"; +import { Product } from "../../commerce/types.ts"; +import { useScriptAsDataURI } from "@deco/deco/hooks"; +declare global { + interface Window { + // deno-lint-ignore no-explicit-any + datalayer_product: any; + shelfProductIds: string[]; + skuJson: ProductSKUJsonProps; + dataLayer: unknown[]; + } +} +type ScriptProps = JSX.HTMLAttributes; +function addVTEXPortalDataSnippet(accountName: string) { + performance.mark("start-vtex-dl"); + const url = new URL(globalThis.window.location.href); + const structuredDataScripts = + document.querySelectorAll('script[type="application/ld+json"]') || []; + // deno-lint-ignore no-explicit-any + const structuredDatas: Record[] = []; + // deno-lint-ignore no-explicit-any + structuredDataScripts.forEach((v: any) => { + structuredDatas.push(JSON.parse(v.text)); + }); + const breadcrumbSD = structuredDatas.find((s) => + s["@type"] === "BreadcrumbList" + ); + performance.mark("end-sd"); + // deno-lint-ignore no-explicit-any + const getPageType = (structuredData: undefined | Record) => { + if (url.pathname === "/") { + return "homeView"; + } + const isProductPage = structuredDatas.some((s) => s["@type"] === "Product"); + if (isProductPage) { + return "productView"; + } + const isSearchPage = url.pathname === "/s"; + if (isSearchPage) { + return "internalSiteSearchView"; + } + if (structuredData?.itemList?.length === 1) { + return "departmentView"; + } + if (structuredData?.itemList?.length >= 2) { + return "categoryView"; + } + return "otherView"; + }; + const pageType = getPageType(breadcrumbSD); + // deno-lint-ignore no-explicit-any + const props: Record = { + pageCategory: "Home", + pageDepartment: null, + pageUrl: globalThis.window.location.href, + pageTitle: document.title, + skuStockOutFromShelf: [], + skuStockOutFromProductDetail: [], + accountName: `${accountName}`, + pageFacets: [], + shelfProductIds: [], + }; + const department = breadcrumbSD?.itemListElement?.[0]; + if (pageType === "productView") { + props.pageCategory = "Product"; + props.pageDepartment = department?.name || null; + const product = globalThis.window.datalayer_product || {}; + Object.assign(props, product); + } + if (pageType === "departmentView") { + props.pageCategory = "Department"; + props.pageDepartment = department?.name || null; + props.departmentName = department?.name || null; + props.categoryName = department?.name || null; + } + const category = breadcrumbSD?.itemListElement?.[1]; + if (pageType === "categoryView") { + props.pageCategory = "Category"; + props.pageDepartment = department?.name || null; + props.categoryName = category?.name || null; + } + if (pageType === "internalSiteSearchView") { + props.pageCategory = "InternalSiteSearch"; + props.siteSearchTerm = url.searchParams.get("q"); + } + if (pageType === "otherView") { + const pathNames = url.pathname.split("/").filter(Boolean); + props.pageCategory = pathNames.pop() || null; + } + props.shelfProductIds = globalThis.window.shelfProductIds || []; + globalThis.window.dataLayer = globalThis.window.dataLayer || []; + // VTEX Default position is first... + globalThis.window.dataLayer.unshift(props); + // But GTM handles .push function + globalThis.window.dataLayer.push(props); + globalThis.window.dataLayer.push({ event: pageType }); + performance.mark("end-vtex-dl"); + performance.measure("vtex-dl-qs-ld-json", "start-vtex-dl", "end-sd"); + performance.measure("vtex-dl-compat", "start-vtex-dl", "end-vtex-dl"); +} +interface AddVTEXPortalData extends ScriptProps { + accountName: string; +} +export function AddVTEXPortalData( + { accountName, ...props }: AddVTEXPortalData, +) { + return ( + `; + const routeFromPath = (pathTemplate: string): Route => { + const handlerValue = { + __resolveType: "website/handlers/proxy.ts", + url: urlToProxy, + host: hostToUse, + includeScriptsToHead, + includeScriptsToBody, + removeDirtyCookies: true, + pathsThatRequireSameReferer: VTEX_PATHS_THAT_REQUIRES_SAME_REFERER, + }; - if (includeScriptsToHead?.includePlausible) { - includeScriptsToHead.includes = [ - link1, - link2, - plausibleScript, - ...(includeScriptsToHead?.includes ?? []), - ]; - } - const routeFromPath = (pathTemplate: string): Route => ({ - pathTemplate, - handler: { - value: { - __resolveType: "website/handlers/proxy.ts", - url: urlToProxy, - host: hostToUse, - includeScriptsToHead: includeScriptsToHead, + return ({ + pathTemplate, + handler: { + value: handlerValue, }, - }, - }); + }); + }; const routesFromPaths = [...PATHS_TO_PROXY, ...extraPaths].map( routeFromPath, ); @@ -93,6 +92,8 @@ const buildProxyRoutes = ( pathTemplate: decoSiteMapUrl, handler: { value: { + excludePaths: excludePathsFromDecoSiteMap, + includePaths: includePathToDecoSitemap, __resolveType: "website/handlers/sitemap.ts", }, }, @@ -133,38 +134,58 @@ export interface Props { * @title Other site maps to include */ includeSiteMap?: string[]; + /** + * @title Paths to include in the deco sitemap + */ + includePathToDecoSitemap?: string[]; /** * @title If deco site map should be exposed at /deco-sitemap.xml */ generateDecoSiteMap?: boolean; + /** + * @title Exclude paths from /deco-sitemap.xml + */ + excludePathsFromDecoSiteMap?: string[]; /** * @title Scripts to include on Html head */ includeScriptsToHead?: { - includes?: string[]; - includePlausible: boolean; + includes?: Script[]; + }; + /** + * @title Scripts to include on Html body + */ + includeScriptsToBody?: { + includes?: Script[]; }; } /** * @title VTEX Proxy Routes + * @description Proxy routes to VTEX, commonly used for my account, checkout, etc. */ function loader( { extraPathsToProxy = [], includeSiteMap = [], + includePathToDecoSitemap = [], generateDecoSiteMap = true, - includeScriptsToHead = { includePlausible: false }, + excludePathsFromDecoSiteMap = [], + includeScriptsToHead = { includes: [] }, + includeScriptsToBody = { includes: [] }, }: Props, _req: Request, ctx: AppContext, ): Route[] { return buildProxyRoutes({ generateDecoSiteMap, + excludePathsFromDecoSiteMap, includeSiteMap, + includePathToDecoSitemap, publicUrl: ctx.publicUrl, extraPaths: extraPathsToProxy, includeScriptsToHead, + includeScriptsToBody, }); } diff --git a/vtex/loaders/session/getSession.ts b/vtex/loaders/session/getSession.ts new file mode 100644 index 000000000..d2f7ea02d --- /dev/null +++ b/vtex/loaders/session/getSession.ts @@ -0,0 +1,39 @@ +import type { AppContext } from "../../mod.ts"; +import type { GetSessionResponse } from "../../utils/openapi/vcs.openapi.gen.ts"; + +interface Props { + /** + * Items are the keys of the values you wish to get. They follow the format namespace1.key1,namespace2.key2. + * + * If you wish to recover the data sent on Create new session, it should be public.{key}, replacing {key} with the name of the custom property you created. Following the example request presented in Create new session, it would be public.variable1,public.variable2. + * + * If you want to retrieve all keys from Session Manager, you can use the wildcard operator (*) as a value for this query parameter. + */ + items: string[]; +} + +/** + * @title Get Session + * @description Get a session + */ +async function loader( + props: Props, + req: Request, + ctx: AppContext, +): Promise { + const { vcs } = ctx; + + const response = await vcs["GET /api/sessions"]({ + items: props.items?.join(",") || "*", + }, { + headers: { cookie: req.headers.get("cookie") || "" }, + }); + + if (!response.ok) { + throw new Error(`Failed to get session: ${response.status}`); + } + + return await response.json(); +} + +export default loader; diff --git a/vtex/loaders/session/getUserSessions.ts b/vtex/loaders/session/getUserSessions.ts new file mode 100644 index 000000000..1fdbe4873 --- /dev/null +++ b/vtex/loaders/session/getUserSessions.ts @@ -0,0 +1,50 @@ +import type { AppContext } from "../../mod.ts"; +import type { LoginSessionsInfo } from "../../utils/types.ts"; +import { parseCookie } from "../../utils/vtexId.ts"; + +const query = `query getUserSessions { + loginSessionsInfo { + currentLoginSessionId + loginSessions { + id + cacheId + deviceType + city + lastAccess + browser + os + ip + fullAddress + firstAccess + } + } +}`; + +/** + * @title Get User Sessions + * @description Get the sessions of the user logged in + */ +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) { + throw new Error("User cookie is invalid"); + } + + const data = await io.query< + { loginSessionsInfo: LoginSessionsInfo }, + null + >( + { query }, + { headers: { cookie } }, + ); + + return data.loginSessionsInfo; +} + +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 3ca2b27ee..90d4c8cfa 100644 --- a/vtex/loaders/user.ts +++ b/vtex/loaders/user.ts @@ -1,22 +1,74 @@ +import { Person } from "../../commerce/types.ts"; import { AppContext } from "../mod.ts"; import { parseCookie } from "../utils/vtexId.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; + stateRegistration?: string; + customFields?: { key: string; value: string }[]; } -function loader(_props: unknown, req: Request, ctx: AppContext): User | null { - const { payload } = parseCookie(req.headers, ctx.account); +/** + * @title Get User + * @description Get the user logged in + */ +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; } - return { - id: payload.userId, - email: payload.sub, - }; + const query = + `query getUserProfile { profile(customFields: "isNewsletterOptIn") { id userId email firstName lastName profilePicture gender document homePhone birthDate corporateDocument corporateName tradeName businessPhone isCorporate stateRegistration customFields { key value } }}`; + + try { + const { profile: user } = await io.query<{ profile: User }, null>( + { query }, + { headers: { cookie } }, + ); + + return { + "@id": user?.userId ?? user.id, + email: user.email, + givenName: user?.firstName, + familyName: user?.lastName, + taxID: user?.document?.replace(/[^\d]/g, ""), + 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, + stateRegistration: user?.stateRegistration, + customFields: user?.customFields, + }; + } catch (_) { + return null; + } } export default loader; diff --git a/vtex/loaders/wishlist.ts b/vtex/loaders/wishlist.ts index 392a1c9d4..9061cd0d6 100644 --- a/vtex/loaders/wishlist.ts +++ b/vtex/loaders/wishlist.ts @@ -8,9 +8,16 @@ export interface Props { * @description Number of products per page to display * @default 12 */ - count: number; + count?: number; + + /** @description disable pagination and return all records */ + allRecords?: boolean; } +/** + * @title Get Wishlist + * @description Get the wishlist from the user logged in + */ const loader = async ( props: Props, req: Request, @@ -47,8 +54,15 @@ const loader = async ( }, }); + if (props.allRecords) { + return viewList.data ?? []; + } + return viewList.data?.slice(count * page, count * (page + 1)) ?? []; - } catch { + } catch (error) { + if (error instanceof DOMException && error.name === "AbortError") { + throw error; + } return []; } }; diff --git a/vtex/loaders/product.ts b/vtex/loaders/workflow/product.ts similarity index 95% rename from vtex/loaders/product.ts rename to vtex/loaders/workflow/product.ts index de8c527a9..d7ff182ac 100644 --- a/vtex/loaders/product.ts +++ b/vtex/loaders/workflow/product.ts @@ -3,23 +3,23 @@ import type { Product, PropertyValue, UnitPriceSpecification, -} from "../../commerce/types.ts"; -import { AppContext } from "../mod.ts"; +} from "../../../commerce/types.ts"; +import { AppContext } from "../../mod.ts"; import { aggregateOffers, toAdditionalPropertyCategory, toAdditionalPropertyCluster, toAdditionalPropertyReferenceId, toAdditionalPropertySpecification, -} from "../utils/transform.ts"; +} from "../../utils/transform.ts"; export type Props = { productID: string; }; /** - * @title VTEX Integration - * @description Product Loader + * @title Product Loader Workflow + * @description DO NOT USE this on the storefront */ const loader = async ( props: Props, @@ -34,6 +34,8 @@ const loader = async ( skuId: props.productID, }).then((res) => res.json()); + if (!sku.IsActive) return null; + const [skus, salesChannels, ...simulations] = await Promise.all([ vcs ["GET /api/catalog_system/pvt/sku/stockkeepingunitByProductId/:productId"]( @@ -162,6 +164,7 @@ const loader = async ( gtin: sku.AlternateIds.Ean, image: sku.Images.map((img) => ({ "@type": "ImageObject", + encodingFormat: "image", alternateName: img.ImageName ?? img.FileId, url: img.ImageUrl, })), diff --git a/vtex/loaders/workflow/products.ts b/vtex/loaders/workflow/products.ts new file mode 100644 index 000000000..a69411740 --- /dev/null +++ b/vtex/loaders/workflow/products.ts @@ -0,0 +1,31 @@ +import type { Product } from "../../../commerce/types.ts"; +import { AppContext } from "../../mod.ts"; + +export type Props = { + page: number; + pagesize: number; +}; + +/** + * @title Product[] Loader Workflow + * @description DO NOT USE this on your store front + */ +const loader = async ( + props: Props, + _req: Request, + ctx: AppContext, +): Promise => { + const { vcs } = ctx; + + const ids = await vcs + ["GET /api/catalog_system/pvt/sku/stockkeepingunitids"](props) + .then((res) => res.json()); + + return ids.map((productID) => ({ + "@type": "Product", + productID: `${productID}`, + sku: `${productID}`, + })); +}; + +export default loader; diff --git a/vtex/logo.png b/vtex/logo.png index 9ec0fba3c..87e871e5c 100644 Binary files a/vtex/logo.png and b/vtex/logo.png differ diff --git a/vtex/manifest.gen.ts b/vtex/manifest.gen.ts index 81dd0f522..efec540c2 100644 --- a/vtex/manifest.gen.ts +++ b/vtex/manifest.gen.ts @@ -2,93 +2,243 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$0 from "./loaders/product.ts"; -import * as $$$1 from "./loaders/legacy/productList.ts"; -import * as $$$2 from "./loaders/legacy/productDetailsPage.ts"; -import * as $$$3 from "./loaders/legacy/productListingPage.ts"; -import * as $$$4 from "./loaders/legacy/relatedProductsLoader.ts"; -import * as $$$5 from "./loaders/legacy/suggestions.ts"; -import * as $$$6 from "./loaders/product/extensions/listingPage.ts"; -import * as $$$7 from "./loaders/product/extensions/detailsPage.ts"; -import * as $$$8 from "./loaders/product/extensions/list.ts"; -import * as $$$9 from "./loaders/wishlist.ts"; -import * as $$$10 from "./loaders/navbar.ts"; -import * as $$$11 from "./loaders/proxy.ts"; -import * as $$$12 from "./loaders/intelligentSearch/productList.ts"; -import * as $$$13 from "./loaders/intelligentSearch/productDetailsPage.ts"; -import * as $$$14 from "./loaders/intelligentSearch/productListingPage.ts"; -import * as $$$15 from "./loaders/intelligentSearch/suggestions.ts"; -import * as $$$16 from "./loaders/cart.ts"; -import * as $$$17 from "./loaders/user.ts"; +import * as $$$$$$$$$0 from "./actions/address/create.ts"; +import * as $$$$$$$$$1 from "./actions/address/createAddress.ts"; +import * as $$$$$$$$$2 from "./actions/address/delete.ts"; +import * as $$$$$$$$$3 from "./actions/address/deleteAddress.ts"; +import * as $$$$$$$$$4 from "./actions/address/update.ts"; +import * as $$$$$$$$$5 from "./actions/address/updateAddress.ts"; +import * as $$$$$$$$$6 from "./actions/analytics/sendEvent.ts"; +import * as $$$$$$$$$7 from "./actions/authentication/accessKeySignIn.ts"; +import * as $$$$$$$$$8 from "./actions/authentication/classicSignIn.ts"; +import * as $$$$$$$$$9 from "./actions/authentication/logout.ts"; +import * as $$$$$$$$$10 from "./actions/authentication/recoveryPassword.ts"; +import * as $$$$$$$$$11 from "./actions/authentication/refreshToken.ts"; +import * as $$$$$$$$$12 from "./actions/authentication/resetPassword.ts"; +import * as $$$$$$$$$13 from "./actions/authentication/sendEmailVerification.ts"; +import * as $$$$$$$$$14 from "./actions/authentication/startAuthentication.ts"; +import * as $$$$$$$$$15 from "./actions/cart/addItems.ts"; +import * as $$$$$$$$$16 from "./actions/cart/addOfferings.ts"; +import * as $$$$$$$$$17 from "./actions/cart/clearOrderformMessages.ts"; +import * as $$$$$$$$$18 from "./actions/cart/getInstallment.ts"; +import * as $$$$$$$$$19 from "./actions/cart/removeItemAttachment.ts"; +import * as $$$$$$$$$20 from "./actions/cart/removeItems.ts"; +import * as $$$$$$$$$21 from "./actions/cart/removeOffering.ts"; +import * as $$$$$$$$$22 from "./actions/cart/simulation.ts"; +import * as $$$$$$$$$23 from "./actions/cart/updateAttachment.ts"; +import * as $$$$$$$$$24 from "./actions/cart/updateCoupons.ts"; +import * as $$$$$$$$$25 from "./actions/cart/updateGifts.ts"; +import * as $$$$$$$$$26 from "./actions/cart/updateItemAttachment.ts"; +import * as $$$$$$$$$27 from "./actions/cart/updateItemPrice.ts"; +import * as $$$$$$$$$28 from "./actions/cart/updateItems.ts"; +import * as $$$$$$$$$29 from "./actions/cart/updateProfile.ts"; +import * as $$$$$$$$$30 from "./actions/cart/updateUser.ts"; +import * as $$$$$$$$$31 from "./actions/masterdata/createDocument.ts"; +import * as $$$$$$$$$32 from "./actions/masterdata/updateDocument.ts"; +import * as $$$$$$$$$33 from "./actions/masterdata/updatePartialDocument.ts"; +import * as $$$$$$$$$34 from "./actions/newsletter/subscribe.ts"; +import * as $$$$$$$$$35 from "./actions/newsletter/updateNewsletterOptIn.ts"; +import * as $$$$$$$$$36 from "./actions/notifyme.ts"; +import * as $$$$$$$$$37 from "./actions/orders/cancel.ts"; +import * as $$$$$$$$$38 from "./actions/payment/deletePaymentToken.ts"; +import * as $$$$$$$$$39 from "./actions/payments/delete.ts"; +import * as $$$$$$$$$40 from "./actions/profile/newsletterProfile.ts"; +import * as $$$$$$$$$41 from "./actions/profile/updateProfile.ts"; +import * as $$$$$$$$$42 from "./actions/review/submit.ts"; +import * as $$$$$$$$$43 from "./actions/session/createSession.ts"; +import * as $$$$$$$$$44 from "./actions/session/deleteSession.ts"; +import * as $$$$$$$$$45 from "./actions/session/editSession.ts"; +import * as $$$$$$$$$46 from "./actions/sessions/delete.ts"; +import * as $$$$$$$$$47 from "./actions/trigger.ts"; +import * as $$$$$$$$$48 from "./actions/wishlist/addItem.ts"; +import * as $$$$$$$$$49 from "./actions/wishlist/removeItem.ts"; import * as $$$$0 from "./handlers/sitemap.ts"; -import * as $$$$$$$$$0 from "./actions/trigger.ts"; -import * as $$$$$$$$$1 from "./actions/notifyme.ts"; -import * as $$$$$$$$$2 from "./actions/cart/updateCoupons.ts"; -import * as $$$$$$$$$3 from "./actions/cart/updateAttachment.ts"; -import * as $$$$$$$$$4 from "./actions/cart/updateItems.ts"; -import * as $$$$$$$$$5 from "./actions/cart/updateItemAttachment.ts"; -import * as $$$$$$$$$6 from "./actions/cart/updateUser.ts"; -import * as $$$$$$$$$7 from "./actions/cart/addItems.ts"; -import * as $$$$$$$$$8 from "./actions/cart/removeItems.ts"; -import * as $$$$$$$$$9 from "./actions/cart/getInstallment.ts"; -import * as $$$$$$$$$10 from "./actions/cart/updateItemPrice.ts"; -import * as $$$$$$$$$11 from "./actions/cart/updateProfile.ts"; -import * as $$$$$$$$$12 from "./actions/cart/simulation.ts"; -import * as $$$$$$$$$13 from "./actions/cart/removeItemAttachment.ts"; -import * as $$$$$$$$$14 from "./actions/masterdata/createDocument.ts"; -import * as $$$$$$$$$15 from "./actions/newsletter/subscribe.ts"; -import * as $$$$$$$$$16 from "./actions/wishlist/removeItem.ts"; -import * as $$$$$$$$$17 from "./actions/wishlist/addItem.ts"; -import * as $$$$$$$$$18 from "./actions/analytics/sendEvent.ts"; +import * as $$$0 from "./loaders/address/getAddressByPostalCode.ts"; +import * as $$$1 from "./loaders/address/getAddressByZIP.ts"; +import * as $$$2 from "./loaders/address/getUserAddresses.ts"; +import * as $$$3 from "./loaders/address/list.ts"; +import * as $$$4 from "./loaders/cart.ts"; +import * as $$$5 from "./loaders/categories/tree.ts"; +import * as $$$6 from "./loaders/collections/list.ts"; +import * as $$$7 from "./loaders/config.ts"; +import * as $$$8 from "./loaders/intelligentSearch/productDetailsPage.ts"; +import * as $$$9 from "./loaders/intelligentSearch/productList.ts"; +import * as $$$10 from "./loaders/intelligentSearch/productListingPage.ts"; +import * as $$$11 from "./loaders/intelligentSearch/productListingPageReduced.ts"; +import * as $$$12 from "./loaders/intelligentSearch/productSearchValidator.ts"; +import * as $$$13 from "./loaders/intelligentSearch/searches.ts"; +import * as $$$14 from "./loaders/intelligentSearch/suggestions.ts"; +import * as $$$15 from "./loaders/intelligentSearch/topsearches.ts"; +import * as $$$16 from "./loaders/legacy/brands.ts"; +import * as $$$17 from "./loaders/legacy/pageType.ts"; +import * as $$$18 from "./loaders/legacy/productDetailsPage.ts"; +import * as $$$19 from "./loaders/legacy/productList.ts"; +import * as $$$20 from "./loaders/legacy/productListingPage.ts"; +import * as $$$21 from "./loaders/legacy/relatedProductsLoader.ts"; +import * as $$$22 from "./loaders/legacy/suggestions.ts"; +import * as $$$23 from "./loaders/logistics/getSalesChannelById.ts"; +import * as $$$24 from "./loaders/logistics/listPickupPoints.ts"; +import * as $$$25 from "./loaders/logistics/listPickupPointsByLocation.ts"; +import * as $$$26 from "./loaders/logistics/listSalesChannelById.ts"; +import * as $$$27 from "./loaders/logistics/listStockByStore.ts"; +import * as $$$28 from "./loaders/masterdata/searchDocuments.ts"; +import * as $$$29 from "./loaders/navbar.ts"; +import * as $$$30 from "./loaders/options/productIdByTerm.ts"; +import * as $$$31 from "./loaders/orders/getById.ts"; +import * as $$$32 from "./loaders/orders/list.ts"; +import * as $$$33 from "./loaders/orders/order.ts"; +import * as $$$34 from "./loaders/orders/orderplaced.ts"; +import * as $$$35 from "./loaders/paths/PDPDefaultPath.ts"; +import * as $$$36 from "./loaders/paths/PLPDefaultPath.ts"; +import * as $$$37 from "./loaders/payment/paymentSystems.ts"; +import * as $$$38 from "./loaders/payment/userPayments.ts"; +import * as $$$39 from "./loaders/payments/info.ts"; +import * as $$$40 from "./loaders/payments/userPayments.ts"; +import * as $$$41 from "./loaders/product/extend.ts"; +import * as $$$42 from "./loaders/product/extensions/detailsPage.ts"; +import * as $$$43 from "./loaders/product/extensions/list.ts"; +import * as $$$44 from "./loaders/product/extensions/listingPage.ts"; +import * as $$$45 from "./loaders/product/extensions/suggestions.ts"; +import * as $$$46 from "./loaders/product/wishlist.ts"; +import * as $$$47 from "./loaders/profile/getCurrentProfile.ts"; +import * as $$$48 from "./loaders/profile/getProfileByEmail.ts"; +import * as $$$49 from "./loaders/profile/passwordLastUpdate.ts"; +import * as $$$50 from "./loaders/promotion/getPromotionById.ts"; +import * as $$$51 from "./loaders/proxy.ts"; +import * as $$$52 from "./loaders/session/getSession.ts"; +import * as $$$53 from "./loaders/session/getUserSessions.ts"; +import * as $$$54 from "./loaders/sessions/info.ts"; +import * as $$$55 from "./loaders/user.ts"; +import * as $$$56 from "./loaders/wishlist.ts"; +import * as $$$57 from "./loaders/workflow/product.ts"; +import * as $$$58 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": $$$16, - "vtex/loaders/intelligentSearch/productDetailsPage.ts": $$$13, - "vtex/loaders/intelligentSearch/productList.ts": $$$12, - "vtex/loaders/intelligentSearch/productListingPage.ts": $$$14, - "vtex/loaders/intelligentSearch/suggestions.ts": $$$15, - "vtex/loaders/legacy/productDetailsPage.ts": $$$2, - "vtex/loaders/legacy/productList.ts": $$$1, - "vtex/loaders/legacy/productListingPage.ts": $$$3, - "vtex/loaders/legacy/relatedProductsLoader.ts": $$$4, - "vtex/loaders/legacy/suggestions.ts": $$$5, - "vtex/loaders/navbar.ts": $$$10, - "vtex/loaders/product.ts": $$$0, - "vtex/loaders/product/extensions/detailsPage.ts": $$$7, - "vtex/loaders/product/extensions/list.ts": $$$8, - "vtex/loaders/product/extensions/listingPage.ts": $$$6, - "vtex/loaders/proxy.ts": $$$11, - "vtex/loaders/user.ts": $$$17, - "vtex/loaders/wishlist.ts": $$$9, + "vtex/loaders/address/getAddressByPostalCode.ts": $$$0, + "vtex/loaders/address/getAddressByZIP.ts": $$$1, + "vtex/loaders/address/getUserAddresses.ts": $$$2, + "vtex/loaders/address/list.ts": $$$3, + "vtex/loaders/cart.ts": $$$4, + "vtex/loaders/categories/tree.ts": $$$5, + "vtex/loaders/collections/list.ts": $$$6, + "vtex/loaders/config.ts": $$$7, + "vtex/loaders/intelligentSearch/productDetailsPage.ts": $$$8, + "vtex/loaders/intelligentSearch/productList.ts": $$$9, + "vtex/loaders/intelligentSearch/productListingPage.ts": $$$10, + "vtex/loaders/intelligentSearch/productListingPageReduced.ts": $$$11, + "vtex/loaders/intelligentSearch/productSearchValidator.ts": $$$12, + "vtex/loaders/intelligentSearch/searches.ts": $$$13, + "vtex/loaders/intelligentSearch/suggestions.ts": $$$14, + "vtex/loaders/intelligentSearch/topsearches.ts": $$$15, + "vtex/loaders/legacy/brands.ts": $$$16, + "vtex/loaders/legacy/pageType.ts": $$$17, + "vtex/loaders/legacy/productDetailsPage.ts": $$$18, + "vtex/loaders/legacy/productList.ts": $$$19, + "vtex/loaders/legacy/productListingPage.ts": $$$20, + "vtex/loaders/legacy/relatedProductsLoader.ts": $$$21, + "vtex/loaders/legacy/suggestions.ts": $$$22, + "vtex/loaders/logistics/getSalesChannelById.ts": $$$23, + "vtex/loaders/logistics/listPickupPoints.ts": $$$24, + "vtex/loaders/logistics/listPickupPointsByLocation.ts": $$$25, + "vtex/loaders/logistics/listSalesChannelById.ts": $$$26, + "vtex/loaders/logistics/listStockByStore.ts": $$$27, + "vtex/loaders/masterdata/searchDocuments.ts": $$$28, + "vtex/loaders/navbar.ts": $$$29, + "vtex/loaders/options/productIdByTerm.ts": $$$30, + "vtex/loaders/orders/getById.ts": $$$31, + "vtex/loaders/orders/list.ts": $$$32, + "vtex/loaders/orders/order.ts": $$$33, + "vtex/loaders/orders/orderplaced.ts": $$$34, + "vtex/loaders/paths/PDPDefaultPath.ts": $$$35, + "vtex/loaders/paths/PLPDefaultPath.ts": $$$36, + "vtex/loaders/payment/paymentSystems.ts": $$$37, + "vtex/loaders/payment/userPayments.ts": $$$38, + "vtex/loaders/payments/info.ts": $$$39, + "vtex/loaders/payments/userPayments.ts": $$$40, + "vtex/loaders/product/extend.ts": $$$41, + "vtex/loaders/product/extensions/detailsPage.ts": $$$42, + "vtex/loaders/product/extensions/list.ts": $$$43, + "vtex/loaders/product/extensions/listingPage.ts": $$$44, + "vtex/loaders/product/extensions/suggestions.ts": $$$45, + "vtex/loaders/product/wishlist.ts": $$$46, + "vtex/loaders/profile/getCurrentProfile.ts": $$$47, + "vtex/loaders/profile/getProfileByEmail.ts": $$$48, + "vtex/loaders/profile/passwordLastUpdate.ts": $$$49, + "vtex/loaders/promotion/getPromotionById.ts": $$$50, + "vtex/loaders/proxy.ts": $$$51, + "vtex/loaders/session/getSession.ts": $$$52, + "vtex/loaders/session/getUserSessions.ts": $$$53, + "vtex/loaders/sessions/info.ts": $$$54, + "vtex/loaders/user.ts": $$$55, + "vtex/loaders/wishlist.ts": $$$56, + "vtex/loaders/workflow/product.ts": $$$57, + "vtex/loaders/workflow/products.ts": $$$58, }, "handlers": { "vtex/handlers/sitemap.ts": $$$$0, }, + "sections": { + "vtex/sections/Analytics/Vtex.tsx": $$$$$$0, + }, "actions": { - "vtex/actions/analytics/sendEvent.ts": $$$$$$$$$18, - "vtex/actions/cart/addItems.ts": $$$$$$$$$7, - "vtex/actions/cart/getInstallment.ts": $$$$$$$$$9, - "vtex/actions/cart/removeItemAttachment.ts": $$$$$$$$$13, - "vtex/actions/cart/removeItems.ts": $$$$$$$$$8, - "vtex/actions/cart/simulation.ts": $$$$$$$$$12, - "vtex/actions/cart/updateAttachment.ts": $$$$$$$$$3, - "vtex/actions/cart/updateCoupons.ts": $$$$$$$$$2, - "vtex/actions/cart/updateItemAttachment.ts": $$$$$$$$$5, - "vtex/actions/cart/updateItemPrice.ts": $$$$$$$$$10, - "vtex/actions/cart/updateItems.ts": $$$$$$$$$4, - "vtex/actions/cart/updateProfile.ts": $$$$$$$$$11, - "vtex/actions/cart/updateUser.ts": $$$$$$$$$6, - "vtex/actions/masterdata/createDocument.ts": $$$$$$$$$14, - "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$15, - "vtex/actions/notifyme.ts": $$$$$$$$$1, - "vtex/actions/trigger.ts": $$$$$$$$$0, - "vtex/actions/wishlist/addItem.ts": $$$$$$$$$17, - "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$16, + "vtex/actions/address/create.ts": $$$$$$$$$0, + "vtex/actions/address/createAddress.ts": $$$$$$$$$1, + "vtex/actions/address/delete.ts": $$$$$$$$$2, + "vtex/actions/address/deleteAddress.ts": $$$$$$$$$3, + "vtex/actions/address/update.ts": $$$$$$$$$4, + "vtex/actions/address/updateAddress.ts": $$$$$$$$$5, + "vtex/actions/analytics/sendEvent.ts": $$$$$$$$$6, + "vtex/actions/authentication/accessKeySignIn.ts": $$$$$$$$$7, + "vtex/actions/authentication/classicSignIn.ts": $$$$$$$$$8, + "vtex/actions/authentication/logout.ts": $$$$$$$$$9, + "vtex/actions/authentication/recoveryPassword.ts": $$$$$$$$$10, + "vtex/actions/authentication/refreshToken.ts": $$$$$$$$$11, + "vtex/actions/authentication/resetPassword.ts": $$$$$$$$$12, + "vtex/actions/authentication/sendEmailVerification.ts": $$$$$$$$$13, + "vtex/actions/authentication/startAuthentication.ts": $$$$$$$$$14, + "vtex/actions/cart/addItems.ts": $$$$$$$$$15, + "vtex/actions/cart/addOfferings.ts": $$$$$$$$$16, + "vtex/actions/cart/clearOrderformMessages.ts": $$$$$$$$$17, + "vtex/actions/cart/getInstallment.ts": $$$$$$$$$18, + "vtex/actions/cart/removeItemAttachment.ts": $$$$$$$$$19, + "vtex/actions/cart/removeItems.ts": $$$$$$$$$20, + "vtex/actions/cart/removeOffering.ts": $$$$$$$$$21, + "vtex/actions/cart/simulation.ts": $$$$$$$$$22, + "vtex/actions/cart/updateAttachment.ts": $$$$$$$$$23, + "vtex/actions/cart/updateCoupons.ts": $$$$$$$$$24, + "vtex/actions/cart/updateGifts.ts": $$$$$$$$$25, + "vtex/actions/cart/updateItemAttachment.ts": $$$$$$$$$26, + "vtex/actions/cart/updateItemPrice.ts": $$$$$$$$$27, + "vtex/actions/cart/updateItems.ts": $$$$$$$$$28, + "vtex/actions/cart/updateProfile.ts": $$$$$$$$$29, + "vtex/actions/cart/updateUser.ts": $$$$$$$$$30, + "vtex/actions/masterdata/createDocument.ts": $$$$$$$$$31, + "vtex/actions/masterdata/updateDocument.ts": $$$$$$$$$32, + "vtex/actions/masterdata/updatePartialDocument.ts": $$$$$$$$$33, + "vtex/actions/newsletter/subscribe.ts": $$$$$$$$$34, + "vtex/actions/newsletter/updateNewsletterOptIn.ts": $$$$$$$$$35, + "vtex/actions/notifyme.ts": $$$$$$$$$36, + "vtex/actions/orders/cancel.ts": $$$$$$$$$37, + "vtex/actions/payment/deletePaymentToken.ts": $$$$$$$$$38, + "vtex/actions/payments/delete.ts": $$$$$$$$$39, + "vtex/actions/profile/newsletterProfile.ts": $$$$$$$$$40, + "vtex/actions/profile/updateProfile.ts": $$$$$$$$$41, + "vtex/actions/review/submit.ts": $$$$$$$$$42, + "vtex/actions/session/createSession.ts": $$$$$$$$$43, + "vtex/actions/session/deleteSession.ts": $$$$$$$$$44, + "vtex/actions/session/editSession.ts": $$$$$$$$$45, + "vtex/actions/sessions/delete.ts": $$$$$$$$$46, + "vtex/actions/trigger.ts": $$$$$$$$$47, + "vtex/actions/wishlist/addItem.ts": $$$$$$$$$48, + "vtex/actions/wishlist/removeItem.ts": $$$$$$$$$49, }, "workflows": { "vtex/workflows/events.ts": $$$$$$$$$$0, + "vtex/workflows/product/index.ts": $$$$$$$$$$1, }, "name": "vtex", "baseUrl": import.meta.url, diff --git a/vtex/middleware.ts b/vtex/middleware.ts index 3580f580d..e70e9529e 100644 --- a/vtex/middleware.ts +++ b/vtex/middleware.ts @@ -1,43 +1,34 @@ -import { equal } from "std/testing/asserts.ts"; +import { getCookies } from "std/http/cookie.ts"; import { AppMiddlewareContext } from "./mod.ts"; import { - buildSegmentCookie, - getSegmentFromCookie, - setSegmentCookie, - setSegmentInBag, -} from "./utils/segment.ts"; -import { Segment } from "./utils/types.ts"; - -/** - * by default segment starts with null values - */ -const DEFAULT_SEGMENT: Partial = { - utmi_campaign: null, - utm_campaign: null, - utm_source: null, -}; - -// Symbols are the default keys for WeakMaps https://developer.mozilla.org/pt-BR/docs/Web/JavaScript/Reference/Global_Objects/WeakMap -const SEGMENT_ONCE_KEY = Symbol("Set segment on context"); + getISCookiesFromBag, + 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, ) => { - if (!ctx.bag.has(SEGMENT_ONCE_KEY)) { - ctx.bag.set(SEGMENT_ONCE_KEY, true); + 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); + + if (!isCookies) { + setISCookiesBag(cookies, ctx); + } - const segmentFromCookie = getSegmentFromCookie(req); - const segmentFromRequest = buildSegmentCookie(req); - const segment = { - ...DEFAULT_SEGMENT, - ...segmentFromCookie, - ...segmentFromRequest, - }; - setSegmentInBag(ctx, segment); - if (!equal(segmentFromCookie, segment)) { - setSegmentCookie(segment, ctx.response.headers); + if (!segment) { + setSegmentBag(cookies, req, ctx); } } diff --git a/vtex/mod.ts b/vtex/mod.ts index b51b0915a..62ea01632 100644 --- a/vtex/mod.ts +++ b/vtex/mod.ts @@ -1,9 +1,3 @@ -import type { - App as A, - AppContext as AC, - AppMiddlewareContext as AMC, - ManifestOf, -} from "deco/mod.ts"; import { createGraphqlClient } from "../utils/graphql.ts"; import { createHttpClient } from "../utils/http.ts"; import workflow from "../workflows/mod.ts"; @@ -13,11 +7,40 @@ import { SP, VTEXCommerceStable } from "./utils/client.ts"; import { fetchSafe } from "./utils/fetchVTEX.ts"; import { OpenAPI as VCS } from "./utils/openapi/vcs.openapi.gen.ts"; import { OpenAPI as API } from "./utils/openapi/api.openapi.gen.ts"; - +import { OpenAPI as MY } from "./utils/openapi/my.openapi.gen.ts"; +import { OpenAPI as VPAY } from "./utils/openapi/payments.openapi.gen.ts"; +import { OpenAPI as SUB } from "./utils/openapi/subscriptions.openapi.gen.ts"; +import { Segment } from "./utils/types.ts"; +import type { Secret } from "../website/loaders/secret.ts"; +import { removeDirtyCookies } from "../utils/normalize.ts"; +import { Markdown } from "../decohub/components/Markdown.tsx"; +import { PreviewVtex } from "./preview/Preview.tsx"; +import { + type App as A, + type AppContext as AC, + type AppMiddlewareContext as AMC, + type AppRuntime, + asResolved, + type ManifestOf, +} from "@deco/deco"; +import { Suggestion } from "../commerce/types.ts"; export type App = ReturnType; export type AppContext = AC; export type AppManifest = ManifestOf; export type AppMiddlewareContext = AMC; +export type SegmentCulture = Omit< + Partial, + | "utm_medium" + | "utm_campaign" + | "utm_source" + | "utmi_campaign" + | "utmi_part" + | "utmi_page" + | "campaigns" + | "priceTables" + | "regionId" +>; +import { Matcher } from "@deco/deco/blocks"; /** @title VTEX */ export interface Props { @@ -25,87 +48,197 @@ export interface Props { * @description VTEX Account name. For more info, read here: https://help.vtex.com/en/tutorial/o-que-e-account-name--i0mIGLcg3QyEy8OCicEoC. */ account: string; - /** * @title Public store URL - * @description Domain that is registered on License Manager (e.g: www.mystore.com.br) + * @description Domain that is registered on License Manager (e.g: secure.mystore.com.br) to enable account/checkout/api proxy. Important: dont use the same domain as the public store url, or it will create a loop and break the app. */ publicUrl: string; - /** * @title App Key * @description Only required for extra features */ - appKey?: string; - + appKey?: Secret; /** * @title App Token * @description Only required for extra features * @format password */ - appToken?: string; - + appToken?: Secret; + /** + * @title Default Sales Channel + * @description (Use defaultSegment instead) + * @deprecated + */ + salesChannel?: string; + /** + * @title Default Segment + */ + /** + * @title Set Refresh Token + * @description Set the refresh token in the cookies in headless login actions (actions/authentication/*) + * @default false + */ + setRefreshToken?: boolean; + defaultSegment?: SegmentCulture; + usePortalSitemap?: boolean; /** * @description Use VTEX as backend platform + * @default vtex + * @hide true */ platform: "vtex"; + /** + * @title Skip Simulation Behavior + */ + skipSimulationBehavior?: Matcher; - usePortalSitemap?: boolean; -} - -export const color = 0xF71963; + advancedConfigs?: { + doNotFetchVariantsForRelatedProducts?: boolean; + }; + /** + * @title Cached Search Terms + * @description List of search terms that should be cached. By default, search results are not cached. + */ + cachedSearchTerms?: { + /** + * @title Terms + * @description List of search terms that should be cached. Use the top searches loader to get the terms. + */ + terms?: Suggestion; + /** + * @title Extra Paths + * @description List of extra terms that should be cached. + */ + extraTerms?: string[]; + }; +} +export const color = 0xf71963; /** + * @appName vtex * @title VTEX + * @description Power your store with product, inventory, and checkout tools from VTEX. + * @category Ecommmerce + * @logo https://assets.decocache.com/mcp/0d6e795b-cefd-4853-9a51-93b346c52c3f/VTEX.svg */ export default function VTEX( - { appKey, appToken, account, ...props }: Props, + { appKey, appToken, account, publicUrl: _publicUrl, salesChannel, ...props }: + Props, ) { + const publicUrl = _publicUrl?.startsWith("https://") + ? _publicUrl + : `https://${_publicUrl}`; const headers = new Headers(); - - appKey && headers.set("X-VTEX-API-AppKey", appKey); - appToken && headers.set("X-VTEX-API-AppToken", appToken); - + appKey && + headers.set( + "X-VTEX-API-AppKey", + typeof appKey === "string" ? appKey : appKey?.get?.() ?? "", + ); + appToken && + headers.set( + "X-VTEX-API-AppToken", + typeof appToken === "string" ? appToken : appToken?.get?.() ?? "", + ); const sp = createHttpClient({ base: `https://sp.vtex.com`, + processHeaders: removeDirtyCookies, + fetcher: fetchSafe, + }); + const my = createHttpClient({ + base: `https://${account}.myvtex.com/`, + processHeaders: removeDirtyCookies, fetcher: fetchSafe, }); const vcsDeprecated = createHttpClient({ - base: `https://${account}.vtexcommercestable.com.br`, + base: `https://${account}.myvtex.com/`, + processHeaders: removeDirtyCookies, fetcher: fetchSafe, }); + const ioUrl = publicUrl.endsWith("/") + ? `${publicUrl}api/io/_v/private/graphql/v1` + : `${publicUrl}/api/io/_v/private/graphql/v1`; const io = createGraphqlClient({ endpoint: - `https://${account}.vtexcommercestable.com.br/api/io/_v/private/graphql/v1`, + `https://${account}.myvtex.com/api/io/_v/private/graphql/v1`, + processHeaders: removeDirtyCookies, fetcher: fetchSafe, }); const vcs = createHttpClient({ - base: `https://${account}.vtexcommercestable.com.br`, + base: `https://${account}.myvtex.com/`, fetcher: fetchSafe, + processHeaders: removeDirtyCookies, headers: headers, }); const api = createHttpClient({ base: `https://api.vtex.com/${account}`, fetcher: fetchSafe, + processHeaders: removeDirtyCookies, + headers: headers, + }); + const vpay = createHttpClient({ + base: `https://${account}.vtexpayments.com.br`, + fetcher: fetchSafe, + processHeaders: removeDirtyCookies, + headers: headers, + }); + const sub = createHttpClient({ + base: `https://${account}.vtexcommercestable.com.br`, + processHeaders: removeDirtyCookies, + fetcher: fetchSafe, headers: headers, }); + const cachedSearchTerms = [ + ...(props.cachedSearchTerms?.terms?.searches ?? []).map((search) => + search.term + ), + ...(props.cachedSearchTerms?.extraTerms ?? []), + ]; + const state = { ...props, + salesChannel: salesChannel ?? "1", account, + publicUrl, vcsDeprecated, sp, io, vcs, + my, api, + vpay, + sub, + cachedSearchTerms, }; - - const app: A]> = { + const app: A, + ]> = { state, manifest, middleware, dependencies: [workflow({})], }; - return app; } +export const preview = async (props: AppRuntime) => { + const markdownContent = await Markdown( + new URL("./README.md", import.meta.url).href, + ); + return { + Component: PreviewVtex, + props: { + ...props, + markdownContent, + }, + }; +}; +export const onBeforeResolveProps = (props: Props) => { + const skipSimulationBehavior = props.skipSimulationBehavior + ? asResolved(props.skipSimulationBehavior, false) + : undefined; + + return { + ...props, + skipSimulationBehavior, + }; +}; diff --git a/vtex/preview/Preview.tsx b/vtex/preview/Preview.tsx new file mode 100644 index 000000000..495549ca9 --- /dev/null +++ b/vtex/preview/Preview.tsx @@ -0,0 +1,184 @@ +import type { JSX } from "preact"; +import { PreviewContainer } from "../../utils/preview.tsx"; +import { App } from "../mod.ts"; +import { type AppRuntime, type BaseContext, Context } from "@deco/deco"; +export interface Props { + publicUrl: string; +} +export const PreviewVtex = ( + app: AppRuntime & { + markdownContent: () => JSX.Element; + }, +) => { + const context = Context.active(); + const decoSite = context.site; + const publicUrl = app.state?.publicUrl || ""; + const account = app.state?.account || ""; + const withoutSubDomain = publicUrl.split(".").slice(1).join("."); + return ( + , + }, + { + title: "Go Live", + content: ( + + ), + }, + { + title: "Indexing", + content: , + }, + ]} + /> + ); +}; +export function Indexing() { + return ( +
+

+ If you wish to index VTEX's product data into deco, click in the button + below. Beware this is a very costly operation that may influence on your + page views quota +

+
+
+ + + +
+
+ ); +} +export function GoLivePtBr({ decoSite, withoutSubDomain, account }: { + decoSite: string; + withoutSubDomain: string; + account: string; +}) { + return ( + <> +

+ Preparativos +

+ +
+ + 1º - Adicionar os domínios a VTEX + +

+ Nessa etapa, adicione os seguintes domínios na lista de domínios VTEX. +

+
    +
  • - {decoSite}.deco.site
  • +
  • - secure.{withoutSubDomain}
  • +
+

+ Para adicionar domínios na VTEX, entre{" "} + + nessa página + . +

+
+ +
+ + 2º - Fazer o apontamento do domínio secure.{withoutSubDomain} + +

+ No seu serviço de hospedagem, defina o CNAME para o subdomínio secure. +

+

Content: secure.{withoutSubDomain}.cdn.vtex.com

+
+ +
+ + 3º - Preencher o publicUrl da sua App + +

+ Na sua App, preencha o campo publicUrl com o domínio secure da sua + loja. (Form a esquerda) +

+
+ +

Go Live

+ +
+ + 1º - Adicionando o domínio na deco + +

+ No painel da deco.cx, em{" "} + + configurações + , clique em adicionar domínio existente. +

+

Esse modal deve aparecer:

+ +

Clique em Adicionar

+
+ +
+ + 2º - Apontando o domíno para a deco + +

+ No seu serviço de hospedagem, defina o CNAME do domínio que deseja + fazer o Go Live, sendo a URL deco.site. +

+

Content: {decoSite}.deco.site

+
+ +
+ + 3º - Validando o domínio + +

Novamente painel da deco.cx, em configurações.

+

+ Clique nos 3 pontinhos na linha do domínio que deseja validar. +

+

Depois, clique em Setup.

+

Por último, clique em Validate.

+

+ Se tudo estiver certo, o domínio deve ser validado e você poderá + acessá-lo em alguns minutos. +

+
+ + ); +} diff --git a/vtex/runtime.ts b/vtex/runtime.ts index 41d65a98d..da42a2435 100644 --- a/vtex/runtime.ts +++ b/vtex/runtime.ts @@ -1,4 +1,3 @@ -import { proxy } from "deco/clients/withManifest.ts"; import { Manifest } from "./manifest.gen.ts"; - +import { proxy } from "@deco/deco/web"; export const invoke = proxy(); diff --git a/vtex/sections/Analytics/Vtex.tsx b/vtex/sections/Analytics/Vtex.tsx new file mode 100644 index 000000000..ba91361bd --- /dev/null +++ b/vtex/sections/Analytics/Vtex.tsx @@ -0,0 +1,112 @@ +import { + AddToCartEvent, + AnalyticsItem, + SelectItemEvent, +} from "../../../commerce/types.ts"; +import { AppContext } from "../../mod.ts"; +import { getISCookiesFromBag } from "../../utils/intelligentSearch.ts"; +import { SPEvent } from "../../utils/types.ts"; +import { type SectionProps } from "@deco/deco"; +import { useScriptAsDataURI } from "@deco/deco/hooks"; +interface ISCookies { + // deno-lint-ignore no-explicit-any + anonymous: any; + // deno-lint-ignore no-explicit-any + session: any; +} +const snippet = (account: string, agent: string, cookies: ISCookies | null) => { + const url = new URL(globalThis.location.href); + const isSearch = url.searchParams.get("q"); + const apiUrl = `https://sp.vtex.com/event-api/v1/${account}/event`; + const eventFetch = (props: SPEvent) => { + fetch(apiUrl, { + method: "POST", + body: JSON.stringify({ + ...baseProps, + ...props, + }), + headers: { + "Content-Type": "application/json", + }, + }); + }; + const baseProps = { + agent, + ...cookies, + }; + // deno-lint-ignore no-explicit-any + function isSelectItemEvent(event: any): event is SelectItemEvent { + return event.name === "select_item"; + } + // deno-lint-ignore no-explicit-any + function isCartEvent(event: any): event is AddToCartEvent { + const cartEvents = ["remove_from_cart", "add_to_cart", "view_cart"]; + return cartEvents.includes(event.name); + } + type WithID = T & { + item_id: string; + }; + const hasItemId = (item: T): item is WithID => + // deno-lint-ignore no-explicit-any + typeof (item as any).item_id === "string"; + // Session ping + if (isSearch) { + setInterval(() => { + eventFetch({ + type: "session.ping", + url: url.href, + }); + }, 1000 * 60); + } + globalThis.window.DECO.events.subscribe((event) => { + if (isCartEvent(event)) { + const products: { + productId: string; + quantity: number; + }[] = []; + event.params?.items?.forEach((item: AnalyticsItem) => { + if (hasItemId(item)) { + products.push({ + productId: item.item_id, + quantity: item.quantity, + }); + } + }); + eventFetch({ + type: "page.cart", + products: products, + }); + } + if (isSelectItemEvent(event) && isSearch) { + const [item] = event.params.items; + if (hasItemId(item)) { + eventFetch({ + type: "search.click", + productId: item.item_id, + position: item.index || 0, + url: url.href, + text: url.searchParams.get("q") || "", + }); + } + } + }); +}; +export default function VtexAnalytics( + { account, agent, cookies }: SectionProps, +) { + return ( + test
Próxima compra
25/12/2021
Entrega estimada
13/01/2022
************2503
!important; \" align=\"left\">

Atenciosamente,
Equipe CeA.

", + "hasAttachment": false, + "attachmentNames": [], + "date": "2024-07-25T22:01:25Z" + } + ] + } + } + } + } + } + }, + "/api/rns/settings": { + "get": { + "tags": [ + "Settings" + ], + "summary": "Get subscriptions settings", + "description": "Retrieves information about the subscriptions settings of your store.\r\n\r\n## Permissions\r\n\r\nAny user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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| Subscriptions | ApplicationAccess | **Subscription admin** |\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 API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "operationId": "GetSettings", + "parameters": [ + { + "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" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Settings" + }, + "example": { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "pickupInPoint" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "attachmentPreferences": { + "enableAttachments": false, + "splitSameSkuWithDifferentAttachments": false + }, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true + } + } + } + } + } + }, + "post": { + "tags": [ + "Settings" + ], + "summary": "Edit subscriptions settings", + "description": "Edits the subscriptions settings of your store. This configurations apply to all subscriptions.\r\n\r\n## Permissions\r\n\r\nAny user or [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-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| Subscriptions | ApplicationAccess | **Subscription admin** |\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 API keys](https://help.vtex.com/en/tutorial/best-practices-api-keys--7b6nD1VMHa49aI5brlOvJm) when assigning License Manager roles to integrations.", + "operationId": "EditSettings", + "parameters": [ + { + "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" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "slaOption", + "defaultSla", + "isUsingV3", + "onMigrationProcess", + "executionHourInUtc", + "workflowVersion", + "deliveryChannels", + "randomIdGeneration", + "isMultipleInstallmentsEnabledOnCreation", + "isMultipleInstallmentsEnabledOnUpdate", + "orderCustomDataAppId", + "postponeExpiration", + "manualPriceAllowed", + "useItemPriceFromOriginalOrder" + ], + "properties": { + "slaOption": { + "description": "Service Level Agreement (SLA) option, which is the shipping method. The possible values are:\r\n- `NONE`: The platform automatically chooses the smallest cost for shipping method at the time of the subscription cycle generation. The `defaultSla` field must remain `null`.\r\n- `CHEAPEST`: Smallest cost for shipping method at the time of cycle generation. The `defaultSla` field must remain `null`.\r\n- `CUSTOMER_CHOICE`: The customer can select the desired shipping method at checkout for every new subscription order. The `defaultSla` field must remain `null`.\r\n- `STORE_CHOICE`: The store sets the preferred shipping method. This is configured in the `defaultSla` field.", + "type": "string", + "enum": [ + "NONE", + "CHEAPEST", + "CUSTOMER_CHOICE", + "STORE_CHOICE" + ], + "example": "STORE_CHOICE" + }, + "defaultSla": { + "description": "This field contains the shipping method set by the store for new cycle generation. The only case when its value is not `null` is when the `slaOption` field is set as `STORE_CHOICE`.", + "type": "string", + "nullable": true, + "example": "Express" + }, + "isUsingV3": { + "description": "Indicates if the store uses the updated Subscriptions V3 (`true`) or a previous version (`false`).", + "type": "boolean", + "example": true + }, + "onMigrationProcess": { + "description": "Indicates whether or not the account is in the migration process to Subscriptions V3.", + "type": "boolean", + "example": false + }, + "executionHourInUtc": { + "description": "Indicates the time future subscription orders will be generated.", + "type": "integer", + "example": 9 + }, + "workflowVersion": { + "description": "Workflow version.", + "type": "string", + "example": "1.1" + }, + "deliveryChannels": { + "description": "Array containing delivery channels.", + "type": "array", + "items": { + "description": "Type of delivery channel. The values that are possible are: `pickupInPoint` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) and `delivery` for regular delivery.", + "type": "string", + "example": "delivery", + "enum": [ + "delivery", + "pickupInPoint" + ] + } + }, + "randomIdGeneration": { + "description": "Defines if subscription order IDs will be randomly generated (`true`) or not (`false`).", + "type": "boolean", + "example": false + }, + "isMultipleInstallmentsEnabledOnCreation": { + "description": "Defines if the store allows multiple installments when a subscription is created (`true`) or not (`false`).", + "type": "boolean", + "example": true + }, + "isMultipleInstallmentsEnabledOnUpdate": { + "description": "Defines if the store allows multiple installments when the subscription is updated (`true`) or not (`false`).", + "type": "boolean", + "example": true + }, + "attachmentPreferences": { + "type": "object", + "description": "Store settings on how to process original orders with SKUs that contain [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).", + "properties": { + "enableAttachments": { + "type": "boolean", + "description": "Defines if the store [keeps attachments from original orders](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) and subscription orders incorporate them (`true`) or if these attachments are disconsidered (`false`). By default, this field is set as `false`.", + "example": false + }, + "splitSameSkuWithDifferentAttachments": { + "type": "boolean", + "description": "Defines if the [same SKUs that contain different attachments](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) in the original order are split (`true`) or not (`false`). By default, this field is set as `false`. It can only be set as `true` if the `enableAttachments` field is also set as `true`.", + "example": false + } + } + }, + "orderCustomDataAppId": { + "description": "When there are custom fields configured, this field passes along the `customData` information in the original order to the next subscriptions orders.", + "type": "string", + "example": "customData.customFieldName", + "nullable": true + }, + "postponeExpiration": { + "description": "Defines if the expiration of subscriptions can be postponed (`true`) or not (`false`).", + "type": "boolean", + "example": false + }, + "manualPriceAllowed": { + "description": "When set to `true`, this property enables [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) configuration in subscription items. This is valid for all existing subscriptions, provided that there is a manual price configured and that the `isUsingV3` field is set as `true`.", + "type": "boolean", + "example": true + }, + "useItemPriceFromOriginalOrder": { + "description": "When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` and `isUsingV3` properties are set to `true`.", + "type": "boolean", + "example": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Settings" + }, + "example": { + "slaOption": "STORE_CHOICE", + "defaultSla": "Express", + "isUsingV3": true, + "onMigrationProcess": false, + "executionHourInUtc": 9, + "workflowVersion": "1.1", + "deliveryChannels": [ + "delivery", + "pickupInPoint" + ], + "randomIdGeneration": false, + "isMultipleInstallmentsEnabledOnCreation": true, + "isMultipleInstallmentsEnabledOnUpdate": true, + "orderCustomDataAppId": "customData.customFieldName", + "postponeExpiration": false, + "manualPriceAllowed": true, + "useItemPriceFromOriginalOrder": true + } + } + } + } + } + } + } + }, + "security": [ + { + "appKey": [], + "appToken": [] + }, + { + "VtexIdclientAutCookie": [] + } + ], + "components": { + "securitySchemes": { + "appKey": { + "type": "apiKey", + "in": "header", + "name": "X-VTEX-API-AppKey", + "description": "Unique identifier of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys)." + }, + "appToken": { + "type": "apiKey", + "in": "header", + "name": "X-VTEX-API-AppToken", + "description": "Secret token of the [API key](https://developers.vtex.com/docs/guides/api-authentication-using-api-keys)." + }, + "VtexIdclientAutCookie": { + "type": "apiKey", + "in": "header", + "name": "VtexIdclientAutCookie", + "description": "[User token](https://developers.vtex.com/docs/guides/api-authentication-using-user-tokens), valid for 24 hours." + } + }, + "schemas": { + "SimulationItemResult": { + "type": "object", + "description": "Simulation information about an item.", + "properties": { + "id": { + "type": "string", + "description": "SKU ID.", + "nullable": true + }, + "quantity": { + "type": "integer", + "description": "Quantity of units for the given SKU." + }, + "unitPrice": { + "type": "integer", + "format": "int64", + "description": "Unit price in cents.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Subscription cycle status in the simulation." + }, + "price": { + "type": "integer", + "description": "Price in cents.", + "nullable": true + }, + "sellingPrice": { + "type": "integer", + "description": "Selling price in cents." + }, + "manualPrice": { + "type": "number", + "description": "[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf).", + "nullable": true + } + } + }, + "SubscriptionCycleResponse": { + "type": "object", + "description": "Object with information about the subscription cycle.", + "properties": { + "id": { + "type": "string", + "description": "Cycle ID. When the `cycleCount` value is `1`, the `id` value will be the same as the `subscriptionId` value." + }, + "subscriptionId": { + "type": "string", + "description": "[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID." + }, + "workflowId": { + "type": "string", + "description": "Code that identifies the subscription in the [order flow](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)." + }, + "status": { + "type": "string", + "description": "Subscription cycle execution status. The possible values are:\r\n- `TRIGGERED`: Execution has been triggered. \r\n- `IN_PROCESS`: Execution is being processed by the system.\r\n- `FAILURE`: An internal error occurred during the subscription execution.\r\n- `SUCCESS`: Successful cycle processing.\r\n- `EXPIRED`: The subscription was not renewed, and the period for which it was valid has ended.\r\n- `ORDER_ERROR`: Cycle was not executed due to an error in order placement.\r\n- `PAYMENT_ERROR`: Cycle was not executed due to an error in the payment.\r\n- `SKIPED`: A subscription cycle execution was skipped, and the subscription will be executed in the next cycle.\r\n- `SUCCESS_WITH_NO_ORDER`: Cycle was executed successfully, and the linked order has no items.\r\n- `SUCCESS_WITH_PARTIAL_ORDER`: Cycle was executed successfully, and has a linked partial order.\r\n- `RE_TRIGGERED`: Execution retry was triggered manually.\r\n- `SCHEDULE_UPDATED`: The next subscription cycle execution date has been updated.", + "enum": [ + "TRIGGERED", + "IN_PROCESS", + "FAILURE", + "SUCCESS", + "EXPIRED", + "ORDER_ERROR", + "PAYMENT_ERROR", + "SKIPED", + "SUCCESS_WITH_NO_ORDER", + "SUCCESS_WITH_PARTIAL_ORDER", + "RE_TRIGGERED", + "SCHEDULE_UPDATED" + ] + }, + "customerEmail": { + "type": "string", + "description": "Customer email." + }, + "customerId": { + "type": "string", + "description": "Customer ID." + }, + "date": { + "type": "string", + "format": "date-time", + "description": "Current date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "lastUpdate": { + "type": "string", + "format": "date-time", + "description": "Subscription cycle last update date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "cycleCount": { + "type": "integer", + "description": "The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on." + }, + "isInRetry": { + "type": "boolean", + "description": "Defines if the cycle execution is in retry (`true`), or not (`false`)." + }, + "message": { + "type": "string", + "description": "Cycle execution message.", + "nullable": true + }, + "friendlyMessage": { + "type": "string", + "description": "Cycle execution friendly message.", + "nullable": true + }, + "plan": { + "$ref": "#/components/schemas/PlanResponse" + }, + "orderInfo": { + "type": "object", + "description": "Subscription order information.", + "properties": { + "orderId": { + "type": "string", + "description": "Order ID." + }, + "orderGroup": { + "type": "string", + "description": "Order group ID." + }, + "paymentURL": { + "type": "string", + "description": "Order payment URL.", + "nullable": true + }, + "value": { + "type": "integer", + "format": "int64", + "description": "Order value in cents." + } + } + }, + "context": { + "type": "object", + "description": "Subscription cycle context.", + "properties": { + "items": { + "type": "array", + "description": "Information about subscription cycle items.", + "nullable": true, + "items": { + "type": "object", + "description": "Subscription item information.", + "properties": { + "subscriptionItemId": { + "type": "string", + "nullable": true, + "description": "Subscription item ID." + }, + "skuId": { + "type": "string", + "nullable": true, + "description": "SKU ID." + }, + "quantity": { + "type": "integer", + "description": "Quantity of item units.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Subscription status.", + "nullable": true, + "enum": [ + "ACTIVE", + "PAUSED", + "CANCELED", + "EXPIRED", + "MISSING" + ] + }, + "isSkipped": { + "type": "boolean", + "description": "Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`).", + "nullable": true + }, + "cycleCount": { + "type": "integer", + "description": "The cycle determines the position of an order counting from when the shopper subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on.", + "nullable": true + } + } + } + }, + "paymentSystem": { + "type": "string", + "description": "Payment system ID.", + "nullable": true + }, + "paymentSystemName": { + "type": "string", + "description": "Payment system name.", + "nullable": true + }, + "paymentSystemGroup": { + "type": "string", + "description": "Payment system group.", + "nullable": true + }, + "paymentAccountId": { + "type": "string", + "description": "Information about the customer profile and their documents, such as a credit card number. You can also retrieve that information using the [Get client profile by email](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/profiles) endpoint.", + "nullable": true + }, + "addressId": { + "type": "string", + "description": "Shipping address ID.", + "nullable": true + }, + "addressType": { + "type": "string", + "description": "Shipping address type.", + "nullable": true + }, + "catalogAttachment": { + "type": "string", + "description": "Subscription [attachment](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) content, when applicable.", + "nullable": true + } + } + }, + "simulationItems": { + "type": "array", + "description": "Subscription simulation items.", + "items": { + "$ref": "#/components/schemas/SimulationItemResult" + }, + "nullable": true + } + } + }, + "StorePlan": { + "type": "object", + "description": "Subscription [plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.", + "properties": { + "id": { + "type": "string", + "description": "Subscription plan ID." + }, + "frequencies": { + "type": "array", + "description": "Array of the plan frequencies.", + "items": { + "type": "object", + "description": "Information about the plan periodicity and interval.", + "properties": { + "periodicity": { + "type": "string", + "description": "Repurchase frequency requested by the customer, defines the subscriptions recurrence period.", + "nullable": true, + "enum": [ + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY" + ] + }, + "interval": { + "type": "integer", + "description": "Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on." + } + } + } + }, + "isActive": { + "type": "boolean", + "description": "Defines if the plan is active (`true`) or not (`false`)." + }, + "importInProgress": { + "type": "boolean", + "description": "Defines if a SKU importing process is in progress (`true`) or not (`false`)." + }, + "attachmentId": { + "type": "integer", + "description": "Plan attachment ID." + }, + "isValid": { + "type": "boolean", + "description": "Defines if the plan is valid (`true`) or not (`false`)." + }, + "validationMessages": { + "type": "array", + "description": "List of validation messages.", + "nullable": true, + "items": { + "type": "string", + "description": "Validation message." + } + }, + "validity": { + "type": "object", + "description": "Information about the period during which the subscription plan will be valid.", + "nullable": true, + "properties": { + "begin": { + "type": "string", + "format": "date-time", + "description": "Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "end": { + "type": "string", + "format": "date-time", + "description": "Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + } + } + }, + "purchaseDays": { + "type": "array", + "description": "Time reference in which subscription orders will be created.", + "items": { + "type": "string", + "description": "Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`." + } + } + } + }, + "ReportResponse": { + "type": "object", + "description": "Subscription report information.", + "properties": { + "id": { + "type": "string", + "description": "Report document ID." + }, + "finished": { + "type": "boolean", + "description": "Defines if the report is finished (`true`) or not (`false`)." + }, + "recordsProcessed": { + "type": "integer", + "description": "Number of records processed at the moment." + }, + "recordsSum": { + "type": "integer", + "description": "Total number of records to be processed.", + "nullable": true + }, + "startDate": { + "type": "string", + "description": "Report starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "lastUpdateTime": { + "type": "string", + "description": "Report last update date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "completedDate": { + "type": "string", + "description": "Report completion date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "errorCount": { + "type": "integer", + "description": "Error counting numbers, when applicable.", + "nullable": true + }, + "percentageProcessed": { + "type": "number", + "description": "Report processing percentage." + }, + "enqueueDate": { + "type": "string", + "description": "Request enqueue date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "email": { + "type": "string", + "description": "Email of the user that receives the report." + }, + "canceled": { + "type": "boolean", + "description": "Defines if the report is canceled (`true`) or not (`false`)." + }, + "outputType": { + "type": "string", + "description": "Report file extension.", + "nullable": true + }, + "zipped": { + "type": "boolean", + "description": "Defines if the report file is zipped (`true`) or not (`false`)." + }, + "linkToDownload": { + "type": "string", + "description": "Link do download the report.", + "nullable": true + }, + "lastErrorMessage": { + "type": "string", + "description": "Error last message, when applicable.", + "nullable": true + }, + "statusMessage": { + "type": "string", + "description": "Report status message." + } + } + }, + "PlanResponse": { + "type": "object", + "description": "[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.", + "required": [ + "frequency", + "id", + "purchaseDay", + "validity" + ], + "properties": { + "id": { + "type": "string", + "description": "Subscription plan ID.", + "nullable": true + }, + "frequency": { + "type": "object", + "description": "Subscription plan frequency.", + "required": [ + "interval", + "periodicity" + ], + "properties": { + "periodicity": { + "type": "string", + "description": "Plan repurchase frequency, defines the subscription recurrence.", + "nullable": true, + "enum": [ + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY" + ] + }, + "interval": { + "type": "integer", + "description": "Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be days, for `MONTHLY` it will be months, and so on." + } + } + }, + "validity": { + "type": "object", + "description": "Information about the period during which the subscription plan will be valid.", + "required": [ + "begin" + ], + "properties": { + "begin": { + "type": "string", + "description": "Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "end": { + "type": "string", + "description": "Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + } + } + }, + "purchaseDay": { + "type": "string", + "description": "Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. When the subscription periodicity is `DAILY`, this field corresponds to `Not_Applicable`." + } + } + }, + "SubscriptionGroupResponse": { + "type": "object", + "description": "Information about a given subscription.", + "required": [ + "createdAt", + "customerEmail", + "customerId", + "cycleCount", + "id", + "isSkipped", + "items", + "lastUpdate", + "nextPurchaseDate", + "plan", + "purchaseSettings", + "shippingAddress", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "[Subscription](https://help.vtex.com/en/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453) ID." + }, + "customerId": { + "type": "string", + "description": "Customer ID." + }, + "customerEmail": { + "type": "string", + "description": "Customer email." + }, + "title": { + "type": "string", + "description": "Subscription title.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Subscription status.", + "enum": [ + "ACTIVE", + "PAUSED", + "CANCELED", + "EXPIRED", + "MISSING" + ] + }, + "isSkipped": { + "type": "boolean", + "description": "Defines if the customer asked to skip the next subscription order (`true`), or not (`false`)." + }, + "nextPurchaseDate": { + "type": "string", + "description": "Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "lastPurchaseDate": { + "type": "string", + "description": "Last purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "plan": { + "$ref": "#/components/schemas/PlanResponse" + }, + "shippingAddress": { + "type": "object", + "description": "Information about the subscription shipping address.", + "required": [ + "addressId", + "addressType" + ], + "properties": { + "addressId": { + "type": "string", + "description": "Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type." + }, + "addressType": { + "type": "string", + "description": "Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.", + "enum": [ + "residential", + "pickup" + ] + } + } + }, + "purchaseSettings": { + "type": "object", + "description": "Object with purchase information.", + "required": [ + "currencyCode", + "paymentMethod" + ], + "properties": { + "paymentMethod": { + "type": "object", + "description": "[Payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.", + "required": [ + "paymentSystem" + ], + "properties": { + "paymentAccountId": { + "type": "string", + "description": "Payment account ID.", + "nullable": true + }, + "paymentSystem": { + "type": "string", + "description": "Payment system ID." + }, + "installments": { + "type": "integer", + "description": "Number of installments." + }, + "paymentSystemName": { + "type": "string", + "description": "Payment system name." + }, + "paymentSystemGroup": { + "type": "string", + "description": "Payment system group." + } + } + }, + "currencyCode": { + "type": "string", + "description": "Currency code in [ISO 4217](https://www.iban.com/currency-codes) format." + }, + "selectedSla": { + "type": "string", + "description": "Selected Service Level Agreement (SLA)." + }, + "salesChannel": { + "type": "string", + "description": "Sales channel ([trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) associated with the purchase." + }, + "seller": { + "type": "string", + "description": "Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1." + } + } + }, + "cycleCount": { + "type": "integer", + "description": "The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on." + }, + "createdAt": { + "type": "string", + "description": "Subscription creation date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "lastUpdate": { + "type": "string", + "description": "Date and time of the last subscription update in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "items": { + "type": "array", + "description": "Information about subscription items.", + "items": { + "type": "object", + "description": "Information about a given subscription item.", + "required": [ + "id", + "isSkipped", + "quantity", + "skuId", + "status" + ], + "properties": { + "id": { + "type": "string", + "description": "Subscription item ID." + }, + "skuId": { + "type": "string", + "description": "SKU ID." + }, + "quantity": { + "type": "integer", + "description": "Quantity of units." + }, + "isSkipped": { + "type": "boolean", + "description": "Defines if the customer asked to skip the item in the next subscription order (`true`), or not (`false`)." + }, + "status": { + "type": "string", + "description": "Subscription status.", + "enum": [ + "ACTIVE", + "PAUSED", + "CANCELED", + "EXPIRED", + "MISSING" + ] + }, + "originalOrderId": { + "type": "string", + "description": "Subscription original order ID." + }, + "cycleCount": { + "type": "integer", + "description": "The cycle determines the position of an order counting from when the customer subscribed. The original order that creates the subscription corresponds to cycle count `0`, the first subscription order corresponds to `1`, the second corresponds to `2`, and so on." + }, + "priceAtSubscriptionDate": { + "type": "number", + "description": "Price at subscription date." + }, + "manualPrice": { + "type": "number", + "description": "[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf)." + }, + "attachments": { + "type": "array", + "description": "Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).", + "nullable": true, + "items": { + "type": "object", + "description": "Information about a given attachment.", + "properties": { + "name": { + "type": "string", + "description": "Attachment name.", + "nullable": true + }, + "content": { + "type": "object", + "description": "Custom field for attachment content.", + "nullable": true, + "additionalProperties": { + "type": "string", + "description": "Custom field information." + } + } + } + } + } + } + } + }, + "lastCycleId": { + "type": "string", + "description": "Last subscription cycle ID.", + "nullable": true + }, + "customData": { + "type": "object", + "description": "Customizable fields created by the store for the shopping cart. 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.", + "nullable": true, + "properties": { + "customApps": { + "type": "array", + "description": "Customizable apps created by the store.", + "nullable": true, + "items": { + "type": "string", + "description": "Customizable apps details.", + "nullable": true + } + } + } + } + } + }, + "PlanRequest": { + "type": "object", + "description": "[Subscription plan](https://help.vtex.com/en/tutorial/subscription-plans-beta--5kczKRqHEsrs1tYtRcY8wR) object.", + "required": [ + "id", + "frequency" + ], + "properties": { + "id": { + "type": "string", + "description": "Subscription plan ID.", + "example": "subscription.clothes" + }, + "frequency": { + "required": [ + "interval", + "periodicity" + ], + "type": "object", + "description": "Subscription plan frequency.", + "properties": { + "periodicity": { + "type": "string", + "description": "Plan repurchase frequency, defines the subscription recurrence.", + "enum": [ + "DAILY", + "WEEKLY", + "MONTHLY", + "YEARLY" + ], + "example": "MONTHLY" + }, + "interval": { + "type": "integer", + "description": "Time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the value will be measured in days, for `MONTHLY` it will be measured in months, and so on.", + "example": 3 + } + } + }, + "validity": { + "type": "object", + "description": "Information about the period during which the subscription plan will be valid.", + "properties": { + "begin": { + "type": "string", + "description": "Subscription plan beginning date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "example": "2024-08-21T00:00:00Z", + "nullable": true + }, + "end": { + "type": "string", + "description": "Subscription plan ending date and time in [UTC time format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "example": "2025-08-21T00:00:00Z", + "nullable": true + } + } + }, + "purchaseDay": { + "type": "string", + "description": "Time reference in which subscription orders will be created. It will depend on the cycle periodicity, for `WEEKLY` subscriptions, for example, the purchase day could be `Sunday`. For `MONTHLY`, would be `7`, as in the 7th day of the month. This field is not required for `DAILY` subscriptions.", + "nullable": true, + "example": "3" + } + } + }, + "ShippingAddressRequest": { + "type": "object", + "description": "Information about the subscription shipping address.", + "required": [ + "addressId", + "addressType" + ], + "properties": { + "addressId": { + "type": "string", + "description": "Shipping address ID or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, according to the shipping address type.", + "example": "5028945524109" + }, + "addressType": { + "type": "string", + "description": "Type of the address. The possible values are `residential`, when the customer gives an address for delivery, or `pickup`, when the customer picks the order at a pickup point.", + "enum": [ + "residential", + "pickup" + ], + "example": "residential" + } + } + }, + "PurchaseSettingsRequest": { + "type": "object", + "description": "Object with purchase settings information.", + "required": [ + "paymentMethod", + "salesChannel" + ], + "properties": { + "paymentMethod": { + "type": "object", + "description": "Object with [payment method](https://help.vtex.com/en/tutorial/difference-between-payment-methods-and-payment-conditions--3azJenhGFyUy2gsocms42Q) information.", + "required": [ + "paymentSystem", + "paymentAccountId" + ], + "properties": { + "paymentAccountId": { + "type": "string", + "description": "ID of the payment account. You can find the ID using the endpoint [Get client profile by email](https://developers.vtex.com/docs/api-reference/checkout-api#get-/api/checkout/pub/profiles), in `availableAccounts.[].accountId`.", + "example": "6559E125DB084A46994E045547DE504B" + }, + "paymentSystem": { + "type": "string", + "description": "Payment system ID.", + "example": "4" + }, + "installments": { + "type": "integer", + "description": "Number of installments.", + "nullable": true, + "example": 3 + }, + "paymentSystemName": { + "type": "string", + "description": "Payment system name.", + "nullable": true, + "example": "creditCard" + }, + "paymentSystemGroup": { + "type": "string", + "description": "Payment system group.", + "nullable": true, + "example": "creditCard" + } + } + }, + "currencyCode": { + "type": "string", + "description": "Currency code in [ISO 4217](https://www.iban.com/currency-codes) format.", + "example": "BRL" + }, + "selectedSla": { + "type": "string", + "description": "Selected Service Level Agreement (SLA).", + "example": "Normal" + }, + "salesChannel": { + "type": "string", + "description": "Sales channel (or [trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) applied to the subscription. You can associate only one sales channel to each subscription. The default value is the main sales channel, which corresponds to `1`.", + "example": "1" + }, + "seller": { + "type": "string", + "description": "Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1.", + "example": "1" + } + } + }, + "SubscriptionGroupRequest": { + "type": "object", + "description": "Object with subscription information.", + "required": [ + "customerEmail", + "items", + "plan", + "purchaseSettings", + "shippingAddress" + ], + "properties": { + "customerEmail": { + "type": "string", + "description": "Customer email.", + "example": "customer@email.com" + }, + "title": { + "type": "string", + "description": "Subscription title.", + "example": "fashionBasic", + "nullable": true + }, + "status": { + "type": "string", + "description": "Subscription status.", + "enum": [ + "ACTIVE", + "PAUSED", + "CANCELED", + "EXPIRED", + "MISSING" + ], + "example": "ACTIVE", + "nullable": true + }, + "nextPurchaseDate": { + "type": "string", + "description": "Subscription next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "example": "2024-09-21T00:00:00Z" + }, + "catalogAttachment": { + "type": "string", + "description": "Subscription [attachment](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm) content.", + "example": "vtex.subscription.tshirt-collection", + "nullable": true + }, + "plan": { + "$ref": "#/components/schemas/PlanRequest" + }, + "shippingAddress": { + "$ref": "#/components/schemas/ShippingAddressRequest" + }, + "purchaseSettings": { + "$ref": "#/components/schemas/PurchaseSettingsRequest" + }, + "items": { + "type": "array", + "description": "List with subscription items information.", + "items": { + "type": "object", + "description": "Information about a given item.", + "required": [ + "skuId", + "quantity" + ], + "properties": { + "skuId": { + "type": "string", + "description": "SKU ID.", + "example": "12" + }, + "quantity": { + "type": "integer", + "description": "Quantity of units.", + "example": 5 + }, + "manualPrice": { + "type": "number", + "description": "[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf).", + "example": 400.0, + "nullable": true + }, + "attachments": { + "type": "array", + "description": "Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).", + "items": { + "type": "object", + "description": "Information about a given attachment.", + "required": [ + "name", + "content" + ], + "properties": { + "name": { + "type": "string", + "description": "Attachment name.", + "example": "Engraving" + }, + "content": { + "type": "object", + "description": "Custom field for attachment content.", + "additionalProperties": { + "type": "string", + "description": "Custom field information.", + "example": "Happy Birthday!" + } + } + } + } + } + } + } + } + } + }, + "PriceTag": { + "type": "object", + "description": "Information about a given price tag.", + "properties": { + "name": { + "type": "string", + "description": "Price tag name.", + "nullable": true + }, + "valueAsInt": { + "type": "integer", + "format": "int64", + "description": "Price tag value." + }, + "rawValue": { + "type": "number", + "format": "double", + "description": "Price tag raw value." + }, + "isPercentual": { + "type": "boolean", + "description": "Defines if the price tag is applied as a percentage (`true`), or not (`false`)." + }, + "identifier": { + "type": "string", + "description": "Price tag identifier.", + "nullable": true + } + } + }, + "SimulateResponseVO": { + "type": "object", + "description": "Subscription order simulation response.", + "properties": { + "simulation": { + "type": "object", + "description": "Object with subscription order simulation details.", + "properties": { + "items": { + "type": "array", + "description": "Simulation items information.", + "items": { + "type": "object", + "description": "Simulation information about a given item.", + "properties": { + "id": { + "type": "string", + "description": "SKU ID.", + "nullable": true + }, + "seller": { + "type": "string", + "description": "Seller name. When the store acts both as marketplace and seller, this field corresponds to `1`, because every VTEX store is its own seller 1.", + "nullable": true + }, + "quantity": { + "type": "integer", + "description": "Quantity of units." + }, + "price": { + "type": "integer", + "format": "int64", + "description": "Price in cents.", + "nullable": true + }, + "sellingPrice": { + "type": "integer", + "format": "int64", + "description": "Selling price in cents.", + "nullable": true + }, + "manualPrice": { + "type": "number", + "description": "[Manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf).", + "nullable": true + }, + "unitMultiplier": { + "type": "number", + "description": "Item unit multiplier." + }, + "measurementUnit": { + "type": "string", + "description": "Item measurement unit." + }, + "attachments": { + "type": "array", + "description": "Information about subscription [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).", + "nullable": true, + "items": { + "type": "object", + "description": "Information about a given attachment.", + "properties": { + "name": { + "type": "string", + "description": "Attachment name.", + "nullable": true + }, + "content": { + "type": "object", + "description": "Custom field for attachment content.", + "nullable": true, + "additionalProperties": { + "type": "string", + "description": "Custom field information." + } + } + } + } + }, + "name": { + "type": "string", + "description": "Item name.", + "nullable": true + }, + "isGift": { + "type": "boolean", + "description": "Defines it the item is a gift (`true`), or not (`false`)." + }, + "priceTags": { + "type": "array", + "description": "List of price tags, which are price modifiers.", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PriceTag" + } + } + } + } + }, + "logisticsInfo": { + "type": "array", + "description": "Simulation logistics information.", + "items": { + "type": "object", + "description": "Logistics details.", + "properties": { + "itemIndex": { + "type": "integer", + "description": "Each item in the subscription order is identified by an index. The position starts at `0`, followed by `1`, `2`, and so on." + }, + "quantity": { + "type": "integer", + "description": "Quantity of units." + }, + "selectedSla": { + "type": "string", + "description": "Selected Service Level Agreement (SLA).", + "nullable": true + }, + "selectedDeliveryChannel": { + "type": "string", + "description": "Shipping type (shipping method) selected by the customer, like delivery or [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R).", + "enum": [ + "delivery", + "pickup-in-point" + ], + "nullable": true + }, + "lockTTL": { + "type": "string", + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA in days. One business day corresponds to `1bd`, for example.", + "nullable": true + }, + "shippingEstimate": { + "type": "string", + "description": "Shipping estimate time in days. Three business days correspond to `3bd`, for example.", + "nullable": true + }, + "addressId": { + "type": "string", + "description": "Shipping address ID.", + "nullable": true + }, + "pickupId": { + "type": "string", + "description": "[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID, when shipping type is pickup.", + "nullable": true + }, + "price": { + "type": "integer", + "description": "Shipping cost.", + "nullable": true + }, + "deliveryWindow": { + "type": "string", + "description": "[Scheduled delivery window](https://help.vtex.com/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi) period.", + "nullable": true + }, + "slas": { + "type": "array", + "description": "Service Level Agreement (SLA) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140) considered for the simulation.", + "items": { + "type": "object", + "description": "Subscription order SLA details.", + "properties": { + "id": { + "type": "string", + "description": "ID of the shipping type (shipping method) of the shipping policy.", + "nullable": true + }, + "pickupPointId": { + "type": "string", + "description": "[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID related to the SLA.", + "nullable": true + }, + "deliveryChannel": { + "type": "string", + "description": "Defines if the delivery channel is `delivery` or `pickup-in-point`.", + "enum": [ + "delivery", + "pickup-in-point" + ], + "nullable": true + }, + "price": { + "type": "integer", + "description": "Item shipping price in cents. This value does not account for the order total shipping price." + }, + "shippingEstimate": { + "type": "string", + "description": "Total shipping estimate time in days. For instance, three business days is represented as `3bd`.", + "nullable": true + }, + "lockTTL": { + "type": "string", + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time of the SLA. One business day is represented as `1bd`, for example.", + "nullable": true + }, + "deliveryWindows": { + "type": "array", + "description": "[Delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.", + "nullable": true, + "items": { + "type": "object", + "description": "Information about a given delivery window.", + "properties": { + "startDateUtc": { + "type": "string", + "description": "Delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "endDateUtc": { + "type": "string", + "description": "Delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "price": { + "type": "integer", + "format": "int64", + "description": "Delivery window shipping price.", + "nullable": true + } + } + } + }, + "availableDeliveryWindows": { + "type": "array", + "description": "Available [delivery windows](https://help.vtex.com/en/tutorial/scheduled-delivery--22g3HAVCGLFiU7xugShOBi#delivery-window) information.", + "nullable": true, + "items": { + "type": "object", + "description": "Information about an available delivery window.", + "properties": { + "startDateUtc": { + "type": "string", + "description": "Available delivery window starting date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "endDateUtc": { + "type": "string", + "description": "Available delivery window ending date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`.", + "nullable": true + }, + "price": { + "type": "integer", + "format": "int64", + "description": "Delivery window shipping price.", + "nullable": true + } + } + } + } + } + } + } + } + } + }, + "paymentData": { + "type": "object", + "description": "Simulation payment information.", + "nullable": true, + "properties": { + "payments": { + "type": "array", + "description": "Payment information.", + "nullable": true, + "items": { + "type": "object", + "description": "Payment details.", + "nullable": true, + "properties": { + "id": { + "type": "string", + "description": "Payment ID unique identifier in VTEX.", + "nullable": true + }, + "paymentSystem": { + "type": "string", + "description": "Payment system ID.", + "nullable": true + }, + "group": { + "type": "string", + "description": "Payment system group.", + "nullable": true + }, + "bin": { + "type": "string", + "description": "Abbreviation for _Bank Identification Number_, which is a code that identifies the institution responsible for issuing the credit card.", + "nullable": true + }, + "accountId": { + "type": "string", + "description": "Store account ID.", + "nullable": true + }, + "parentAccountId": { + "type": "string", + "description": "Retrieves the main account ID if the payment was made in a subaccount.", + "nullable": true + }, + "referenceValue": { + "type": "integer", + "format": "int64", + "description": "Payment reference value in cents.", + "nullable": true + }, + "value": { + "type": "integer", + "format": "int64", + "description": "Payment value in cents.", + "nullable": true + }, + "installments": { + "type": "integer", + "description": "Number of installments.", + "nullable": true + }, + "url": { + "type": "string", + "description": "Payment URL.", + "nullable": true + }, + "cardNumber": { + "type": "string", + "description": "Card number information.", + "nullable": true + }, + "fields": { + "type": "array", + "description": "Payment parameters names and values.", + "nullable": true, + "items": { + "type": "object", + "description": "Information about a given payment parameter.", + "properties": { + "name": { + "type": "string", + "description": "Payment parameter name.", + "nullable": true + }, + "value": { + "type": "string", + "description": "Payment parameter value.", + "nullable": true + } + } + } + }, + "paymentSystemName": { + "type": "string", + "description": "Payment system name.", + "nullable": true + } + } + } + }, + "transactions": { + "type": "array", + "description": "Financial transactions information. This array returns empty in the simulation.", + "nullable": true, + "items": { + "type": "object", + "description": "Financial transactions details.", + "nullable": true, + "properties": { + "isActive": { + "type": "boolean", + "description": "Defines if the subscription order payment is active (`true`) or inactive (`false`).", + "nullable": true + } + } + } + } + } + }, + "country": { + "type": "string", + "description": "Subscription order simulation three-digit country code in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format.", + "nullable": true + }, + "postalCode": { + "type": "string", + "description": "Subscription order simulation postal code.", + "nullable": true + }, + "messages": { + "type": "array", + "description": "Simulation messages information.", + "nullable": true, + "items": { + "type": "object", + "description": "Simulation message details.", + "nullable": true, + "properties": { + "code": { + "type": "string", + "description": "Message code.", + "nullable": true + }, + "status": { + "type": "string", + "description": "Message status.", + "nullable": true + }, + "text": { + "type": "string", + "description": "Message text.", + "nullable": true + } + } + } + }, + "selectableGifts": { + "type": "array", + "description": "Information about subscription selectable gifts. For example, when the customer gains a gift from the store based on a promotion.", + "nullable": true, + "items": { + "type": "object", + "description": "Selectable gift information.", + "properties": { + "id": { + "type": "string", + "description": "Selectable gift ID.", + "nullable": true + }, + "availableQuantity": { + "type": "integer", + "description": "Available quantity of selectable gifts.", + "nullable": true + }, + "availableGifts": { + "type": "array", + "description": "Details about available gifts.", + "nullable": true, + "items": { + "type": "object", + "description": "Information about a given available gift.", + "nullable": true, + "properties": { + "id": { + "type": "string", + "description": "Gift ID.", + "nullable": true + }, + "seller": { + "type": "string", + "description": "Seller name.", + "nullable": true + }, + "quantity": { + "type": "integer", + "description": "Quantity of units.", + "nullable": true + }, + "price": { + "type": "integer", + "format": "int64", + "description": "Price in cents.", + "nullable": true + }, + "sellingPrice": { + "type": "integer", + "format": "int64", + "description": "Selling price in cents.", + "nullable": true + }, + "unitMultiplier": { + "type": "number", + "description": "Unit multiplier.", + "nullable": true + }, + "attachments": { + "type": "array", + "description": "Available gift attachments information, when applicable.", + "nullable": true, + "items": { + "type": "object", + "description": "Information about a given attachment.", + "nullable": true, + "properties": { + "name": { + "type": "string", + "description": "Gift attachment name.", + "nullable": true + }, + "content": { + "type": "object", + "description": "Custom field for the gift attachment content.", + "nullable": true, + "additionalProperties": { + "type": "string", + "description": "Custom field information.", + "nullable": true + } + } + } + } + }, + "name": { + "type": "string", + "description": "Gift name.", + "nullable": true + }, + "isGift": { + "type": "boolean", + "description": "Defines it the item is from a gift list (`true`), or not (`false`).", + "nullable": true + }, + "priceTags": { + "type": "array", + "description": "List of price tags, which are price modifiers.", + "nullable": true, + "items": { + "$ref": "#/components/schemas/PriceTag" + } + }, + "isSelected": { + "type": "boolean", + "description": "Defines if the item can be selected (`true`), or not (`false`).", + "nullable": true + } + } + } + } + } + } + }, + "totals": { + "type": "array", + "description": "Information about simulation total counts.", + "items": { + "type": "object", + "description": "Details about a given total count.", + "properties": { + "id": { + "type": "string", + "description": "Code that identifies if the information is about items, discounts, shipping or taxes.", + "enum": [ + "Items", + "Discounts", + "Shipping", + "Tax" + ] + }, + "name": { + "type": "string", + "description": "Total count name." + }, + "valueAsInt": { + "type": "integer", + "format": "int64", + "description": "Total count value in cents." + } + } + } + }, + "totalsBySimulationItems": { + "type": "array", + "description": "Information about simulation totals regarding items.", + "items": { + "$ref": "#/components/schemas/SimulationItemResult" + } + } + } + }, + "shippingEstimate": { + "type": "object", + "description": "Subscription order shipping estimate information.", + "properties": { + "name": { + "type": "string", + "description": "ID of the shipping type (shipping method) of the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)." + }, + "estimate": { + "type": "string", + "description": "Total shipping estimate time in days. Three business days is represented as `3bd`, for example." + }, + "estimateDeliveryDate": { + "type": "string", + "description": "Estimate delivery date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "nextPurchaseDate": { + "type": "string", + "description": "Next purchase date and time in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ssZ`." + }, + "matched": { + "type": "boolean", + "description": "Defines if the shipping estimate is matched (`true`), or not (`false`)." + } + } + }, + "totalsBySimulationItems": { + "type": "array", + "description": "Information about simulation totals regarding items.", + "items": { + "$ref": "#/components/schemas/SimulationItemResult" + } + }, + "totals": { + "type": "array", + "description": "Information about total counts.", + "items": { + "type": "object", + "description": "Total cost per shipping or items.", + "properties": { + "id": { + "type": "string", + "description": "Code that identifies if the information is about items, discounts, shipping or taxes.", + "enum": [ + "Items", + "Discounts", + "Shipping", + "Tax" + ] + }, + "value": { + "type": "number", + "description": "Total count value." + } + } + } + } + } + }, + "Settings": { + "description": "VTEX account subscriptions settings.", + "type": "object", + "required": [ + "slaOption", + "defaultSla", + "isUsingV3", + "onMigrationProcess", + "executionHourInUtc", + "workflowVersion", + "deliveryChannels", + "randomIdGeneration", + "isMultipleInstallmentsEnabledOnCreation", + "isMultipleInstallmentsEnabledOnUpdate", + "orderCustomDataAppId", + "postponeExpiration", + "manualPriceAllowed", + "useItemPriceFromOriginalOrder" + ], + "properties": { + "slaOption": { + "description": "Service Level Agreement (SLA) option, which is the shipping method. The possible values are:\r\n- `NONE`: The platform automatically chooses the smallest cost for shipping method at the time of the subscription cycle generation.\r\n- `CHEAPEST`: Smallest cost for shipping method at the time of cycle generation.\r\n- `CUSTOMER_CHOICE`: The customer can select the desired shipping method at checkout for every new subscription order.\r\n- `STORE_CHOICE`: The store sets the preferred shipping method. This is configured in the `defaultSla` field.", + "type": "string", + "enum": [ + "NONE", + "CHEAPEST", + "CUSTOMER_CHOICE", + "STORE_CHOICE" + ] + }, + "defaultSla": { + "description": "This field contains the shipping method set by the store for new cycle generation. The only case when its value is not `null` is when the `slaOption` field is set as `STORE_CHOICE`.", + "type": "string", + "nullable": true + }, + "isUsingV3": { + "description": "Indicates if the store uses the updated Subscriptions V3 (`true`) or a previous version (`false`).", + "type": "boolean" + }, + "onMigrationProcess": { + "description": "Indicates if the store is in the process of migrating to Subscriptions V3 (`true`) or not (`false`).", + "type": "boolean" + }, + "executionHourInUtc": { + "description": "Indicates the time future subscription orders will be generated.", + "type": "integer" + }, + "workflowVersion": { + "description": "Workflow version.", + "type": "string" + }, + "deliveryChannels": { + "description": "Array containing delivery channels.", + "type": "array", + "items": { + "description": "Type of delivery channel. The values that are possible are: `pickupInPoint` for [pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) and `delivery` for regular delivery.", + "type": "string", + "enum": [ + "delivery", + "pickupInPoint" + ] + } + }, + "randomIdGeneration": { + "description": "Defines if subscription order IDs are randomly generated (`true`) or not (`false`).", + "type": "boolean" + }, + "isMultipleInstallmentsEnabledOnCreation": { + "description": "Defines if the store allows multiple installments when a subscription is created (`true`) or not (`false`).", + "type": "boolean" + }, + "isMultipleInstallmentsEnabledOnUpdate": { + "description": "Defines if the store allows multiple installments when the subscription is updated (`true`) or not (`false`).", + "type": "boolean" + }, + "attachmentPreferences": { + "type": "object", + "description": "Store settings on how to process original orders with SKUs that contain [attachments](https://help.vtex.com/en/tutorial/what-is-an-attachment--aGICk0RVbqKg6GYmQcWUm).", + "properties": { + "enableAttachments": { + "type": "boolean", + "description": "Defines if the store [keeps attachments from original orders](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) and subscription orders incorporate them (`true`) or if these attachments are disconsidered (`false`). By default, this field is set as `false`." + }, + "splitSameSkuWithDifferentAttachments": { + "type": "boolean", + "description": "Defines if the [same SKUs that contain different attachments](https://developers.vtex.com/docs/guides/how-to-keep-attachments-from-original-orders-in-subscriptions) in the original order are split (`true`) or not (`false`). By default, this field is set as `false`. It can only be set as `true` if the `enableAttachments` field is also set as `true`." + } + } + }, + "orderCustomDataAppId": { + "description": "When there are custom fields configured, this field passes along the `customData` information in the original order to the next subscriptions orders.", + "type": "string", + "nullable": true + }, + "postponeExpiration": { + "description": "Defines if the expiration of subscriptions can be postponed (`true`) or not (`false`).", + "type": "boolean" + }, + "manualPriceAllowed": { + "description": "Defines if the [manual price](https://help.vtex.com/en/tutorial/change-the-price-of-an-item-in-the-shopping-cart--7Cd37aCAmtL1qmoZJJvjNf) configuration is enabled for subscriptions items (`true`), or not (`false`). This is valid for all existing subscriptions, provided that there is a manual price configured and that the `isUsingV3` field is set as `true`.", + "type": "boolean" + }, + "useItemPriceFromOriginalOrder": { + "description": "When set to `true`, this property enables using the manual price for each item from the original subscription order. This is only valid for new subscriptions created from the moment this configuration is enabled. For this to work, it is mandatory that the `manualPriceAllowed` and `isUsingV3` properties are set to `true`.", + "type": "boolean" + } + } + } + } + }, + "tags": [ + { + "name": "Cycles" + }, + { + "name": "Plans" + }, + { + "name": "Reports" + }, + { + "name": "Subscriptions" + }, + { + "name": "Settings" + } + ] +} diff --git a/vtex/utils/openapi/vcs.openapi.gen.ts b/vtex/utils/openapi/vcs.openapi.gen.ts index 30609b734..13fa286aa 100644 --- a/vtex/utils/openapi/vcs.openapi.gen.ts +++ b/vtex/utils/openapi/vcs.openapi.gen.ts @@ -1,20228 +1,23659 @@ + +// deno-fmt-ignore-file // deno-lint-ignore-file no-explicit-any ban-types ban-unused-ignore // // DO NOT EDIT. This file is generated by deco. // This file SHOULD be checked into source version control. // To generate this file: deno task start -// +// + export type SkuComplement = { - /** - * SKU Complement’s unique numerical identifier. - */ - Id?: number; - /** - * ID of the SKU which will be inserted as a Complement in the Parent SKU. - */ - SkuId?: number; - /** - * ID of the Parent SKU, where the Complement will be inserted. - */ - ParentSkuId?: number; - /** - * Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together. - */ - ComplementTypeId?: number; -}[]; +/** + * SKU Complement’s unique numerical identifier. + */ +Id?: number +/** + * ID of the SKU which will be inserted as a Complement in the Parent SKU. + */ +SkuId?: number +/** + * ID of the Parent SKU, where the Complement will be inserted. + */ +ParentSkuId?: number +/** + * Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together. + */ +ComplementTypeId?: number +}[] /** * Array of objects. */ export type CategorySpecification = { - /** - * Specification name. Limited to 100 characters. - */ - Name?: string; - /** - * Category ID. - */ - CategoryId?: number; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Defines if the specification is active. - */ - IsActive?: boolean; - /** - * Defines if it is an SKU specification. - */ - IsStockKeepingUnit?: boolean; -}[]; +/** + * Specification name. Limited to 100 characters. + */ +Name?: string +/** + * Category ID. + */ +CategoryId?: number +/** + * Specification field ID. + */ +FieldId?: number +/** + * Defines if the specification is active. + */ +IsActive?: boolean +/** + * Defines if it is an SKU specification. + */ +IsStockKeepingUnit?: boolean +}[] /** * ID of the `orderForm` corresponding to the cart from which to place the order. This is the same as the `orderFormId` parameter. */ -export type ReferenceId = string; +export type ReferenceId = string /** * `true` if the shopper's data provided during checkout should be saved for future reference. */ -export type SavePersonalData = boolean; +export type SavePersonalData = boolean /** * True if the shopper opted to receive the newsletter. */ -export type OptinNewsLetter = boolean; +export type OptinNewsLetter = boolean export interface OpenAPI { - /** - * 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; - }; - }; - }; - /** - * 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. - */ - 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; - }; - 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's recommended that you don't 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; - }; - }; - /** - * Retrieves a specific product's general information as name, description and the trade policies that it is included. - */ - "GET /api/catalog_system/pvt/products/productget/:productId": { - response: { - /** - * Product ID. - */ - Id?: number; - /** - * Product's name. Limited to 150 characters. - */ - Name?: string; - /** - * Product department ID. - */ - DepartmentId?: number; - /** - * Product category ID. - */ - CategoryId?: number; - /** - * Product brand ID. - */ - BrandId?: number; - /** - * Product text link. - */ - LinkId?: string; - /** - * Product referecial code. - */ - RefId?: string; - /** - * If the Product is visible on the store. - */ - IsVisible?: boolean; - /** - * Product description. - */ - Description?: string; - /** - * Product complement name. - */ - DescriptionShort?: string; - /** - * Product release date. - */ - ReleaseDate?: string; - /** - * Substitutes words for the product. - */ - 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; - /** - * If the product is active (`true`) or not (`false`) at the store. - */ - IsActive?: boolean; - /** - * Product fiscal code. - */ - TaxCode?: string; - /** - * Product meta tag description. - */ - MetaTagDescription?: string; - /** - * Product supplier ID. - */ - SupplierId?: number; - /** - * Defines if the Product will remain being shown in the store even if it’s out of stock. - */ - ShowWithoutStock?: boolean; - /** - * List with the Trade Policies IDs that the product is included. - */ - ListStoreId?: number[]; - /** - * @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; - }; - }; - /** - * Retrieves a specific product by its Reference ID. - */ - "GET /api/catalog_system/pvt/products/productgetbyrefid/:refId": { - response: { - /** - * ID of the Product. - */ - Id?: number; - /** - * Name of the Product. - */ - Name?: string; - /** - * ID of product department. - */ - DepartmentId?: number; - /** - * ID of product Category. - */ - CategoryId?: number; - /** - * ID of the product Brand. - */ - BrandId?: number; - /** - * Category URL. - */ - LinkId?: string; - /** - * Product Reference ID. - */ - RefId?: string; - /** - * If the product are visible in search and list pages. - */ - IsVisible?: boolean; - /** - * Product Description, HTML is allowed. - */ - Description?: string; - /** - * Product Short Description. - */ - DescriptionShort?: string; - /** - * Product Release Date, for list ordering and product cluster highlight. - */ - ReleaseDate?: string; - /** - * Alternatives Keywords to improve the product findability. - */ - 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; - /** - * If the product is Active. - */ - IsActive?: boolean; - /** - * SKU Tax Code. - */ - TaxCode?: string; - /** - * Meta Description for the Product page. - */ - MetaTagDescription?: string; - /** - * Product Supplier ID. - */ - SupplierId?: number; - /** - * If the product can be visible without stock. - */ - ShowWithoutStock?: boolean; - /** - * Array with the ID of all the trade policies that are related to the product. - */ - ListStoreId?: number[]; - /** - * @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; - }; - }; - /** - * 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": { - /** - * Response body. - */ - response: { - /** - * Product’s unique numerical identifier. - */ - productId?: number; - /** - * Product name. - */ - name?: string; - /** - * Trade policy ID. - */ - salesChannel?: string; - /** - * Defines if the product is available (`true`) or not (`false`). - */ - available?: boolean; - /** - * Defines the mannner SKUs are displayed. - */ - displayMode?: string; - /** - * Lists SKU specifications. - */ - dimensions?: string[]; - /** - * Lists SKU specifications and their field type, in the following format: `"{specificationName}":"{fieldType}"`. - */ - dimensionsInputType?: { - [k: string]: string; - }; - /** - * Lists SKU specifications and their possible values inside arrays. - */ - dimensionsMap?: { - [k: string]: any[]; - }; - /** - * Array containing information about the product's SKUs. - */ - skus?: { - /** - * SKU ID. - */ - sku?: number; - /** - * SKU Name. - */ - skuname?: string; - /** - * Lists SKU specifications and their respective values. - */ - dimensions?: { - [k: string]: string; - }; - /** - * Defines if the SKU is available (`true`) or not (`false`). - */ - available?: boolean; - /** - * Available quantity of the SKU in stock. - */ - availablequantity?: number; - /** - * Cache version used to call Checkout. - */ - cacheVersionUsedToCallCheckout?: null | string; - /** - * List price formatted according to the valid currency. - */ - listPriceFormated?: string; - /** - * List price. - */ - listPrice?: number; - /** - * Tax value formatted according to the valid currency. - */ - taxFormated?: string; - /** - * Tax value. - */ - taxAsInt?: number; - /** - * Best price formatted according to the valid currency. - */ - bestPriceFormated?: string; - /** - * Best price. - */ - bestPrice?: number; - /** - * Spot price. - */ - spotPrice?: number; - /** - * Number of installments. - */ - installments?: number; - /** - * Value of installments. - */ - installmentsValue?: number; - /** - * Interest rate of installments. - */ - installmentsInsterestRate?: null | number; - /** - * SKU image URL. - */ - image?: string; - /** - * Seller ID. - */ - sellerId?: string; - /** - * SKU measures. - */ - measures?: { - /** - * Cubic weight. - */ - cubicweight?: number; - /** - * Height. - */ - height?: number; - /** - * Length. - */ - length?: number; - /** - * Weight. - */ - weight?: number; - /** - * Width. - */ - width?: number; - }; - /** - * SKU Unit Multiplier. - */ - unitMultiplier?: number; - /** - * SKU reward value for rewards program. - */ - rewardValue?: number; - }[]; - }; - }; - /** - * Retrieves the review rate of a product by this product's ID. - */ - "GET /api/addon/pvt/review/GetProductRate/:productId": { - /** - * Review rate numeber. - */ - 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 - * > - * > 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": { - body: { - /** - * Product’s unique numerical identifier. If not informed, it will be automatically generated by VTEX. - */ - Id?: number; - /** - * Product's name. Limited to 150 characters. - */ - Name: string; - /** - * Path of categories associated with this product, from the highest level of category to the lowest level, separated by `/`. It is mandatory to use either this field or the `CategoryId` field. - */ - CategoryPath?: string; - /** - * ID of an existing Category that will be associated with this product. It is mandatory to use either this field or the `CategoryPath` field. - */ - CategoryId?: number; - /** - * Name of the brand that will be associated with this product. It is mandatory to use either this field or the `BrandId` field. If you wish to create a new brand, that is, in case the brand does not exist yet, use this field instead of `BrandId`. - */ - BrandName?: string; - /** - * ID of an existing Brand that will be associated with this product. It is mandatory to use either this field or the `BrandName` field. - */ - 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; - }; - 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's recommended that you don't 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; - }; - }; - /** - * 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" - * } - * ] - * ``` - */ - "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" - * } - * ] - * ``` - */ - "GET /api/catalog/pvt/product/:productId/specification": { - response: { - /** - * ID of the association of the specification and the product. This ID is used to update or delete the specification. - */ - Id?: number; - /** - * Product ID. - */ - ProductId?: number; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Current specification value ID. - */ - FieldValueId?: number; - /** - * Current specification value text. - */ - 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" - * } - * ``` - */ - "POST /api/catalog/pvt/product/:productId/specification": { - body: { - /** - * Specification field ID. - */ - FieldId: number; - /** - * Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types - */ - FieldValueId?: number; - /** - * Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`. - */ - Text?: string; - }; - response: { - /** - * ID of the association of the specification and the product. This ID is used to update or delete the specification. - */ - Id?: number; - /** - * Product ID. - */ - ProductId?: number; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types - */ - FieldValueId?: number; - /** - * Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`. - */ - Text?: string; - }; - }; - /** - * Deletes all Product Specifications given a specific Product ID. - */ - "DELETE /api/catalog/pvt/product/:productId/specification": {}; - /** - * Deletes a specific Product Specification given a Product ID and a Specification ID. - */ - "DELETE /api/catalog/pvt/product/:productId/specification/:specificationId": - {}; - /** - * 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": { - body: { - /** - * Specification name. Limited to 100 characters. - */ - FieldName: string; - /** - * Group name. - */ - GroupName: string; - /** - * Root level specification. - */ - RootLevelSpecification: boolean; - /** - * Array of specification values. - */ - FieldValues: string[]; - }; - /** - * Array with information of all product specifications. - */ - response: { - /** - * ID of the association of the Product and the specification. - */ - Id?: number; - /** - * Product ID. - */ - ProductId?: number; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Current specification value ID. - */ - FieldValueId?: number; - /** - * Current specification value text. - */ - 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 - * ] - * ``` - */ - "GET /api/catalog_system/pvt/sku/stockkeepingunitids": { - searchParams: { - /** - * Number of the page from where you need to retrieve SKU IDs. - */ - page: number; - /** - * Size of the page from where you need retrieve SKU IDs. The maximum value is `1000`. - */ - pagesize: number; - }; - /** - * Array composed by SKU IDs, in the search context. - */ - 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 - * } - * ``` - */ - "GET /api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId": { - searchParams: { - /** - * Trade Policy's unique identifier number. - */ - 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 - * } - * ``` - */ - "GET /api/catalog/pvt/stockkeepingunit": { - searchParams: { - /** - * SKU Reference ID. - */ - refId: string; - }; - response: { - /** - * SKU ID. - */ - Id?: number; - /** - * Product ID. - */ - ProductId?: number; - /** - * Defines if the SKU is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. - */ - ActivateIfPossible?: boolean; - /** - * SKU Name. - */ - Name?: string; - /** - * SKU RefId. - */ - RefId?: string; - /** - * Packaged Height. - */ - PackagedHeight?: number; - /** - * Packaged Length. - */ - PackagedLength?: number; - /** - * Packaged Width. - */ - PackagedWidth?: number; - /** - * Packaged Weight, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - PackagedWeightKg?: number; - /** - * SKU Height. - */ - Height?: number; - /** - * SKU Length. - */ - Length?: number; - /** - * SKU Width. - */ - Width?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * [Cubic Weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Shows if the SKU is a Kit (`true`) or not (`false`). - */ - IsKit?: boolean; - /** - * SKU Creation Date. - */ - CreationDate?: string; - /** - * Defines the value of the reward for clients who purchase the SKU. - */ - RewardValue?: number; - /** - * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: null | string; - /** - * Manufacturer Code. - */ - ManufacturerCode?: string; - /** - * Commercial Condition ID. - */ - CommercialConditionId?: number; - /** - * Measurement Unit. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: null | string; - /** - * Defines if Kit components can be sold apart. - */ - KitItensSellApart?: boolean; - /** - * Video URLs. - */ - 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/" ] - * } - * ``` - */ - "POST /api/catalog/pvt/stockkeepingunit": { - body: { - /** - * SKU unique identifier. If not informed, it will be automatically generated by VTEX. - */ - Id?: number; - /** - * ID of the Product associated with this SKU. - */ - ProductId: number; - /** - * Defines if the SKU is active (`true`) or not (`false`). During SKU creation, do not set this field as `true` or you will receive a `400 Bad Request` error. You should activate the SKU afterwards, as explained in [Activating an SKU](https://developers.vtex.com/docs/guides/skus#activating-an-sku). - */ - IsActive?: boolean; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. We recommend setting it to `true`, unless you plan to have an internal workflow to manually activate SKUs. - */ - ActivateIfPossible?: boolean; - /** - * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. Limited to 200 characters. - */ - Name: string; - /** - * Reference code used internally for organizational purposes. Must be unique. Required only if `Ean` is not informed, but can be used alongside `Ean` as well. - */ - RefId?: string; - /** - * EAN code. Required only if `RefId` is not informed, but can be used alongside `RefId` as well. - */ - Ean?: string; - /** - * Height used for shipping calculation. - */ - PackagedHeight: number; - /** - * Length used for shipping calculation. - */ - PackagedLength: number; - /** - * Width used for shipping calculation. - */ - PackagedWidth: number; - /** - * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. Do not fill in this field with `0` or `null`, because this might result in shipping issues. - */ - PackagedWeightKg: number; - /** - * SKU real height. - */ - Height?: number; - /** - * SKU real length. - */ - Length?: number; - /** - * SKU real width. - */ - Width?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. - */ - IsKit?: boolean; - /** - * Date and time of the SKU's creation. - */ - CreationDate?: string; - /** - * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. - */ - RewardValue?: number; - /** - * To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: null | string; - /** - * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. - */ - ManufacturerCode?: string; - /** - * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). - */ - CommercialConditionId?: number; - /** - * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: null | string; - /** - * Defines if Kit components can be sold apart. - */ - KitItensSellApart?: boolean; - /** - * Videos URLs - */ - Videos?: string[]; - }; - response: { - /** - * SKU unique identifier. - */ - Id?: number; - /** - * ID of the Product associated with this SKU. - */ - ProductId?: number; - /** - * Defines if the SKU is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. - */ - ActivateIfPossible?: boolean; - /** - * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. - */ - Name?: string; - /** - * Reference code used internally for organizational purposes. Must be unique. Required only if `Ean` is not informed, but can be used alongside `Ean` as well. - */ - RefId?: string; - /** - * EAN code. Required only if `RefId` is not informed, but can be used alongside `RefId` as well. - */ - Ean?: string; - /** - * Height used for shipping calculation. - */ - PackagedHeight?: number; - /** - * Length used for shipping calculation. - */ - PackagedLength?: number; - /** - * Width used for shipping calculation. - */ - PackagedWidth?: number; - /** - * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - PackagedWeightKg?: number; - /** - * SKU real height. - */ - Height?: number; - /** - * SKU real length. - */ - Length?: number; - /** - * SKU real width. - */ - Width?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. - */ - IsKit?: boolean; - /** - * Date and time of the SKU's creation. - */ - CreationDate?: string; - /** - * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. - */ - RewardValue?: number; - /** - * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: null | string; - /** - * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. - */ - ManufacturerCode?: string; - /** - * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). - */ - CommercialConditionId?: number; - /** - * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: null | string; - /** - * Defines if Kit components can be sold apart. - */ - KitItensSellApart?: boolean; - /** - * Videos URLs. - */ - Videos?: string[]; - }; - }; - /** - * Retrieves an SKU ID by the SKU's Reference ID. - * - * ### Response body example - * - * ```json - * "310118450" - * ``` - */ - "GET /api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId": { - /** - * SKU ID. - */ - 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 - * } - * ``` - */ - "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": "" - * } - * ] - * ``` - */ - "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" - * } - * ``` - */ - "POST /api/catalog_system/pub/sku/stockkeepingunitidsbyrefids": { - /** - * Array with SKU reference IDs from which you need to retrieve the related SKU IDs. Don't repeat values in the array, or the API will return an error 500. - */ - body: string[]; - /** - * Object composed by a list of SKU IDs related to each Reference ID list searched. Structure: "{RefId}": "{SkuId}". - */ - response: { - /** - * Reference ID. - */ - [k: string]: string; - }; - }; - /** - * 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": { - response: { - /** - * SKU unique identifier. - */ - Id?: number; - /** - * ID of the Product associated with this SKU. - */ - ProductId?: number; - /** - * Shows if the SKU is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. - */ - ActivateIfPossible?: boolean; - /** - * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. - */ - Name?: string; - /** - * Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided. - */ - RefId?: string; - /** - * Height used for shipping calculation. - */ - PackagedHeight?: number; - /** - * Length used for shipping calculation. - */ - PackagedLength?: number; - /** - * Width used for shipping calculation. - */ - PackagedWidth?: number; - /** - * Weight used for shipping calculation. - */ - PackagedWeightKg?: number; - /** - * SKU real height. - */ - Height?: number; - /** - * SKU real length. - */ - Length?: number; - /** - * SKU real width. - */ - Width?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. - */ - IsKit?: boolean; - /** - * Date and time of the SKU's creation. - */ - CreationDate?: string; - /** - * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. - */ - RewardValue?: number; - /** - * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: null | string; - /** - * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. - */ - ManufacturerCode?: string; - /** - * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). - */ - CommercialConditionId?: number; - /** - * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: null | string; - /** - * Defines if Kit components can be sold apart. - */ - KitItensSellApart?: boolean; - /** - * Videos URLs. - */ - 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/" ] - * } - * ``` - */ - "PUT /api/catalog/pvt/stockkeepingunit/:skuId": { - body: { - /** - * ID of the Product associated with this SKU. - */ - ProductId: number; - /** - * Shows if the SKU is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. - */ - ActivateIfPossible?: boolean; - /** - * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. - */ - Name: string; - /** - * Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided. - */ - RefId?: string; - /** - * Height used for shipping calculation. - */ - PackagedHeight: number; - /** - * Length used for shipping calculation. - */ - PackagedLength: number; - /** - * Width used for shipping calculation. - */ - PackagedWidth: number; - /** - * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. Do not fill in this field with `0` or `null`, because this might result in shipping issues. - */ - PackagedWeightKg: number; - /** - * SKU real height. - */ - Height?: number; - /** - * SKU real length. - */ - Length?: number; - /** - * SKU real width. - */ - Width?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. - */ - IsKit?: boolean; - /** - * Date and time of the SKU's creation. - */ - CreationDate?: string; - /** - * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. - */ - RewardValue?: number; - /** - * To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: null | string; - /** - * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. - */ - ManufacturerCode?: string; - /** - * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). - */ - CommercialConditionId?: number; - /** - * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: null | string; - /** - * Defines if Kit components can be sold apart. - */ - KitItensSellApart?: boolean; - /** - * Videos URLs - */ - Videos?: string[]; - }; - response: { - /** - * SKU unique identifier. - */ - Id?: number; - /** - * ID of the Product associated with this SKU. - */ - ProductId?: number; - /** - * Shows if the SKU is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. - */ - ActivateIfPossible?: boolean; - /** - * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. - */ - Name?: string; - /** - * Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided. - */ - RefId?: string; - /** - * Height used for shipping calculation. - */ - PackagedHeight?: number; - /** - * Length used for shipping calculation. - */ - PackagedLength?: number; - /** - * Width used for shipping calculation. - */ - PackagedWidth?: number; - /** - * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - PackagedWeightKg?: number; - /** - * SKU real height. - */ - Height?: number; - /** - * SKU real length. - */ - Length?: number; - /** - * SKU real width. - */ - Width?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. - */ - IsKit?: boolean; - /** - * Date and time of the SKU's creation. - */ - CreationDate?: string; - /** - * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. - */ - RewardValue?: number; - /** - * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: null | string; - /** - * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. - */ - ManufacturerCode?: string; - /** - * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). - */ - CommercialConditionId?: number; - /** - * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: null | string; - /** - * Defines if Kit components can be sold apart. - */ - KitItensSellApart?: boolean; - /** - * Videos URLs. - */ - Videos?: string[]; - }; - }; - /** - * 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 - * } - * ] - * ``` - */ - "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" - * } - * ``` - */ - "GET /api/catalog_system/pvt/sku/complements/:parentSkuId/:type": { - response: { - /** - * ID of the Parent SKU, where the Complement is inserted. - */ - ParentSkuId: number; - /** - * Array with SKU complements IDs. - */ - ComplementSkuIds: number[]; - /** - * Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together. - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/skucomplement": { - body: { - /** - * ID of the Parent SKU, where the Complement is inserted. - */ - ParentSkuId: number; - /** - * ID of the SKU which will be inserted as a Complement in the Parent SKU. - */ - SkuId: number; - /** - * Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together. - */ - 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 - * } - * ``` - */ - "GET /api/catalog/pvt/skucomplement/:skuComplementId": { - response: SkuComplement; - }; - /** - * Deletes a previously existing SKU Complement by SKU Complement ID. - */ - "DELETE /api/catalog/pvt/skucomplement/:skuComplementId": {}; - /** - * 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" - * ] - * ``` - */ - "GET /api/catalog/pvt/stockkeepingunit/:skuId/ean": { - /** - * Array with EANs associated with the SKU. - */ - response: string[]; - }; - /** - * Deletes all EAN values of an SKU. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/:skuId/ean": {}; - /** - * Creates or updates the EAN value of an SKU. - */ - "POST /api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean": {}; - /** - * Deletes the EAN value of an SKU. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean": {}; - /** - * 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": { - body: { - /** - * Attachment ID. - */ - AttachmentId: number; - /** - * Unique identifier of an SKU. - */ - SkuId: number; - }; - /** - * Object containing information about the association between the SKU and the attachment. - */ - response: { - /** - * Identifier of the SKU's association to the attachment. - */ - Id?: number; - /** - * Attachment ID. - */ - AttachmentId?: number; - /** - * Unique identifier of the SKU. - */ - SkuId?: number; - }; - }; - /** - * Dissociates attachments and SKUs based on an SKU ID or an attachment ID. - */ - "DELETE /api/catalog/pvt/skuattachment": { - searchParams: { - /** - * SKU ID. By using this query param, you can dissociate all the attachments from an SKU based on its SKU ID. - */ - skuId?: number; - /** - * Attachment ID. By using this query param, you can dissociate the given attachment from all previously associated SKUs. - */ - attachmentId?: number; - }; - }; - /** - * Retrieves existing SKU Attachments by SKU ID. - * ## Response body example - * - * ```json - * [ - * { - * "Id": 97, - * "AttachmentId": 1, - * "SkuId": 1 - * } - * ] - * ``` - */ - "GET /api/catalog/pvt/stockkeepingunit/:skuId/attachment": { - /** - * Array of objects with information about the association between the attachments and the SKU. - */ - response: { - /** - * Identifier of the SKU's association to the attachment. - */ - Id?: number; - /** - * Attachment ID. - */ - AttachmentId?: number; - /** - * Unique identifier of the SKU. - */ - SkuId?: number; - }[]; - }; - /** - * Deletes the association of an SKU to an Attachment. - */ - "DELETE /api/catalog/pvt/skuattachment/:skuAttachmentAssociationId": {}; - /** - * 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" - * ] - * } - * ``` - */ - "POST /api/catalog_system/pvt/sku/associateattachments": { - body: { - /** - * Unique identifier of the SKU. - */ - SkuId: number; - /** - * Array with all the names of the attachments that you need to associate to the SKU. - */ - 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 - * } - * ] - * ``` - */ - "GET /api/catalog/pvt/stockkeepingunit/:skuId/file": { - /** - * Array with objects containing SKU Files information. - */ - response: { - /** - * Unique identifier of the association of the Image to the SKU. - */ - Id?: number; - /** - * Unique identifier of the Image. - */ - ArchiveId?: number; - /** - * Unique identifier of the SKU. - */ - SkuId?: number; - /** - * Image name. - */ - Name?: string; - /** - * Defines if the Image is the Main Image of the SKU. - */ - IsMain?: boolean; - /** - * Image label. - */ - 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": "" - * } - * ``` - */ - "POST /api/catalog/pvt/stockkeepingunit/:skuId/file": { - body: SKUFileURL; - response: { - /** - * ID of the association of the SKU and the image (`SkuFileId`). This is the ID that is used to update or delete it. - */ - Id?: number; - /** - * Unique identifier of the image file. - */ - ArchiveId?: number; - /** - * SKU ID. - */ - SkuId?: number; - /** - * Set the image as the main image for the product. - */ - IsMain?: boolean; - /** - * Image label. - */ - Label?: string; - }; - }; - /** - * Deletes all SKU Image Files. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/:skuId/file": {}; - /** - * 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": { - body: SKUFileURL; - response: { - /** - * ID of the association of the SKU and the image (`SkuFileId`). This is the ID that is used to update or delete it. - */ - Id?: number; - /** - * Unique identifier of the image file. - */ - ArchiveId?: number; - /** - * SKU ID. - */ - SkuId?: number; - /** - * Set the image as the main image for the product. - */ - IsMain?: boolean; - /** - * Image label. - */ - Label?: string; - }; - }; - /** - * Deletes a specific SKU Image File. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId": {}; - /** - * 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/": { - /** - * Array with objects containing information about each of the target SKU's Files. - */ - response: { - /** - * Unique identifier of the association of the Image to the SKU. - */ - Id?: number; - /** - * Unique identifier of the image file. - */ - ArchiveId?: number; - /** - * Unique identifier of the SKU. - */ - SkuId?: number; - /** - * Defines if the Image is the Main Image of the SKU. - */ - IsMain?: boolean; - /** - * Image label. - */ - Label?: null | string; - }[]; - }; - /** - * Disassociates an SKU File from an SKU. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/disassociate/:skuId/file/:skuFileId": - {}; - /** - * 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": { - searchParams: { - /** - * SKU’s unique numerical identifier. - */ - skuId?: number; - /** - * Parent SKU’s unique numerical identifier. - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/stockkeepingunitkit": { - body: { - /** - * SKU ID of the SKU Kit. - */ - StockKeepingUnitParent: number; - /** - * Component SKU ID. - */ - StockKeepingUnitId: number; - /** - * Component quantity. - */ - Quantity: number; - /** - * Component price per unit. - */ - UnitPrice: number; - }; - response: SkuKit; - }; - /** - * Deletes all Kit’s components based on the Parent SKU ID or deletes a specific Kit’s component based on the SKU ID. - */ - "DELETE /api/catalog/pvt/stockkeepingunitkit": { - searchParams: { - /** - * SKU’s unique numerical identifier. - */ - skuId?: number; - /** - * Parent SKU’s unique numerical identifier. - */ - parentSkuId?: number; - }; - }; - /** - * Retrieves general information about a component of a Kit. - */ - "GET /api/catalog/pvt/stockkeepingunitkit/:kitId": { - response: SkuKit; - }; - /** - * Deletes a specific Kit’s component based on its Kit ID. - */ - "DELETE /api/catalog/pvt/stockkeepingunitkit/:kitId": {}; - /** - * > ⚠️ 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 - * } - * ``` - */ - "GET /api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId": { - response: { - /** - * Defines if the seller is persisted. - */ - IsPersisted: boolean; - /** - * Defines if the seller is removed. - */ - IsRemoved: boolean; - /** - * SKU ID in the seller's store. - */ - SkuSellerId: number; - /** - * ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. - */ - SellerId: string; - /** - * SKU ID in the VTEX marketplace. - */ - StockKeepingUnitId: number; - /** - * SKU seller ID. - */ - SellerStockKeepingUnitId: string; - /** - * Defines if the SKU binding is active. - */ - IsActive: boolean; - /** - * Date when the SKU binding was updated for the last time, in UTC format. - */ - UpdateDate: string; - /** - * Date when an SKU binding update was requested for the last time, in UTC format. - */ - 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. - * - * Remove a seller's SKU binding, given the seller ID and the SKU ID in the seller's store. - */ - "POST /api/catalog_system/pvt/skuseller/remove/:sellerId/:sellerSkuId": {}; - /** - * > ⚠️ 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 price or inventory, or that this is a new SKU that the seller would like to offer to the marketplace. - * - * There are two information expected by the marketplace in this request: the `sellerId`, which identifies the seller, and the `sellerSkuId`, which identifies the binding of the seller with the SKU. - * - * Both information are passed through the request URL. The body of the request should be empty. - */ - "POST /api/catalog_system/pvt/skuseller/changenotification/:sellerId/:sellerSkuId": - {}; - /** - * > ⚠️ 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 - * } - * ``` - */ - "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 - * } - * ``` - */ - "PUT /api/catalog/pvt/skuservice/:skuServiceId": { - body: { - /** - * SKU Service Type ID. - */ - SkuServiceTypeId: number; - /** - * SKU Service Value ID. - */ - SkuServiceValueId: number; - /** - * SKU ID. - */ - SkuId: number; - /** - * SKU Service Name. Maximum of 50 characters. - */ - Name: string; - /** - * Internal description for the SKU Service. Maximum of 100 characters. - */ - Text: string; - /** - * Defines if the SKU Service is active or not. - */ - IsActive: boolean; - }; - response: SKUService; - }; - /** - * Dissociates an SKU Service from an SKU. - */ - "DELETE /api/catalog/pvt/skuservice/:skuServiceId": {}; - /** - * Associates an SKU Service to an SKU. - */ - "POST /api/catalog/pvt/skuservice": { - body: { - /** - * SKU Service Type ID. - */ - SkuServiceTypeId: number; - /** - * SKU Service Value ID. - */ - SkuServiceValueId: number; - /** - * SKU ID. - */ - SkuId: number; - /** - * SKU Service Name. Maximum of 50 characters. - */ - Name: string; - /** - * Internal description of the SKU Service. Maximum of 100 characters. - */ - Text: string; - /** - * Defines if the SKU Service is active or not. - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/skuservicetypeattachment": { - body: { - /** - * Attachment ID. - */ - AttachmentId: number; - /** - * An explanation about the purpose of this instance. - */ - SkuServiceTypeId: number; - }; - response: { - /** - * SKU Service Type Attachment association ID. - */ - Id?: number; - /** - * Attachment ID. - */ - AttachmentId?: number; - /** - * SKU Service Type ID. - */ - SkuServiceTypeId?: number; - }; - }; - /** - * Dissociates an Attachment by its Attachment ID or SKU Service Type ID from an SKU Service Type. - */ - "DELETE /api/catalog/pvt/skuservicetypeattachment": { - searchParams: { - /** - * SKU Service Attachment unique identifier. - */ - attachmentId?: number; - /** - * SKU Service Type unique identifier. - */ - skuServiceTypeId?: number; - }; - }; - /** - * Dissociates an Attachment from an SKU Service Type - */ - "DELETE /api/catalog/pvt/skuservicetypeattachment/:skuServiceTypeAttachmentId": - {}; - /** - * 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": { - 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 - * } - * ``` - */ - "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 - * } - * ``` - */ - "PUT /api/catalog/pvt/skuservicetype/:skuServiceTypeId": { - body: SKUServiceTypeRequest; - response: SKUServiceTypeResponse; - }; - /** - * Deletes an existing SKU Service Type. - */ - "DELETE /api/catalog/pvt/skuservicetype/:skuServiceTypeId": {}; - /** - * 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": { - 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 - * } - * ``` - */ - "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 - * } - * ``` - */ - "PUT /api/catalog/pvt/skuservicevalue/:skuServiceValueId": { - body: SKUServiceValueRequest; - response: SKUServiceValueResponse; - }; - /** - * Deletes an existing SKU Service Value. - */ - "DELETE /api/catalog/pvt/skuservicevalue/:skuServiceValueId": {}; - /** - * 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" - * } - * ``` - */ - "POST /api/catalog/pvt/stockkeepingunit/:skuId/specification": { - body: { - /** - * Specification field ID. - */ - FieldId: number; - /** - * Specification Value ID. Required only for `FieldTypeId` as `5`, `6` and `7`. - */ - 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" - * } - * ``` - */ - "PUT /api/catalog/pvt/stockkeepingunit/:skuId/specification": { - body: { - /** - * Specification and SKU association unique identifier. This field cannot be updated. - */ - Id: number; - /** - * SKU unique identifier. This field cannot be updated. - */ - SkuId?: number; - /** - * Specification field unique identifier. This field cannot be updated. - */ - FieldId: number; - /** - * Specification value unique identifier. This field can only be updated with other values of the same `FieldId`. - */ - FieldValueId: number; - /** - * Specification Value Name. This field is automatically updated if the `FieldValue` is updated. Otherwise, the value cannot be modified. - */ - Text?: string; - }; - response: SKUSpecificationResponse[]; - }; - /** - * Deletes all SKU Specifications. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/:skuId/specification": {}; - /** - * Deletes a specific SKU Specification. - */ - "DELETE /api/catalog/pvt/stockkeepingunit/:skuId/specification/:specificationId": - {}; - /** - * 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": { - body: { - /** - * Specification name. Limited to 100 characters. - */ - FieldName: string; - /** - * Group name. - */ - GroupName: string; - /** - * Root level specification. - */ - RootLevelSpecification: boolean; - /** - * Array of specification values. SKU Specifications must contain only one value. - */ - FieldValues: string[]; - }; - /** - * Array with information of all SKU specifications. - */ - response: { - /** - * ID of the association of the SKU and the specification. - */ - Id?: number; - /** - * SKU ID. - */ - SkuId?: number; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Current specification value ID. - */ - FieldValueId?: number; - /** - * Current specification value text. - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit": { - body: { - /** - * Unique identifier of an SKU. - */ - SkuId: number; - }; - response: { - /** - * Subcollection’s unique numerical identifier. - */ - SubCollectionId?: number; - /** - * Unique identifier of the SKU. - */ - SkuId?: 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). - * - * Deletes an SKU from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - */ - "DELETE /api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit/:skuId": - {}; - /** - * 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 - * } - * ``` - */ - "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 - * } - * ``` - */ - "PUT /api/catalog/pvt/category/:categoryId": { - body: { - /** - * Category name. - */ - Name: string; - /** - * Substitute words for the Category. - */ - Keywords: string; - /** - * Text used in title tag for Category page. - */ - Title: string; - /** - * Text used in meta description tag for Category page. - */ - Description: string; - /** - * @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; - /** - * ID of the parent category, apply in case of category and subcategory. - */ - FatherCategoryId: null | number; - /** - * Google Global Category ID. - */ - GlobalCategoryId: number; - /** - * If true, the Category is shown in the top and side menu. - */ - ShowInStoreFront: boolean; - /** - * If true, the Category page becomes available in store. - */ - IsActive: boolean; - /** - * If true, the Category link becomes active in store. - */ - ActiveStoreFrontLink: boolean; - /** - * If true, the Category page displays a Brand filter. - */ - ShowBrandFilter: boolean; - /** - * Score for search sorting order. - */ - Score: number; - /** - * Defines how the SKU will be exhibited - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/category": { - body: CreateCategoryRequest; - response: Category; - }; - /** - * 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/": { - /** - * Array of objects with similar category information. - */ - response: { - /** - * Product ID. - */ - ProductId?: number; - /** - * Similar Category ID. - */ - CategoryId?: number; - }[]; - }; - /** - * Adds a Similar Category to a Product. - * - * ## Response body example - * - * ```json - * { - * "ProductId": 1, - * "StoreId": 1 - * } - * ``` - */ - "POST /api/catalog/pvt/product/:productId/similarcategory/:categoryId": { - /** - * Object containing information related to the similar category. - */ - response: { - /** - * Product ID. - */ - ProductId?: number; - /** - * Trade Policy ID. - */ - StoreId?: number; - }; - }; - /** - * Deletes a Similar Category from a Product. - */ - "DELETE /api/catalog/pvt/product/:productId/similarcategory/:categoryId": {}; - /** - * 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 - * } - * ] - * ``` - */ - "GET /api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId": - { - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/subcollection/:subCollectionId/category": { - body: { - /** - * Unique identifier of a Category. - */ - CategoryId: number; - }; - response: { - /** - * Subcollection’s unique numerical identifier. - */ - SubCollectionId?: number; - /** - * Unique identifier of the Category. - */ - CategoryId?: 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). - * - * Deletes a Category from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - */ - "DELETE /api/catalog/pvt/subcollection/:subCollectionId/brand/:categoryId": - {}; - /** - * 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": { - /** - * An array with all brands registered in the store. - */ - 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 - * } - * } - * ``` - */ - "GET /api/catalog_system/pvt/brand/pagedlist": { - searchParams: { - /** - * Quantity of brands per page. - */ - pageSize: number; - /** - * Page number of the brand list. - */ - page: number; - }; - response: { - /** - * Array of objects with information of the store's brands. - */ - items: BrandGet[]; - /** - * Object with pagination information. - */ - paging: { - /** - * Page number of the brand list. - */ - page: number; - /** - * Quantity of brands per page. - */ - perPage: number; - /** - * Total of brands in the store. - */ - total: number; - /** - * Total number of pages. - */ - 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 - * } - * ``` - */ - "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" - * } - * ``` - */ - "POST /api/catalog/pvt/brand": { - 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" - * } - * ``` - */ - "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" - * } - * ``` - */ - "PUT /api/catalog/pvt/brand/:brandId": { - body: BrandCreateUpdate; - response: BrandCreateUpdate; - }; - /** - * Deletes an existing Brand. - */ - "DELETE /api/catalog/pvt/brand/:brandId": {}; - /** - * >⚠️ 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 - * } - * ``` - */ - "POST /api/catalog/pvt/subcollection/:subCollectionId/brand": { - body: { - /** - * Unique identifier of a Brand. - */ - BrandId: number; - }; - response: { - /** - * Subcollection’s unique numerical identifier. - */ - SubCollectionId?: number; - /** - * Unique identifier of the Brand. - */ - BrandId?: 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). - * - * Deletes a Brand from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - */ - "DELETE /api/catalog/pvt/subcollection/:subCollectionId/brand/:brandId": {}; - /** - * 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" - * } - * ] - * } - * ``` - */ - "PUT /api/catalog/pvt/attachment/:attachmentid": { - body: AttachmentRequest; - response: AttachmentResponse; - }; - /** - * Deletes a previously existing SKU attachment. - */ - "DELETE /api/catalog/pvt/attachment/:attachmentid": {}; - /** - * 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": { - 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": "[]" - * } - * ] - * } - * ] - * } - * ``` - */ - "GET /api/catalog/pvt/attachments": { - response: { - /** - * Current page of results. - */ - Page?: number; - /** - * Total number of results in the current page. - */ - Size?: number; - /** - * Total number of rows with results. - */ - TotalRows?: number; - /** - * Total number of pages with results. - */ - TotalPage?: number; - /** - * Array containing attachments data. - */ - Data?: AttachmentResponse[]; - }; - }; - /** - * Retrieves a list of all collections matching a filter. - */ - "GET /api/catalog_system/pvt/collection/search": { - searchParams: { - /** - * Page number. - */ - page: number; - /** - * Number of the items of the page. - */ - pageSize: number; - /** - * Defines if the items of the page are in ascending order. - */ - orderByAsc: boolean; - }; - }; - /** - * Retrieves a list of Collection IDs of the inactive Collections. - */ - "GET /api/catalog/pvt/collection/inactive": {}; - /** - * Creates a new collection. - */ - "POST /api/catalog/pvt/collection/": { - body: { - /** - * Collection's Name. - */ - Name: string; - /** - * Collection's description for internal use, with the collection's details. It will not be used for search engines. - */ - Description: string; - /** - * Option making the collection searchable in the store. - */ - Searchable: boolean; - /** - * Option if you want the collection to highlight specific products using a tag. - */ - Highlight: boolean; - /** - * Collection start date and time. If a future date and time are set, the collection will have a scheduled status. - */ - DateFrom: string; - /** - * Collection end date and time. - */ - DateTo: string; - }; - }; - /** - * Retrieves a list of collections matching a filter. - */ - "GET /api/catalog_system/pvt/collection/search/:searchTerms": { - searchParams: { - /** - * Page number. - */ - page?: number; - /** - * Number of the items of the page. - */ - pageSize?: number; - /** - * Defines if the items of the page are in ascending order. - */ - orderByAsc?: boolean; - }; - }; - /** - * Imports a sample of the imported XLS file. You need to save the response file to your device. - */ - "GET /api/catalog/pvt/collection/stockkeepingunit/importfileexample": {}; - /** - * Adds products to a collection from the request body file. The file must be an imported template. - */ - "POST /api/catalog/pvt/collection/:collectionId/stockkeepingunit/importinsert": - {}; - /** - * Removes products from a collection from the request body file. The file must be an imported template. - */ - "POST /api/catalog/pvt/collection/:collectionId/stockkeepingunit/importexclude": - {}; - /** - * Retrieves information about the products from a collection. - */ - "GET /api/catalog/pvt/collection/:collectionId/products": { - searchParams: { - /** - * Page number. - */ - page?: number; - /** - * Number of the items of the page. - */ - pageSize?: number; - /** - * Filter used to refine the Collection's products. - */ - Filter?: string; - /** - * Defines if the status of the product is active or not. - */ - Active?: boolean; - /** - * Defines if the product is visible on the store or not. - */ - Visible?: boolean; - /** - * Product's Category unique identifier. - */ - CategoryId?: number; - /** - * Product's Brand unique identifier. - */ - BrandId?: number; - /** - * Product's Supplier unique identifier. - */ - SupplierId?: number; - /** - * Product's Trade Policy unique identifier. - */ - SalesChannelId?: number; - /** - * Product past release date. - */ - ReleaseFrom?: string; - /** - * Product future release date. - */ - ReleaseTo?: string; - /** - * Product Specification Field Value. You must also fill in `SpecificationFieldId` to use this parameter. - */ - SpecificationProduct?: string; - /** - * Product Specification Field unique identifier. - */ - 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" - * } - * ``` - */ - "GET /api/catalog/pvt/collection/:collectionId": { - response: { - /** - * Collection ID. - */ - Id?: number; - /** - * Collection Name. - */ - Name?: string; - /** - * Collection description. - */ - Description?: null | string; - /** - * Defines if the Collection is searchable or not. - */ - Searchable?: boolean; - /** - * Defines if the Collection is highlighted or not. - */ - Highlight?: boolean; - /** - * Initial value date for the Collection. - */ - DateFrom?: string; - /** - * Final value date for the Collection. - */ - DateTo?: string; - /** - * Total quantity of products in the collection. - */ - TotalProducts?: number; - /** - * Type of collection. - */ - 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" - * } - * ``` - */ - "PUT /api/catalog/pvt/collection/:collectionId": { - body: { - /** - * Collection Name. - */ - Name: string; - /** - * Defines if the Collection is searchable or not. - */ - Searchable: boolean; - /** - * Defines if the Collection is highlighted or not - */ - Highlight: boolean; - /** - * Initial value date for the Collection. - */ - DateFrom: string; - /** - * Final value date for the Collection. - */ - DateTo: string; - }; - response: { - /** - * Collection ID. - */ - Id?: number; - /** - * Collection Name. - */ - Name?: string; - /** - * Collection description. - */ - Description?: null | string; - /** - * Defines if the Collection is searchable or not. - */ - Searchable?: boolean; - /** - * Defines if the Collection is highlighted or not. - */ - Highlight?: boolean; - /** - * Initial value date for the Collection. - */ - DateFrom?: string; - /** - * Final value date for the Collection. - */ - DateTo?: string; - /** - * Total quantity of products in the collection. - */ - TotalProducts?: number; - /** - * Type of collection. - */ - 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). - * - * Deletes a previously existing Collection. - */ - "DELETE /api/catalog/pvt/collection/:collectionId": {}; - /** - * >⚠️ 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" - * } - * ``` - */ - "POST /api/catalog/pvt/collection": { - body: { - /** - * Collection Name. - */ - Name: string; - /** - * Defines if the Collection is searchable or not. - */ - Searchable: boolean; - /** - * Defines if the Collection is highlighted or not. - */ - Highlight: boolean; - /** - * Initial value date for the Collection. - */ - DateFrom: string; - /** - * Final value date for the Collection. - */ - DateTo: string; - }; - response: { - /** - * Collection ID. - */ - Id?: number; - /** - * Collection Name. - */ - Name?: string; - /** - * Collection description. - */ - Description?: null | string; - /** - * Defines if the Collection is searchable or not. - */ - Searchable?: boolean; - /** - * Defines if the Collection is highlighted or not. - */ - Highlight?: boolean; - /** - * Initial value date for the Collection. - */ - DateFrom?: string; - /** - * Final value date for the Collection. - */ - DateTo?: string; - /** - * Total quantity of products in the collection. - */ - TotalProducts?: number; - /** - * Type of collection. - */ - 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 - * } - * ] - * ``` - */ - "GET /api/catalog/pvt/collection/:collectionId/subcollection": { - response: { - /** - * Subcollection ID. - */ - Id?: number; - /** - * Collection ID. - */ - CollectionId?: number; - /** - * Subcollection Name. - */ - Name?: string; - /** - * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). - */ - Type?: string; - /** - * Defines if the collection is on PreSale. - */ - PreSale?: boolean; - /** - * Defines if the collection is a new released one. - */ - 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 - * } - * ``` - */ - "GET /api/catalog/pvt/subcollection/:subCollectionId": { - response: { - /** - * Subcollection ID. - */ - Id?: number; - /** - * Collection ID. - */ - CollectionId?: number; - /** - * Subcollection Name. - */ - Name?: string; - /** - * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). - */ - Type?: string; - /** - * Defines if the collection is on PreSale. - */ - PreSale?: boolean; - /** - * Defines if the collection is a new released one. - */ - 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 - * } - * ``` - */ - "PUT /api/catalog/pvt/subcollection/:subCollectionId": { - body: { - /** - * Collection ID. - */ - CollectionId: number; - /** - * Subcollection Name. - */ - Name: string; - /** - * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). - */ - Type: string; - /** - * Defines PreSale date. - */ - PreSale: boolean; - /** - * Defines Release date. - */ - Release: boolean; - }; - response: { - /** - * Subcollection ID. - */ - Id?: number; - /** - * Collection ID. - */ - CollectionId?: number; - /** - * Subcollection Name. - */ - Name?: string; - /** - * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). - */ - Type?: string; - /** - * Defines if the collection is on PreSale. - */ - PreSale?: boolean; - /** - * Defines if the collection is a new released one. - */ - 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). - * - * Deletes a previously created Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. - */ - "DELETE /api/catalog/pvt/subcollection/:subCollectionId": {}; - /** - * >⚠️ 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 - * } - * ``` - */ - "POST /api/catalog/pvt/subcollection": { - body: { - /** - * SubCollection ID. - */ - CollectionId: number; - /** - * SubCollection Name. - */ - Name: string; - /** - * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). - */ - Type: string; - /** - * Defines PreSale date. - */ - PreSale: boolean; - /** - * Defines Release date. - */ - Release: boolean; - }; - response: { - /** - * Subcollection ID. - */ - Id?: number; - /** - * Collection ID. - */ - CollectionId?: number; - /** - * Subcollection Name. - */ - Name?: string; - /** - * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). - */ - Type?: string; - /** - * Defines if the collection is on PreSale. - */ - PreSale?: boolean; - /** - * Defines if the collection is a new released one. - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/collection/:collectionId/position": { - body: { - /** - * SKU ID. - */ - skuId: number; - /** - * SKU position. - */ - position: number; - /** - * Subcollection ID. - */ - 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" - * } - * ``` - */ - "GET /api/catalog/pvt/specification/:specificationId": { - response: { - /** - * Created Specification’s ID. - */ - Id: number; - /** - * Field Type can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. - */ - FieldTypeId: number; - /** - * Specification Category ID. - */ - CategoryId: number; - /** - * Numerical ID of the Group of Specifications that contains the new Specification. - */ - FieldGroupId: number; - /** - * Specification name. Limited to 100 characters. - */ - Name: string; - /** - * Specification Description. - */ - Description: string; - /** - * The current Specification's position in comparison to the other Specifications. - */ - Position: number; - /** - * Defines if the Specification can be used as a Filter. - */ - IsFilter: boolean; - /** - * Defines if the Specification is required or not. - */ - IsRequired: boolean; - /** - * Defines if the Specification will be shown on the Product screen in the specification area. - */ - IsOnProductDetails: boolean; - /** - * Defines if the Specification is applied to a specific SKU. - */ - IsStockKeepingUnit: boolean; - /** - * @deprecated - * Deprecated - */ - IsWizard: boolean; - /** - * Defines if the Specification is active or not. - */ - IsActive: boolean; - /** - * Defines if the Specification is shown in the main menu of the site. - */ - IsTopMenuLinkActive: boolean; - /** - * Defines if the Specification is shown in the side menu. - */ - IsSideMenuLinkActive: boolean; - /** - * Specification Default Value. - */ - 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" - * } - * ``` - */ - "PUT /api/catalog/pvt/specification/:specificationId": { - body: { - /** - * Field Type can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. This information is not editable. - */ - FieldTypeId: number; - /** - * Specification Category ID. This information is not editable. - */ - CategoryId: number; - /** - * Numerical ID of the Group of Specifications that contains the new Specification. This information is not editable. - */ - FieldGroupId: number; - /** - * Specification name. Limited to 100 characters. - */ - Name: string; - /** - * Specification Description. - */ - Description: string; - /** - * The current Specification's position in comparison to the other Specifications. - */ - Position: number; - /** - * Defines if the Specification can be used as a Filter. - */ - IsFilter: boolean; - /** - * Defines if the Specification is required or not. - */ - IsRequired: boolean; - /** - * Defines if the Specification will be shown on the Product screen in the specification area. - */ - IsOnProductDetails: boolean; - /** - * Defines if the Specification is applied to a specific SKU. This information is not editable. - */ - IsStockKeepingUnit: boolean; - /** - * @deprecated - * Deprecated - */ - IsWizard: boolean; - /** - * Defines if the Specification is active or not. - */ - IsActive: boolean; - /** - * Defines if the Specification is shown in the main menu of the site. - */ - IsTopMenuLinkActive: boolean; - /** - * Defines if the Specification is shown in the side menu. - */ - IsSideMenuLinkActive: boolean; - /** - * Specification Default Value. - */ - DefaultValue: string; - }; - response: { - /** - * Specification ID. - */ - Id?: number; - /** - * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. - */ - FieldTypeId?: number; - /** - * Category ID associated with this specification. - */ - CategoryId?: number; - /** - * ID of the group of specifications that contains the new specification. - */ - FieldGroupId?: number; - /** - * Specification name. Limited to 100 characters. - */ - Name?: string; - /** - * @deprecated - */ - 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. - */ - Position?: number; - /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. - */ - IsFilter?: boolean; - /** - * Makes the specification mandatory (`true`) or optional (`false`). - */ - IsRequired?: boolean; - /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. - */ - IsOnProductDetails?: boolean; - /** - * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. - */ - IsStockKeepingUnit?: boolean; - /** - * @deprecated - */ - IsWizard?: null | boolean; - /** - * Enable (`true`) or disable (`false`) specification. - */ - IsActive?: boolean; - /** - * 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. - */ - IsSideMenuLinkActive?: boolean; - /** - * Specification default value. - */ - 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" - * } - * ``` - */ - "POST /api/catalog/pvt/specification": { - body: { - /** - * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. - */ - FieldTypeId: number; - /** - * Category ID associated with this specification. - */ - CategoryId?: number; - /** - * ID of the group of specifications that contains the new specification. - */ - FieldGroupId: number; - /** - * Specification name. Limited to 100 characters. - */ - Name: string; - /** - * @deprecated - */ - 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. - */ - Position?: number; - /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. - */ - IsFilter?: boolean; - /** - * Makes the specification mandatory (`true`) or optional (`false`). - */ - IsRequired?: boolean; - /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. - */ - IsOnProductDetails?: boolean; - /** - * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. - */ - IsStockKeepingUnit?: boolean; - /** - * @deprecated - */ - IsWizard?: null | boolean; - /** - * Enable (`true`) or disable (`false`) specification. - */ - IsActive?: boolean; - /** - * 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. - */ - IsSideMenuLinkActive?: boolean; - /** - * Specification default value. - */ - DefaultValue?: string; - }; - response: { - /** - * Specification ID. - */ - Id?: number; - /** - * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. - */ - FieldTypeId?: number; - /** - * Category ID associated with this specification. - */ - CategoryId?: number; - /** - * ID of the group of specifications that contains the new specification. - */ - FieldGroupId?: number; - /** - * Specification name. Limited to 100 characters. - */ - Name?: string; - /** - * @deprecated - */ - 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. - */ - Position?: number; - /** - * Store Framework - Deprecated. - * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. - */ - IsFilter?: boolean; - /** - * Makes the specification mandatory (`true`) or optional (`false`). - */ - IsRequired?: boolean; - /** - * Store Framework - Deprecated. - * Legacy CMS Portal -If specification is visible on the product page. - */ - IsOnProductDetails?: boolean; - /** - * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. - */ - IsStockKeepingUnit?: boolean; - /** - * @deprecated - */ - IsWizard?: null | boolean; - /** - * Enable (`true`) or disable (`false`) specification. - */ - IsActive?: boolean; - /** - * 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. - */ - IsSideMenuLinkActive?: boolean; - /** - * Specification default value. - */ - 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" - * } - * ``` - */ - "GET /api/catalog_system/pub/specification/fieldGet/:fieldId": { - response: { - /** - * Specification field name. - */ - Name?: string; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Enable (`true`) or disable (`false`) specification. - */ - IsActive?: boolean; - /** - * Makes the specification mandatory (`true`) or optional (`false`). - */ - IsRequired?: boolean; - /** - * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. - */ - FieldTypeId?: number; - /** - * Field Type name, which can be `Text`, `Multi-Line Text`, `Number`, `Combo`, `Radio`, `Checkbox`, `Indexed Text` or `Indexed Multi-Line Text`. - */ - FieldTypeName?: string; - /** - * Specification value ID. - */ - FieldValueId?: null | number; - /** - * @deprecated - */ - Description?: null | string; - /** - * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. - */ - IsStockKeepingUnit?: boolean; - /** - * 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. - */ - 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. - */ - Position?: number; - /** - * @deprecated - */ - IsWizard?: null | boolean; - /** - * 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. - */ - IsSideMenuLinkActive?: boolean; - /** - * Specification default value. - */ - DefaultValue?: null | string; - /** - * ID of the group of specifications that contains the new specification. - */ - FieldGroupId?: number; - /** - * Specification Field Group Name. - */ - 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 - * ``` - */ - "POST /api/catalog_system/pvt/specification/field": { - body: SpecificationsInsertFieldRequest; - /** - * Specification field ID. - */ - 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 - * ``` - */ - "PUT /api/catalog_system/pvt/specification/field": { - body: SpecificationsInsertFieldUpdateRequest; - /** - * Specification field ID. - */ - 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 - * } - * ``` - */ - "GET /api/catalog_system/pvt/specification/fieldValue/:fieldValueId": { - response: { - /** - * Specification Field Value ID. - */ - FieldValueId?: number; - /** - * Specification Field ID. - */ - FieldId?: number; - /** - * Specification Field Value Name. - */ - Name?: string; - /** - * Specification Field Value Description. - */ - Text?: string; - /** - * Defines if the Specification Field Value is active (`true`) or inactive (`false`). - */ - IsActive?: boolean; - /** - * Specification Field Value Position. - */ - 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 - * } - * ] - * ``` - */ - "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 - * } - * ``` - */ - "POST /api/catalog_system/pvt/specification/fieldValue": { - body: SpecificationsInsertFieldValueRequest; - response: { - /** - * Specification Field Value ID. - */ - FieldValueId?: number; - /** - * Specification Field ID. - */ - FieldId?: number; - /** - * Specification Field Value Name. - */ - Name?: string; - /** - * Specification Field Value Description. - */ - Text?: string; - /** - * Defines if the Specification Field Value is active (`true`) or inactive (`false`). - */ - IsActive?: boolean; - /** - * Specification Field Value Position. - */ - 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" - * ``` - */ - "PUT /api/catalog_system/pvt/specification/fieldValue": { - body: SpecificationsUpdateFieldValueRequest; - /** - * Status of the request. - */ - 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 - * } - * ``` - */ - "GET /api/catalog/pvt/specificationvalue/:specificationValueId": { - response: { - /** - * Specification Field Value ID. - */ - FieldValueId?: number; - /** - * Specification Field ID. - */ - FieldId?: number; - /** - * Specification Field Value Name. - */ - Name?: string; - /** - * Specification Field Value Description. - */ - Text?: string; - /** - * Defines if the Specification Field Value is active (`true`) or inactive (`false`). - */ - IsActive?: boolean; - /** - * Specification Field Value Position. - */ - 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 - * } - * ``` - */ - "PUT /api/catalog/pvt/specificationvalue/:specificationValueId": { - body: { - /** - * Specification ID associated with this specification value. - */ - FieldId: number; - /** - * Specification Value name. - */ - Name: string; - /** - * @deprecated - * Specification Value Text. - */ - Text?: null | string; - /** - * Enable (`true`) or disable (`false`) specification value. - */ - IsActive?: boolean; - /** - * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). - */ - Position?: number; - }; - response: { - /** - * Specification value ID. - */ - FieldValueId?: number; - /** - * Specification field ID associated with this specification value. - */ - FieldId?: number; - /** - * Specification Value name. - */ - Name?: string; - /** - * @deprecated - * Specification Value Text. - */ - Text?: null | string; - /** - * Enable (`true`) or disable (`false`) specification value. - */ - IsActive?: boolean; - /** - * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/specificationvalue": { - body: { - /** - * Specification field ID associated with this specification value. - */ - FieldId: number; - /** - * Specification Value name. - */ - Name: string; - /** - * @deprecated - * Specification Value Text. - */ - Text?: null | string; - /** - * Enable (`true`) or disable (`false`) specification value. - */ - IsActive?: boolean; - /** - * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). - */ - Position?: number; - }; - response: { - /** - * Specification value ID. - */ - FieldValueId?: number; - /** - * Specification field ID associated with this specification value. - */ - FieldId?: number; - /** - * Specification Value name. - */ - Name?: string; - /** - * @deprecated - * Specification Value Text. - */ - Text?: null | string; - /** - * Enable (`true`) or disable (`false`) specification value. - */ - IsActive?: boolean; - /** - * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). - */ - 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 - * } - * ] - * ``` - */ - "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 - * } - * ``` - */ - "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 - * } - * ``` - */ - "POST /api/catalog/pvt/specificationgroup": { - body: SpecificationGroupInsertRequest; - response: { - /** - * Specification Group ID. - */ - Id?: number; - /** - * Category ID. - */ - CategoryId?: number; - /** - * Specification Group Name. - */ - Name?: string; - /** - * 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 - * } - * ``` - */ - "PUT /api/catalog/pvt/specificationgroup/:groupId": { - body: { - /** - * Category ID where the Specification Group is contained. - */ - CategoryId: number; - /** - * Specification Group ID. - */ - Id: number; - /** - * Specification Group Name. - */ - Name: string; - /** - * Specification Group Position. - */ - Position: number; - }; - response: { - /** - * Category ID where the Specification Group is contained. - */ - CategoryId?: number; - /** - * Specification Group ID. - */ - Id?: number; - /** - * Specification Group Name. - */ - Name?: string; - /** - * Specification Group Position. - */ - 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" - * } - * ``` - */ - "GET /api/catalog/pvt/specification/nonstructured/:id": { - response: { - /** - * Non Structured Specification’s unique numerical identifier. - */ - Id?: number; - /** - * SKU's unique numerical identifier. - */ - SkuId?: number; - /** - * Name of the Non Structured Specification. - */ - SpecificationName?: string; - /** - * Value of the Non Structured Specification. - */ - SpecificationValue?: string; - }[]; - }; - /** - * Deletes unmapped Specifications of a Seller'S SKU in a Marketplace by its unique ID. - */ - "DELETE /api/catalog/pvt/specification/nonstructured/:id": {}; - /** - * 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": { - searchParams: { - /** - * SKU’s unique numerical identifier. - */ - skuId: number; - }; - response: { - /** - * Non Structured Specification’s unique numerical identifier. - */ - Id?: number; - /** - * SKU's unique numerical identifier. - */ - SkuId?: number; - /** - * Name of the Non Structured Specification. - */ - SpecificationName?: string; - /** - * Value of the Non Structured Specification. - */ - SpecificationValue?: string; - }[]; - }; - /** - * Deletes unmapped Specifications of a Seller'S SKU in a Marketplace by SKU ID. - */ - "DELETE /api/catalog/pvt/specification/nonstructured": { - searchParams: { - /** - * SKU’s unique numerical identifier. - */ - 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 - * } - * ] - * ``` - */ - "GET /api/catalog_system/pvt/saleschannel/list": { - response: { - /** - * Sales Channel unique identifier. - */ - Id?: number; - /** - * Sales Channel name. - */ - Name?: string; - /** - * Defines if the Sales Channel is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Product Cluster ID, if the Sales Channel has releated Product Cluster. - */ - ProductClusterId?: null | number; - /** - * Country Code in ISO 3166-1 alfa-3 Standard. - */ - CountryCode?: string; - /** - * Language Country code in LCIDstring Standard. - */ - CultureInfo?: string; - /** - * Name of Time Zone. - */ - TimeZone?: string; - /** - * Currency Code in ISO 4217 standard. - */ - CurrencyCode?: string; - /** - * Currency symbol. - */ - CurrencySymbol?: string; - /** - * Currency Locale Code in LCID standard. - */ - CurrencyLocale?: number; - /** - * Object with currency format. - */ - CurrencyFormatInfo?: { - /** - * Quantity of Currency Decimal Digits. - */ - CurrencyDecimalDigits?: number; - /** - * Defines which Currency Decimal Separator will be applied. - */ - CurrencyDecimalSeparator?: string; - /** - * Defines which Currency Group Separator will be applied. - */ - CurrencyGroupSeparator?: string; - /** - * Define how many characters will be grouped. - */ - CurrencyGroupSize?: number; - /** - * Defines if all prices will be initiated with Currency Symbol (`true`) or not (`false`). - */ - StartsWithCurrencySymbol?: boolean; - }; - /** - * Origin of products in the Sales Channel. - */ - Origin?: null | string; - /** - * Defines the position on index. - */ - Position?: null | number; - /** - * Defines what is the conditional rule to activate de Sales Channel. - */ - ConditionRule?: null | string; - /** - * Quantity of Currency Decimal Digits. - */ - 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 - * } - * ``` - */ - "GET /api/catalog_system/pub/saleschannel/:salesChannelId": { - response: { - /** - * Sales Channel unique identifier. - */ - Id?: number; - /** - * Sales Channel name. - */ - Name?: string; - /** - * Defines if the Sales Channel is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Product Cluster ID, if the Sales Channel has releated Product Cluster. - */ - ProductClusterId?: null | number; - /** - * Country Code in ISO 3166-1 alfa-3 Standard. - */ - CountryCode?: string; - /** - * Language Country code in LCIDstring Standard. - */ - CultureInfo?: string; - /** - * Name of Time Zone. - */ - TimeZone?: string; - /** - * Currency Code in ISO 4217 standard. - */ - CurrencyCode?: string; - /** - * Currency symbol. - */ - CurrencySymbol?: string; - /** - * Currency Locale Code in LCID standard. - */ - CurrencyLocale?: number; - /** - * Object with currency format. - */ - CurrencyFormatInfo?: { - /** - * Quantity of Currency Decimal Digits. - */ - CurrencyDecimalDigits?: number; - /** - * Defines which Currency Decimal Separator will be applied. - */ - CurrencyDecimalSeparator?: string; - /** - * Defines which Currency Group Separator will be applied. - */ - CurrencyGroupSeparator?: string; - /** - * Define how many characters will be grouped. - */ - CurrencyGroupSize?: number; - /** - * Defines if all prices will be initiated with Currency Symbol (`true`) or not (`false`). - */ - StartsWithCurrencySymbol?: boolean; - }; - /** - * Origin of products in the Sales Channel. - */ - Origin?: null | string; - /** - * Defines the position on index. - */ - Position?: null | number; - /** - * Defines what is the conditional rule to activate de Sales Channel. - */ - ConditionRule?: null | string; - /** - * Quantity of Currency Decimal Digits. - */ - CurrencyDecimalDigits?: number; - }; - }; - /** - * Retrieves the seller's details by its ID. - */ - "GET /api/catalog_system/pvt/seller/list": { - searchParams: { - /** - * Trade policy ID. - */ - sc?: number; - /** - * Seller type. - */ - sellerType?: number; - /** - * If the seller is better scope. - */ - isBetterScope?: boolean; - }; - response: { - /** - * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. - */ - SellerId?: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name?: string; - /** - * Email of the admin responsible for the seller. - */ - Email?: string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description?: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy?: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy?: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions?: boolean; - /** - * Seller username. - */ - UserName?: null | string; - /** - * Seller password. - */ - Password?: null | string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy?: string; - /** - * Company registration number. - */ - CNPJ?: string; - /** - * CSC identification. - */ - CSCIdentification?: string; - /** - * Seller archive ID. - */ - ArchiveId?: null | number; - /** - * Seller URL logo. - */ - UrlLogo?: null | string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint?: null | string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint?: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId?: null | number; - /** - * Seller type. - */ - SellerType?: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope?: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - TrustPolicy?: string; - }; - }; - /** - * Retrieves the seller's details by its ID. - */ - "GET /api/catalog_system/pvt/seller/:sellerId": { - /** - * Object with information of all sellers in the store. - */ - response: { - /** - * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. - */ - SellerId?: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name?: string; - /** - * Email of the admin responsible for the seller. - */ - Email?: string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description?: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy?: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy?: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions?: boolean; - /** - * Seller username. - */ - UserName?: null | string; - /** - * Seller password. - */ - Password?: null | string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy?: string; - /** - * Company registration number. - */ - CNPJ?: string; - /** - * CSC identification. - */ - CSCIdentification?: string; - /** - * Seller archive ID. - */ - ArchiveId?: null | number; - /** - * Seller URL logo. - */ - UrlLogo?: string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint?: null | string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint?: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId?: null | number; - /** - * Seller type. - */ - SellerType?: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope?: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - TrustPolicy?: string; - }; - }; - /** - * Creates a new seller. - */ - "POST /api/catalog_system/pvt/seller": { - body: CreateSellerRequest; - response: { - /** - * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. - */ - SellerId?: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name?: string; - /** - * Email of the admin responsible for the seller. - */ - Email?: string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description?: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy?: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy?: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions?: boolean; - /** - * Seller username. - */ - UserName?: null | string; - /** - * Seller password. - */ - Password?: null | string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy?: string; - /** - * Company registration number. - */ - CNPJ?: string; - /** - * CSC identification. - */ - CSCIdentification?: string; - /** - * Seller archive ID. - */ - ArchiveId?: null | number; - /** - * Seller URL logo. - */ - UrlLogo?: null | string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint?: null | string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint?: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId?: null | number; - /** - * Seller type. - */ - SellerType?: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope?: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - TrustPolicy?: string; - }; - }; - /** - * Updates a seller. - */ - "PUT /api/catalog_system/pvt/seller": { - body: UpdateSellerRequest; - response: { - /** - * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. - */ - SellerId?: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name?: string; - /** - * Email of the admin responsible for the seller. - */ - Email?: string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description?: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy?: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy?: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions?: boolean; - /** - * Seller username. - */ - UserName?: null | string; - /** - * Seller password. - */ - Password?: null | string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy?: string; - /** - * Company registration number. - */ - CNPJ?: string; - /** - * CSC identification. - */ - CSCIdentification?: string; - /** - * Seller archive ID. - */ - ArchiveId?: null | number; - /** - * Seller URL logo. - */ - UrlLogo?: null | string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint?: null | string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint?: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId?: null | number; - /** - * Seller type. - */ - SellerType?: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope?: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - TrustPolicy?: string; - }; - }; - /** - * Retrieves the seller's details by its ID. - */ - "GET /api/catalog_system/pvt/sellers/:sellerId": { - /** - * Object with information of all sellers in the store. - */ - response: { - /** - * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. - */ - SellerId?: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name?: null | string; - /** - * Email of the admin responsible for the seller. - */ - Email?: null | string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description?: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy?: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy?: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions?: boolean; - /** - * Seller username. - */ - UserName?: null | string; - /** - * Seller password. - */ - Password?: null | string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy?: string; - /** - * Company registration number. - */ - CNPJ?: string; - /** - * CSC identification. - */ - CSCIdentification?: string; - /** - * Seller archive ID. - */ - ArchiveId?: null | number; - /** - * Seller URL logo. - */ - UrlLogo?: string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage?: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint?: null | string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint?: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive?: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId?: null | number; - /** - * Seller type. - */ - SellerType?: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope?: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - 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 - * } - * ``` - */ - "POST /api/catalog/pvt/supplier": { - 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 - * } - * ``` - */ - "PUT /api/catalog/pvt/supplier/:supplierId": { - body: SupplierRequest; - response: SupplierResponse; - }; - /** - * Deletes an existing Supplier. - */ - "DELETE /api/catalog/pvt/supplier/:supplierId": {}; - /** - * 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": { - response: { - /** - * Product’s unique numerical identifier. - */ - ProductId?: number; - /** - * Trade policy's unique numerical identifier. - */ - StoreId?: number; - }[]; - }; - /** - * Associates an existing Trade Policy with a Product. - */ - "POST /api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId": {}; - /** - * Disassociates a Trade Policy of a Product. - */ - "DELETE /api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId": {}; - /** - * 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": { - searchParams: { - /** - * Trade Policy’s unique numerical identifier. - */ - sc: number; - /** - * Page number. - */ - page?: number; - /** - * Number of items in the page. - */ - pageSize?: number; - /** - * If set as `false`, it allows the user to decide if the SKUs that are not assigned to a specific trade policy should be also returned. - */ - onlyAssigned?: boolean; - }; - /** - * List of SKU IDs of the Trade Policy. - */ - 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" - * ``` - */ - "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 - * } - * ] - * ``` - */ - "GET /api/catalog_system/pvt/commercialcondition/list": { - response: { - /** - * Commercial condition ID. - */ - Id?: number; - /** - * Commercial condition name. - */ - Name?: string; - /** - * Defines if the commercial condition is default (`true`) or not (`false`). - */ - IsDefault?: boolean; - }[]; - }; - /** - * 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": { - /** - * Object with information of the commercial condition. - */ - response: { - /** - * Commercial condition ID. - */ - Id?: number; - /** - * Commercial condition name. - */ - Name?: string; - /** - * If the commercial condition is default (`true`) or not (`false`). - */ - IsDefault?: boolean; - }; - }; - /** - * Retrieves information about a Gift List by its ID. - */ - "GET /api/addon/pvt/giftlist/get/:listId": { - /** - * Object with information about the Gift List. - */ - response: { - /** - * Gift List ID. - */ - giftListId?: number; - /** - * Gift List name. - */ - name?: string; - /** - * User ID. - */ - userId?: string; - /** - * File ID. - */ - fileId?: null | number; - /** - * Gift List Type ID. - */ - giftListTypeId?: number; - /** - * Gift List Type name. - */ - giftListTypeName?: string; - /** - * Gift Card ID. - */ - giftCardId?: number; - /** - * Gift List message. - */ - message?: string; - /** - * Slug of the gift list that will be part of its URL. - */ - urlFolder?: string; - /** - * Date when the gift list was created. - */ - dateCreated?: string; - /** - * Name of the user's address. - */ - profileSystemUserAddressName?: string; - /** - * User ID on Profile System. - */ - profileSystemUserId?: string; - /** - * Date of the event associated with the Gift List. - */ - eventDate?: string; - /** - * Location of the event associated with the Gift List. - */ - eventLocation?: string; - /** - * City of the event associated with the Gift List. - */ - eventCity?: string; - /** - * State of the event associated with the Gift List. - */ - eventState?: string; - /** - * Telemarketing ID. - */ - telemarketingId?: null | number; - /** - * Telemarketing observation. - */ - telemarketingObservation?: string; - /** - * Defines if the gift list is public. - */ - IsPublic?: boolean; - /** - * Defines if the gift list is active. - */ - isActive?: boolean; - /** - * Defines if items purchased from the gift list will be shipped to the owner of the gift list. - */ - shipsToOwner?: boolean; - /** - * Validates the address of the gift list. - */ - isAddressOk?: boolean; - /** - * Version of the gift list. - */ - version?: number; - /** - * ID of the SKU that recharges the gift card. - */ - giftCardRechargeSkuId?: null | number; - /** - * Name of the members of the gift list. - */ - memberNames?: string; - /** - * Array of members of the gift list. - */ - giftListMembers?: { - /** - * Gift List member ID. - */ - giftListMemberId?: number; - /** - * Gift List ID. - */ - giftListId?: number; - /** - * User ID. - */ - userId?: string; - /** - * Client ID. - */ - clientId?: null | string; - /** - * Title of the Gift List member. - */ - title?: null | string; - /** - * Name of the Gift List member. - */ - name?: string; - /** - * Surname of the Gift List member. - */ - surname?: string; - /** - * Defines if the Gift List member is an administrator of the Gift List or not. - */ - isAdmin?: boolean; - /** - * Defines if the Gift List user is active or not. - */ - isActive?: boolean; - /** - * Complementary text. - */ - text1?: null | string; - /** - * Complementary text. - */ - text2?: null | string; - }[]; - /** - * Array with the IDs of SKUs that are part of the gift list. - */ - giftListSkuIds?: string[]; - /** - * Address of the gift list. - */ - address?: null | string; - /** - * File URL. - */ - 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. - * - * **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`. - */ - RnbBehavior?: number; - /** - * Trade Policy (Sales Channel) identification. - */ - sc?: number; - }; - body: { - /** - * Array containing information about the SKUs inside the cart to be simulated. - */ - items?: { - /** - * The SKU ID. - */ - id?: string; - /** - * The quantity of items of this specific SKU in the cart to be simulated. - */ - quantity?: number; - /** - * The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin. - */ - seller?: string; - }[]; - marketingData?: { - [k: string]: any; - }; - priceTables?: string[]; - /** - * Three letter ISO code of the country of the shipping address. This value must be sent along with the `postalCode` or `geoCoordinates` values. - */ - country?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - minItems?: 0; - }; - response: { - /** - * Information on each item in the cart. - */ - items?: { - /** - * ID of the item. - */ - id?: string; - /** - * Request index information. - */ - requestIndex?: number; - /** - * The quantity of the item the cart. - */ - quantity?: number; - /** - * The seller responsible for the SKU. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Tax value in cents. - */ - tax?: number; - /** - * A unique identifier code assigned to a tax within the VTEX Admin. - */ - taxCode?: string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Array containing offering information. - */ - offerings?: any[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag name. - */ - name?: string; - /** - * Price tag value. - */ - value?: number; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Identification of the responsible for the price tag. - */ - owner?: string; - }[]; - /** - * Measurement unit. - */ - measurementUnit?: string; - /** - * Unit multiplier. - */ - unitMultiplier?: number; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Availability. - */ - availability?: string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: any[]; - /** - * List with rates and benefits teasers. - */ - teaser?: any[]; - }; - /** - * Payment data information. - */ - paymentData?: { - /** - * Installment options information. - */ - installmentOptions?: any[]; - /** - * Information on payment systems. - */ - paymentSystems?: { - /** - * Payment system ID. - */ - id?: number; - /** - * Payment system name. - */ - name?: string; - /** - * Payment group name. - */ - groupName?: string; - /** - * Payment system validator. - */ - validator?: null | {}; - /** - * String ID. - */ - stringId?: string; - /** - * Template. - */ - template?: string; - /** - * Indicates whether a document is required. - */ - requiresDocument?: boolean; - /** - * Indicates whether a document is shown. - */ - displayDocument?: boolean; - /** - * Indicates whether it is custom. - */ - isCustom?: boolean; - /** - * Description. - */ - description?: string; - /** - * Indicates whether a authentication is required. - */ - requiresAuthentication?: boolean; - /** - * Payment due date. - */ - dueDate?: string; - /** - * Availability of payment. - */ - availablePayments?: null | string; - }[]; - /** - * Information on each payment. - */ - payments?: any[]; - /** - * Gift card information, if it applies to the order. - */ - giftCards?: any[]; - /** - * Array of gift card messages. - */ - giftCardMessages?: any[]; - /** - * Available accounts. - */ - availableAccounts?: any[]; - /** - * Available tokens. - */ - availableTokens?: any[]; - /** - * Available associations. - */ - availableAssociations?: {}; - }; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Object containing promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: null | {}; - /** - * Postal Code. - */ - postalCode?: null | string; - /** - * Three letter ISO code of the country of the shipping address. - */ - country?: string; - /** - * Array with logistics information on each item of the `items` array in the `orderForm`. - */ - logisticsInfo?: { - /** - * Index of item in items array. - */ - itemIndex?: number; - /** - * Address ID. - */ - addressId?: null | string; - /** - * Selected SLA. For example, `"normal"` or `"express"`. - */ - selectedSla?: null | string; - /** - * Delivery channel selected by the customer. For example, `"delivery"` or `"pickup-in-point"`. - */ - selectedDeliveryChannel?: null | string; - /** - * Quantity. - */ - quantity?: number; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: any[]; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, "three business days" will be represented as `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * This object contains information about the delivery window available to the shopper. - */ - availableDeliveryWindows?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - /** - * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. - */ - deliveryWindow?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | {}; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented as `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Purchase conditions information. - */ - purchaseConditions?: { - /** - * List of objects containing purchase condition information on each item in the order. - */ - itemPurchaseConditions?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: any[]; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, "three business days" will be represented as `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * This object contains information about the delivery window available to the shopper. - */ - availableDeliveryWindows?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - /** - * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. - */ - deliveryWindow?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | {}; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented as `3bd`. - */ - transitTime?: string; - }[]; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - }[]; - }; - /** - * Array containing pickup points information. - */ - pickupPoints?: any[]; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Information on order totals. - */ - totals?: { - /** - * Total ID. - */ - id?: string; - /** - * Total name. - */ - name?: string; - /** - * Total value. - */ - value?: number; - }[]; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Assembly options information. - */ - 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`. - * - * 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. - */ - "GET /api/checkout/pub/orderForm": { - searchParams: { - /** - * Use this query parameter to create a new empty shopping cart. - */ - forceNewCart?: boolean; - }; - }; - /** - * 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. - */ - "GET /api/checkout/pub/orderForm/:orderFormId": { - searchParams: { - /** - * It is possible to use the [Update cart items request](https://developers.vtex.com/vtex-rest-api/reference/cart-update#itemsupdate) so as to allow outdated information in the `orderForm`, which may improve performance in some cases. To guarantee that all cart information is updated, send this request with this parameter as `true`. We recommend doing this in the final stages of the shopping experience, starting from the checkout page. - */ - 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. - * - * **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. - */ - "POST /api/checkout/pub/orderForm/:orderFormId/items/removeAll": { - /** - * This object must be empty. - */ - body: {}; - 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 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": {}; - /** - * 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. - * - * 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. - */ - "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”`. - */ - allowedOutdatedData?: any[]; - }; - body: { - /** - * Array containing the cart items. Each object inside this array corresponds to a different item. - */ - orderItems?: { - /** - * The quantity of the item in the cart. - */ - quantity: number; - /** - * The position of the item in the array. - */ - index: number; - }[]; - }; - response: { - /** - * ID of the orderForm corresponding to a specific cart. - */ - orderFormId?: string; - /** - * Attribute created by the seller, in their VTEX store configuration. - */ - salesChannel?: string; - /** - * Indicates whether the user is logged into the store. - */ - loggedIn?: boolean; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the store. - */ - storeId?: null | string; - /** - * Permission to modify item price manually. - */ - allowManualPrice?: boolean; - /** - * Data can be edited. - */ - canEditData?: boolean; - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: string; - /** - * Profile provider. - */ - profileProvider?: string; - /** - * Available accounts. - */ - availableAccounts?: string[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * List with the two geocoordinates. - */ - geoCoordinates?: string[]; - }[]; - /** - * User type. - */ - userType?: null | string; - /** - * Ignore customer profile data. - */ - ignoreProfileData?: boolean; - /** - * Total value of the order without separating cents. For example, $24.99 is represented as `2499`. - */ - value?: number; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * A unique identifier code assigned to a tax within the VTEX Admin. - */ - taxCode?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability. - */ - availability?: string; - /** - * Measurement unit. - */ - measurementUnit?: string; - /** - * Unit multiplier. - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). - */ - totalizers?: any[]; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array with two strings with geocoordinates, first latitude, then longitude. - */ - geoCoordinates?: string[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: string; - /** - * Delivery channel selected by the customer. - */ - selectedDeliveryChannel?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, "three business days" will be represented as `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array with two strings with geocoordinates, first latitude, then longitude. - */ - geoCoordinates?: string[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented as `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array with two strings with geocoordinates, first latitude, then longitude. - */ - geoCoordinates?: string[]; - }[]; - /** - * Array with information on the available addresses for the order. - */ - availableAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array with two strings with geocoordinates, first latitude, then longitude. - */ - geoCoordinates?: string[]; - }[]; - }; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Information on the order's payment. - */ - paymentData?: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode?: string; - /** - * Gift card value in cents. - */ - value?: number; - /** - * Gift card balance in cents. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Information on each transaction pertinent to the order. - */ - transactions?: { - /** - * Indicates whether transaction is active. - */ - isActive?: boolean; - /** - * Transaction ID. - */ - transactionId?: string; - /** - * Merchant name. - */ - merchantName?: string; - /** - * Information on each payment. - */ - payments?: { - /** - * Account ID. - */ - accountId?: string; - /** - * Bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments?: number; - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Reference value for calculating interest rates, in case it applies. Displayed in cents. - */ - referenceValue?: number; - /** - * Value including interest, in case it applies. Displayed in cents. - */ - value?: number; - }[]; - /** - * Indicates whather transaction is shared. - */ - sharedTransaction?: boolean; - }[]; - }; - /** - * Object containing promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: { - /** - * 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. - */ - coupon?: string; - /** - * UTM source. - */ - utmSource?: string; - /** - * UTM medium. - */ - utmMedium?: string; - /** - * UTM campaign - */ - utmCampaign?: string; - /** - * utmi_page (internal utm). - */ - utmiPage?: null | string; - /** - * utmi_part (internal utm). - */ - utmiPart?: null | string; - /** - * utmi_campaign (internal utm). - */ - utmiCampaign?: null | string; - }; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Object containing preferences from the client who placed the order. - */ - clientPreferencesData?: { - /** - * Client's locale. Examples: `pt-BR` and `en-US`. - */ - locale?: string; - /** - * `true` if the client opted to receive newsletter from the store. - */ - optinNewsLetter?: boolean; - }; - /** - * Object containing commercial condition information. - */ - commercialConditionData?: null | {}; - /** - * Object containing data from the store's configuration (stored in VTEX's License Manager). - */ - storePreferencesData?: {}; - /** - * Gift registry list information. - */ - giftRegistryData?: null | {}; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). - */ - openTextField?: null | string; - /** - * Object containing information pertinent to the order's invoice. - */ - invoiceData?: null | {}; - /** - * Customer additional information. - */ - customData?: null | {}; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - }[]; - }; - /** - * Hooks information. - */ - hooksData?: null | {}; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: string[]; - /** - * List with rates and benefits teasers. - */ - teaser?: string[]; - }; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Object containing information about the ordering of items within the `orderForm`. - */ - itemsOrdination?: { - /** - * Criteria adopted to order the items in the list. - */ - criteria?: string; - /** - * Indicates whether the ordering is ascending. - */ - ascending?: boolean; - }; - }; - }; - /** - * 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. - */ - "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”`. - */ - allowedOutdatedData?: any[]; - }; - body: { - /** - * Array containing the cart items. Each object inside this array corresponds to a different item. - */ - orderItems?: { - /** - * The quantity of the item (SKU) in the cart. - */ - quantity: number; - /** - * The seller responsible for the SKU. - */ - seller: string; - /** - * The ID of the SKU in VTEX platform. - */ - id: string; - /** - * The position of the item in the array. - */ - index: number; - /** - * Price of the item in cents. Send this value in case you want to make a bulk price change. - */ - price?: number; - }[]; - }; - response: { - /** - * ID of the orderForm corresponding to a specific cart. - */ - orderFormId?: string; - /** - * Attribute created by the seller, in their VTEX store configuration. - */ - salesChannel?: string; - /** - * Indicates whether the user is logged into the store. - */ - loggedIn?: boolean; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the store. - */ - storeId?: null | string; - /** - * Permission to modify item price manually. - */ - allowManualPrice?: boolean; - /** - * Data can be edited. - */ - canEditData?: boolean; - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: string; - /** - * Profile provider. - */ - profileProvider?: string; - /** - * Available accounts. - */ - availableAccounts?: string[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * User type. - */ - userType?: null | string; - /** - * Ignore customer profile data. - */ - ignoreProfileData?: boolean; - /** - * Total value of the order without separating cents. For example, $24.99 is represented `2499`. - */ - value?: number; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * A unique identifier code assigned to a tax within the VTEX Admin. - */ - taxCode?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability. - */ - availability?: string; - /** - * Measurement unit. - */ - measurementUnit?: string; - /** - * Unit multiplier. - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). - */ - totalizers?: any[]; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: string; - /** - * Delivery channel selected by the customer. - */ - selectedDeliveryChannel?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, Three business days will be represented `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array with information on the available addresses for the order. - */ - availableAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - }; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Information on the order's payment. - */ - paymentData?: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode?: string; - /** - * Gift card value in cents. - */ - value?: number; - /** - * Gift card balance in cents. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Information on each transaction pertinent to the order. - */ - transactions?: { - /** - * Indicates whether transaction is active. - */ - isActive?: boolean; - /** - * Transaction ID. - */ - transactionId?: string; - /** - * Merchant name. - */ - merchantName?: string; - /** - * Information on each payment. - */ - payments?: { - /** - * Account ID. - */ - accountId?: string; - /** - * Bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments?: number; - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Reference value for calculating interest rates, in case it applies. Displayed in cents. - */ - referenceValue?: number; - /** - * Value including interest, in case it applies. Displayed in cents. - */ - value?: number; - }[]; - /** - * Indicates whather transaction is shared. - */ - sharedTransaction?: boolean; - }[]; - }; - /** - * Object containing promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: { - /** - * 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. - */ - coupon?: string; - /** - * UTM source. - */ - utmSource?: string; - /** - * UTM medium. - */ - utmMedium?: string; - /** - * UTM campaign - */ - utmCampaign?: string; - /** - * utmi_page (internal utm). - */ - utmiPage?: null | string; - /** - * utmi_part (internal utm). - */ - utmiPart?: null | string; - /** - * utmi_campaign (internal utm). - */ - utmiCampaign?: null | string; - }; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Object containing preferences from the client who placed the order. - */ - clientPreferencesData?: { - /** - * Client's locale. Examples: `pt-BR` and `en-US`. - */ - locale?: string; - /** - * `true` if the client opted to receive newsletter from the store. - */ - optinNewsLetter?: boolean; - }; - /** - * Object containing commercial condition information. - */ - commercialConditionData?: null | {}; - /** - * Object containing data from the store's configuration (stored in VTEX's License Manager). - */ - storePreferencesData?: {}; - /** - * Gift registry list information. - */ - giftRegistryData?: null | {}; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). - */ - openTextField?: null | string; - /** - * Object containing information pertinent to the order's invoice. - */ - invoiceData?: null | {}; - /** - * Customer additional information. - */ - customData?: null | {}; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - }[]; - }; - /** - * Hooks information. - */ - hooksData?: null | {}; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: string[]; - /** - * List with rates and benefits teasers. - */ - teaser?: string[]; - }; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Object containing information about the ordering of items within the orderForm. - */ - itemsOrdination?: { - /** - * Criteria adopted to order the items in the list. - */ - criteria?: string; - /** - * Indicates whether the ordering is ascending. - */ - 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. - * - * 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. - */ - "PATCH /api/checkout/pub/orderForm/:orderFormId/items": { - body: { - /** - * Array containing the cart items. Each object inside this array corresponds to a different item. - */ - orderItems?: { - /** - * The ID of the SKU in VTEX platform. - */ - id: string; - /** - * The quantity of the item (SKU) in the cart. - */ - quantity: number; - /** - * The seller responsible for the SKU. - */ - seller: string; - /** - * The position of the item in the array. This string should be sent only to modify price or quantity of an item. NOTE: This string should not be sent when you are adding a new item to the cart. - */ - index?: number; - /** - * Price of the item in cents. Send this value in case you want to make a bulk price change. - */ - price?: number; - /** - * Array containing information on attachments. - */ - attachments?: { - /** - * Attachment identification. - */ - name?: string; - /** - * Attachment content data. E.g. `"Do you want to receive packages?": "Yes"`. - */ - content?: null | {}; - }[]; - /** - * Indicates whether the item can be splitted. - */ - noSplitItem?: boolean; - /** - * 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"`. - */ - allowedOutdatedData?: string[]; - }[]; - }; - response: { - /** - * ID of the orderForm corresponding to a specific cart. - */ - orderFormId?: string; - /** - * Attribute created by the seller, in their VTEX store configuration. - */ - salesChannel?: string; - /** - * Indicates whether the user is logged into the store. - */ - loggedIn?: boolean; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the store. - */ - storeId?: null | string; - /** - * Permission to modify item price manually. - */ - allowManualPrice?: boolean; - /** - * Data can be edited. - */ - canEditData?: boolean; - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: string; - /** - * Profile provider. - */ - profileProvider?: string; - /** - * Available accounts. - */ - availableAccounts?: string[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * User type. - */ - userType?: null | string; - /** - * Ignore customer profile data. - */ - ignoreProfileData?: boolean; - /** - * Total value of the order without separating cents. For example, $24.99 is represented `2499`. - */ - value?: number; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * A unique identifier code assigned to a tax within the VTEX Admin. - */ - taxCode?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability. - */ - availability?: string; - /** - * Measurement unit. - */ - measurementUnit?: string; - /** - * Unit multiplier. - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). - */ - totalizers?: any[]; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: string; - /** - * Delivery channel selected by the customer. - */ - selectedDeliveryChannel?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, Three business days will be represented `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array with information on the available addresses for the order. - */ - availableAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - }; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Information on the order's payment. - */ - paymentData?: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode?: string; - /** - * Gift card value in cents. - */ - value?: number; - /** - * Gift card balance in cents. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Information on each transaction pertinent to the order. - */ - transactions?: { - /** - * Indicates whether transaction is active. - */ - isActive?: boolean; - /** - * Transaction ID. - */ - transactionId?: string; - /** - * Merchant name. - */ - merchantName?: string; - /** - * Information on each payment. - */ - payments?: { - /** - * Account ID. - */ - accountId?: string; - /** - * Bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments?: number; - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Reference value for calculating interest rates, in case it applies. Displayed in cents. - */ - referenceValue?: number; - /** - * Value including interest, in case it applies. Displayed in cents. - */ - value?: number; - }[]; - /** - * Indicates whather transaction is shared. - */ - sharedTransaction?: boolean; - }[]; - }; - /** - * Object containing promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: { - /** - * Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForms/simulation) request to check which coupons might apply before placing the order. - */ - coupon?: string; - /** - * UTM source. - */ - utmSource?: string; - /** - * UTM medium. - */ - utmMedium?: string; - /** - * UTM campaign - */ - utmCampaign?: string; - /** - * utmi_page (internal utm). - */ - utmiPage?: null | string; - /** - * utmi_part (internal utm). - */ - utmiPart?: null | string; - /** - * utmi_campaign (internal utm). - */ - utmiCampaign?: null | string; - }; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Object containing preferences from the client who placed the order. - */ - clientPreferencesData?: { - /** - * Client's locale. Examples: `pt-BR` and `en-US`. - */ - locale?: string; - /** - * `true` if the client opted to receive newsletter from the store. - */ - optinNewsLetter?: boolean; - }; - /** - * Object containing commercial condition information. - */ - commercialConditionData?: null | {}; - /** - * Object containing data from the store's configuration (stored in VTEX's License Manager). - */ - storePreferencesData?: {}; - /** - * Gift registry list information. - */ - giftRegistryData?: null | {}; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/docs/guides/customizable-fields-with-checkout-api). - */ - openTextField?: null | string; - /** - * Object containing information pertinent to the order's invoice. - */ - invoiceData?: null | {}; - /** - * Customer additional information. - */ - customData?: null | {}; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - }[]; - }; - /** - * Hooks information. - */ - hooksData?: null | {}; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: string[]; - /** - * List with rates and benefits teasers. - */ - teaser?: string[]; - }; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Object containing information about the ordering of items within the orderForm. - */ - itemsOrdination?: { - /** - * Criteria adopted to order the items in the list. - */ - criteria?: string; - /** - * Indicates whether the ordering is ascending. - */ - ascending?: boolean; - }; - }; - }; - /** - * 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. - */ - "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. - * - * 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": { - body: { - /** - * Indicates whether profile data should be ignored. - */ - 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). - * - * >⚠️ 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": { - searchParams: { - /** - * Client's email address to be searched. - */ - email: string; - /** - * Indicates whether the returned profiles must be complete or not. - */ - ensureComplete?: boolean; - }; - response: { - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: string; - /** - * Profile provider. - */ - profileProvider?: string; - /** - * Available accounts. - */ - availableAccounts?: string[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Customer profile information. - */ - userProfile?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Document. - */ - document?: string; - /** - * Document type. - */ - documentType?: string; - /** - * Telephone number. - */ - phone?: string; - /** - * Name of the company. Used for corporate clients. - */ - corporateName?: null | string; - /** - * Trade name. Used for corporate clients. - */ - tradeName?: null | string; - /** - * Document. Used for corporate clients. - */ - corporateDocument?: null | string; - /** - * State inscription. Used for corporate clients. - */ - stateInscription?: null | string; - /** - * Telephone number. Used for corporate clients. - */ - corporatePhone?: null | string; - /** - * Indicates whether client is corporate. - */ - isCorporate?: boolean; - /** - * Profile complete when loading. - */ - profileCompleteOnLoading?: null | string; - /** - * Profile error when loading. - */ - profileErrorOnLoading?: null | string; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Indicates whether customer profile is complete. - */ - isComplete?: boolean; - }; - }; - /** - * 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. - * - * >⚠️ 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": - { - /** - * Customer's profile information. - */ - body: { - /** - * Customer's email address. - */ - 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 number informed by the customer. - */ - document: string; - /** - * Customer's phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: string; - /** - * `true` if the customer is a legal entity. - */ - 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. - * - * 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. - * - * >⚠️ 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": { - body: { - /** - * This field should be sent as `false` to prevent the address information from being filled in automatically based on the `postalCode` information. - */ - clearAddressIfPostalCodeNotFound?: boolean; - /** - * List of objects with addresses information. - */ - selectedAddresses?: { - /** - * 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; - /** - * Address ID. - */ - addressId?: string; - /** - * Postal Code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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 in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array with logistics information on each item of the `items` array in the `orderForm`. - */ - logisticsInfo?: { - /** - * Index of item in items array - */ - itemIndex?: number; - /** - * Delivery channel selected by the customer. For example, `"delivery"` or `"pickup-in-point"`. - */ - selectedDeliveryChannel?: string; - /** - * Selected SLA. For example, `"normal"` or `"express"`. - */ - selectedSla?: string; - }[]; - }; - response: { - /** - * ID of the `orderForm` corresponding to a specific cart. - */ - orderFormId?: string; - /** - * Attribute created by the seller, in their VTEX store configuration. - */ - salesChannel?: string; - /** - * Indicates whether the user is logged into the store. - */ - loggedIn?: boolean; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the store. - */ - storeId?: null | string; - /** - * Checked in pickuppoint identification. - */ - checkedInPickupPointId?: null | string; - /** - * Permission to modify item price manually. - */ - allowManualPrice?: boolean; - /** - * Data can be edited. - */ - canEditData?: boolean; - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: null | string; - /** - * User type. - */ - userType?: null | string; - /** - * Ignore customer profile data. - */ - ignoreProfileData?: boolean; - /** - * Total value of the order without separating cents. For example, $24.99 is represented `2499`. - */ - value?: number; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability. - */ - availability?: string; - /** - * Measurement unit. - */ - measurementUnit?: string; - /** - * Unit multiplier. - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). - */ - totalizers?: any[]; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: null | string; - /** - * Delivery channel selected by the customer. - */ - selectedDeliveryChannel?: null | string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, Three business days will be represented `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: null | string; - /** - * This object contains information about the delivery window available to the shopper. - */ - availableDeliveryWindows?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - /** - * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. - */ - deliveryWindow?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array containing pickup points information. - */ - pickupPoints?: any[]; - }; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Payment data information. - */ - paymentData?: { - /** - * Indicate whether this object's information is up to date according to the order's items. An order can not be placed if `"outdated"` - */ - updateStatus?: string; - /** - * Installment options information. - */ - installmentOptions?: any[]; - /** - * Information on payment systems. - */ - paymentSystems?: { - /** - * Payment system ID. - */ - id?: number; - /** - * Payment system name. - */ - name?: string; - /** - * Payment group name. - */ - groupName?: string; - /** - * Payment system validator. - */ - validator?: null | {}; - /** - * String ID. - */ - stringId?: string; - /** - * Template. - */ - template?: string; - /** - * Indicates whether a document is required. - */ - requiresDocument?: boolean; - /** - * Indicates whether a document is shown. - */ - displayDocument?: boolean; - /** - * Indicates whether it is custom. - */ - isCustom?: boolean; - /** - * Description. - */ - description?: string; - /** - * Indicates whether a authentication is required. - */ - requiresAuthentication?: boolean; - /** - * Payment due date. - */ - dueDate?: string; - /** - * Availability of payment. - */ - availablePayments?: null | string; - }[]; - /** - * Information on each payment. - */ - payments?: any[]; - /** - * Gift card information, if it applies to the order. - */ - giftCards?: any[]; - /** - * Array of gift card messages. - */ - giftCardMessages?: any[]; - /** - * Available accounts. - */ - availableAccounts?: any[]; - /** - * Available tokens. - */ - availableTokens?: any[]; - /** - * Available associations. - */ - availableAssociations?: {}; - }; - /** - * Object containing promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: null | {}; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Object containing preferences from the client who placed the order. - */ - clientPreferencesData?: { - /** - * Client's locale. Examples: `pt-BR` and `en-US`. - */ - locale?: string; - /** - * `true` if the client opted to receive newsletter from the store. - */ - optinNewsLetter?: boolean; - }; - /** - * Object containing commercial condition information. - */ - commercialConditionData?: null | {}; - /** - * Object containing data from the store's configuration (stored in VTEX's License Manager). - */ - storePreferencesData?: { - /** - * Three letters ISO code of the country (ISO 3166 ALPHA-3). - */ - countryCode?: string; - /** - * Defines whether the customer want the store to keep their personal and payment data saved. - */ - saveUserData?: boolean; - /** - * Time zone from where the order was made. - */ - timeZone?: string; - /** - * Currency code in ISO 4217. For example, `BRL`. - */ - currencyCode?: string; - /** - * Currency Locale Code in LCID in decimal. - */ - currencyLocale?: number; - /** - * Currency symbol. - */ - currencySymbol?: string; - /** - * Object with currency format details. - */ - 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; - }; - }; - /** - * Gift registry list information. - */ - giftRegistryData?: null | {}; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). - */ - openTextField?: null | string; - /** - * Object containing information pertinent to the order's invoice. - */ - invoiceData?: null | {}; - /** - * Customer additional information. - */ - customData?: null | {}; - /** - * Item metadata. - */ - itemMetadata?: null | {}; - /** - * Hooks information. - */ - hooksData?: null | {}; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: null | {}; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Object containing information about the ordering of items within the orderForm. - */ - itemsOrdination?: null | {}; - }; - }; - /** - * 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. - */ - "POST /api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData": - { - body: { - /** - * Locale chosen by the shopper. Determines website language. - */ - locale?: string; - /** - * Indicates whether the shopper opted in to receive the store's news letter. - */ - optinNewsLetter?: boolean; - }; - response: any; - }; - /** - * 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. - */ - "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"`. - */ - coupon?: string; - /** - * Marketing tags. Limited to a maximum of 50 items. - */ - marketingTags?: string[]; - /** - * UTM source. - */ - utmSource?: string; - /** - * UTM medium. - */ - utmMedium?: string; - /** - * UTM campaign - */ - utmCampaign?: string; - /** - * utmi_page (internal utm) - */ - utmiPage?: string; - /** - * utmi_part (internal utm) - */ - utmiPart?: string; - /** - * utmi_campaign (internal utm) - */ - 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. - * - * 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. - */ - "POST /api/checkout/pub/orderForm/:orderFormId/attachments/paymentData": { - body: { - /** - * Array with information on each payment chosen by the shopper. - */ - payments?: { - /** - * Payment system ID. - */ - paymentSystem?: number; - /** - * Payment system name. - */ - paymentSystemName?: string; - /** - * Payment system group. - */ - group?: string; - /** - * Selected number of installments. - */ - installments?: number; - /** - * Installments' interest rate. - */ - installmentsInterestRate?: number; - /** - * Value of the installments. - */ - installmentsValue?: number; - /** - * Total value assigned to this payment. - */ - value?: number; - /** - * Reference value used to calculate total order value with interest. - */ - referenceValue?: number; - /** - * Indicates whether billing address for this payment is the default address. - */ - 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. - * - * 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. - */ - "POST /api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData": - { - body: { - /** - * Sales Associate information. - */ - salesAssociateData: { - /** - * Sales Associate (Seller) identification code. All information should be registered by the merchant. Maximum of 100 characters. - */ - salesAssociateId?: string; - }; - }; - response: { - /** - * Sales Associate (Seller) identification code. - */ - 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`). - * - * 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": { - /** - * Here you must add the pairs of Field Name and Field Value. - */ - body: { - [k: string]: any; - }; - 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). - * - * 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": - { - 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. - */ - "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. - */ - "GET /api/checkout/pvt/configuration/orderForm": { - response: { - /** - * Payment configuration information. - */ - paymentConfiguration?: { - /** - * Determines whether pre-authorized payments require authentication. - */ - requiresAuthenticationForPreAuthorizedPaymentOption?: boolean; - /** - * By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installment options configured by every seller will be available. When indicated as `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those do not match. Installment values may not be equal in this case. - */ - allowInstallmentsMerge?: boolean; - }; - /** - * External tax service configuration information. - */ - taxConfiguration?: null | { - /** - * Endpoint URL. - */ - url?: null | string; - /** - * Authorization header. - */ - authorizationHeader?: null | string; - /** - * Custom data ID sent to the tax system. - */ - appId?: string; - }; - /** - * Minimum SKU quantity by cart. - */ - minimumQuantityAccumulatedForItems?: number; - /** - * Number of price digits. - */ - decimalDigitsPrecision?: number; - /** - * Minimum cart value. - */ - minimumValueAccumulated?: null | number; - /** - * Array of objects containing Apps configuration information. - */ - apps?: null | { - /** - * App ID. - */ - id?: string; - /** - * Array of fields available to the app. - */ - fields?: string[]; - /** - * App major version. - */ - major?: number; - }[]; - /** - * On the same purchase, allows the selection of items from multiple delivery channels. - */ - allowMultipleDeliveries?: null | boolean; - /** - * Allows the editing of SKU prices right in the cart. - */ - allowManualPrice?: null | boolean; - /** - * Allows users to select whether they want the store to keep their personal and payment data saved. - */ - savePersonalDataAsOptIn?: null | boolean; - /** - * Allows the input of a limit of white label sellers involved on the cart. - */ - maxNumberOfWhiteLabelSellers?: null | number; - /** - * Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client does not want to share its data. - */ - 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. - */ - recaptchaValidation?: string; - /** - * Indicates whether authentication is required for completing purchases. - */ - requiresLoginToPlaceOrder?: boolean; - /** - * Minimum interval (in seconds) between successive purchases. - */ - minimumPurchaseDowntimeSeconds?: number; - /** - * Minimum cart existence period (in seconds) before allowing the use of a new credit card. - */ - 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). - */ - "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. - */ - "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. - */ - "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. - * - * **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. - */ - "POST /api/checkout/pub/orderForm/:orderFormId/messages/clear": { - /** - * This object must be empty. - */ - body: {}; - response: { - /** - * ID of the orderForm corresponding to a specific cart. - */ - orderFormId?: string; - /** - * Attribute created by the seller, in their VTEX store configuration. - */ - salesChannel?: string; - /** - * Indicates whether the user is logged into the store. - */ - loggedIn?: boolean; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the store. - */ - storeId?: null | string; - /** - * Permission to modify item price manually. - */ - allowManualPrice?: boolean; - /** - * Data can be edited. - */ - canEditData?: boolean; - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: string; - /** - * Profile provider. - */ - profileProvider?: string; - /** - * Available accounts. - */ - availableAccounts?: string[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * User type. - */ - userType?: null | string; - /** - * Ignore customer profile data. - */ - ignoreProfileData?: boolean; - /** - * Total value of the order without separating cents. For example, $24.99 is represented `2499`. - */ - value?: number; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability. - */ - availability?: string; - /** - * Measurement unit. - */ - measurementUnit?: string; - /** - * Unit multiplier. - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). - */ - totalizers?: any[]; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: string; - /** - * Delivery channel selected by the customer. - */ - selectedDeliveryChannel?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, Three business days will be represented `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array with information on the available addresses for the order. - */ - availableAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - }; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Information on the order's payment. - */ - paymentData?: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode?: string; - /** - * Gift card value in cents. - */ - value?: number; - /** - * Gift card balance in cents. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Information on each transaction pertinent to the order. - */ - transactions?: { - /** - * Indicates whether transaction is active. - */ - isActive?: boolean; - /** - * Transaction ID. - */ - transactionId?: string; - /** - * Merchant name. - */ - merchantName?: string; - /** - * Information on each payment. - */ - payments?: { - /** - * Account ID. - */ - accountId?: string; - /** - * Bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments?: number; - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Reference value for calculating interest rates, in case it applies. Displayed in cents. - */ - referenceValue?: number; - /** - * Value including interest, in case it applies. Displayed in cents. - */ - value?: number; - }[]; - /** - * Indicates whather transaction is shared. - */ - sharedTransaction?: boolean; - }[]; - }; - /** - * Object containing promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: { - /** - * 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. - */ - coupon?: string; - /** - * UTM source. - */ - utmSource?: string; - /** - * UTM medium. - */ - utmMedium?: string; - /** - * UTM campaign - */ - utmCampaign?: string; - /** - * utmi_page (internal utm) - */ - utmiPage?: null | string; - /** - * utmi_part (internal utm). - */ - utmiPart?: null | string; - /** - * utmi_campaign (internal utm). - */ - utmiCampaign?: null | string; - }; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Object containing preferences from the client who placed the order. - */ - clientPreferencesData?: { - /** - * Client's locale. Examples: `pt-BR` and `en-US`. - */ - locale?: string; - /** - * `true` if the client opted to receive newsletter from the store. - */ - optinNewsLetter?: boolean; - }; - /** - * Object containing commercial condition information. - */ - commercialConditionData?: null | {}; - /** - * Object containing data from the store's configuration (stored in VTEX's License Manager). - */ - storePreferencesData?: {}; - /** - * Gift registry list information. - */ - giftRegistryData?: null | {}; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). - */ - openTextField?: null | string; - /** - * Object containing information pertinent to the order's invoice. - */ - invoiceData?: null | {}; - /** - * Customer additional information. - */ - customData?: null | {}; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - }[]; - }; - /** - * Hooks information. - */ - hooksData?: null | {}; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: string[]; - /** - * List with rates and benefits teasers. - */ - teaser?: string[]; - }; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Object containing information about the ordering of items within the orderForm. - */ - itemsOrdination?: { - /** - * Criteria adopted to order the items in the list. - */ - criteria?: string; - /** - * Indicates whether the ordering is ascending. - */ - ascending?: boolean; - }; - }; - }; - /** - * 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`. - */ - "GET /api/checkout/pub/orderForm/:orderFormId/installments": { - searchParams: { - /** - * ID of the payment method to be consulted for installments. - */ - 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"}. - * - * 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": { - body: { - /** - * Sending an existing coupon code in this field will return the corresponding discount in the purchase. - */ - text?: string; - }; - response: { - /** - * ID of the orderForm corresponding to a specific cart. - */ - orderFormId?: string; - /** - * Attribute created by the seller, in their VTEX store configuration. - */ - salesChannel?: string; - /** - * Indicates whether the user is logged into the store. - */ - loggedIn?: boolean; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the store. - */ - storeId?: null | string; - /** - * Permission to modify item price manually. - */ - allowManualPrice?: boolean; - /** - * Data can be edited. - */ - canEditData?: boolean; - /** - * Unique ID associated with the customer profile. - */ - userProfileId?: string; - /** - * Profile provider. - */ - profileProvider?: string; - /** - * Available accounts. - */ - availableAccounts?: string[]; - /** - * Information on each available address. - */ - availableAddresses?: { - /** - * Address type. - */ - addressType?: string; - /** - * Name of the receiver. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * City of the address. - */ - city?: string; - /** - * State of the address. - */ - state?: string; - /** - * Country of the address. ISO three-letter code. - */ - country?: string; - /** - * Street of the address. - */ - street?: string; - /** - * Number of the address. - */ - number?: string; - /** - * Neighborhood of the address. - */ - neighborhood?: string; - /** - * Complement to the address. - */ - complement?: null | string; - /** - * Reference that may help in the location of the address. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * User type. - */ - userType?: null | string; - /** - * Ignore customer profile data. - */ - ignoreProfileData?: boolean; - /** - * Total value of the order without separating cents. For example, $24.99 is represented `2499`. - */ - value?: number; - /** - * Array containing an object for each message generated by our servers while processing the request. - */ - messages?: any[]; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability - */ - availability?: string; - /** - * Measurement unit - */ - measurementUnit?: string; - /** - * Unit multiplier - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Array containing the data of the item selected as a gift. - */ - selectableGifts?: any[]; - /** - * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). - */ - totalizers?: any[]; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: string; - /** - * Delivery channel selected by the customer. - */ - selectedDeliveryChannel?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, Three business days will be represented `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array with information on the available addresses for the order. - */ - availableAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - }; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Information on the order's payment. - */ - paymentData?: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode?: string; - /** - * Gift card value in cents. - */ - value?: number; - /** - * Gift card balance in cents. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Information on each transaction pertinent to the order. - */ - transactions?: { - /** - * Indicates whether transaction is active. - */ - isActive?: boolean; - /** - * Transaction ID. - */ - transactionId?: string; - /** - * Merchant name. - */ - merchantName?: string; - /** - * Information on each payment. - */ - payments?: { - /** - * Account ID. - */ - accountId?: string; - /** - * Bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments?: number; - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Reference value for calculating interest rates, in case it applies. Displayed in cents. - */ - referenceValue?: number; - /** - * Value including interest, in case it applies. Displayed in cents. - */ - value?: number; - }[]; - /** - * Indicates whather transaction is shared. - */ - sharedTransaction?: boolean; - }[]; - }; - /** - * Object containIng promotion data such as coupon tracking information and internal or external UTMs. - */ - marketingData?: { - /** - * 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. - */ - coupon?: string; - /** - * UTM source. - */ - utmSource?: null | string; - /** - * UTM medium. - */ - utmMedium?: null | string; - /** - * UTM campaign. - */ - utmCampaign?: null | string; - /** - * utmi_page (internal utm). - */ - utmiPage?: null | string; - /** - * utmi_part (internal utm). - */ - utmiPart?: null | string; - /** - * utmi_campaign (internal utm). - */ - utmiCampaign?: null | string; - }; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Object containing preferences from the client who placed the order. - */ - clientPreferencesData?: { - /** - * Client's locale. Examples: `pt-BR` and `en-US`. - */ - locale?: string; - /** - * `true` if the client opted to receive newsletter from the store. - */ - optinNewsLetter?: boolean; - }; - /** - * Object containing commercial condition information. - */ - commercialConditionData?: null | {}; - /** - * Object containing data from the store's configuration (stored in VTEX's License Manager). - */ - storePreferencesData?: {}; - /** - * Gift registry list information. - */ - giftRegistryData?: null | {}; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1) - */ - openTextField?: null | string; - /** - * Object containing information pertinent to the order's invoice. - */ - invoiceData?: null | {}; - /** - * Customer additional information. - */ - customData?: null | {}; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - }[]; - }; - /** - * Hooks information. - */ - hooksData?: null | {}; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: string[]; - /** - * List with rates and benefits teasers. - */ - teaser?: string[]; - }; - /** - * Subscription information. - */ - subscriptionData?: null | {}; - /** - * Object containing information about the ordering of items within the orderForm. - */ - itemsOrdination?: { - /** - * Criteria adopted to order the items in the list. - */ - criteria?: string; - /** - * Indicates whether the ordering is ascending. - */ - 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. - */ - "GET /api/checkout/pub/pickup-points": { - searchParams: { - /** - * Geocoordinates (first longitude, then latitude) around which to search for pickup points. If you use this type of search, do not pass postal and country codes. - */ - geoCoordinates?: number[]; - /** - * Postal code around which to search for pickup points. If you use this type of search, make sure to pass a `countryCode` and do not pass `geoCoordinates`. - */ - postalCode?: string; - /** - * Three letter country code refering to the `postalCode` field. Pass the country code only if you are searching pickup points by postal code. - */ - countryCode?: string; - }; - }; - /** - * 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": {}; - /** - * 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. - */ - "POST /api/checkout/pub/orderForm/:orderFormId/transaction": { - body: { - referenceId: ReferenceId; - savePersonalData?: SavePersonalData; - optinNewsLetter?: OptinNewsLetter; - /** - * Total value of the order without separating cents. For example, $24.99 is represented `2499`. - */ - value: number; - /** - * Reference value of the order for calculating interest if that is the case. Can be equal to the total value and does not separate cents. For example, $24.99 is represented `2499`. - */ - referenceValue: number; - /** - * Interest rate to be used in case it applies. - */ - interestValue: number; - }; - 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. - * - * >⚠️ 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": { - searchParams: { - /** - * Trade Policy (Sales Channel) identification. This query can be used to create an order for a specific sales channel. - */ - sc?: number; - }; - body: { - /** - * Array of objects containing information on each of the order's items. - */ - items: { - /** - * The SKU ID. - */ - id: string; - /** - * The quantity of items of this specific SKU in the cart to be simulated. - */ - quantity: number; - /** - * The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin. - */ - seller: string; - /** - * Comission. - */ - commission?: number; - /** - * Freight comission - */ - freightCommission?: number; - /** - * Item price within the context of the order without separating cents. For example, $24.99 is represented `2499`. - */ - price?: number; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: string; - /** - * Service name. - */ - name?: string; - /** - * Service price. The last two digits are the cents. - */ - price?: number; - }[]; - /** - * Item attachment. - */ - itemAttachment?: { - /** - * Attachment name. - */ - name?: string; - /** - * Content referring to the customization requested by the customer. - */ - content?: string; - }; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * `true` if price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * SKU measurement unit. - */ - measurementUnit?: string; - /** - * SKU unit multiplier. - */ - unitMultiplier?: number; - /** - * Indicates whether the order is a gift. - */ - 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. - */ - clientProfileData: { - /** - * Customer's email address. - */ - 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 number informed by the customer. - */ - document?: string; - /** - * Customer's phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: string; - /** - * `true` if the customer is a legal entity. - */ - isCorporate?: boolean; - }; - /** - * Shipping information. - */ - 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. - */ - 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; - /** - * Address ID. - */ - addressId?: string; - /** - * Postal Code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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 in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array of objects containing logistics information of each item. - */ - logisticsInfo?: { - /** - * Index of the item in the `items` array, starting from 0. - */ - itemIndex: number; - /** - * Selected shipping option - */ - selectedSla: string; - /** - * String with the selected delivery channel. This field supports the following values: - * - * - `delivery`, - * - * - `pickup-in-point`. - */ - selectedDeliveryChannel?: string; - /** - * Logistics reservation waiting time. - */ - lockTTL?: string; - /** - * Estimated time until delivery for the item. - */ - shippingEstimate?: string; - /** - * Shipping price for the item. Does not account for the whole order's shipping price. - */ - price: number; - /** - * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. - */ - deliveryWindow?: { - /** - * Delivery window starting day and time in UTC. - */ - startDateUtc?: string; - /** - * Delivery window ending day and time in UTC. - */ - endDateUtc?: string; - /** - * Delivery window price. - */ - price?: number; - /** - * Delivery window list price. - */ - lisPrice?: number; - /** - * Delivery window tax. - */ - tax?: number; - }; - }[]; - /** - * Indicate whether this object's information is up to date according to the order's items. An order can not be placed if `"outdated"` - */ - updateStatus?: string; - }; - /** - * Payment infomation. - */ - paymentData: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode: string; - /** - * Gift card value. - */ - value: number; - /** - * Gift card balance. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Array of gift card messages. - */ - giftCardMessages?: string[]; - /** - * Information on payment systems. - */ - paymentSystems?: { - /** - * Payment system ID. - */ - id?: number; - /** - * Payment system name. - */ - name?: string; - /** - * Payment group name. - */ - groupName?: string; - /** - * Payment system validator. - */ - validator?: { - regex?: string; - /** - * Validator mask. - */ - mask?: string; - /** - * Card code regular expression. - */ - cardCodeRegex?: string; - /** - * Card code mask. - */ - cardCodeMask?: string; - /** - * Weights. - */ - weights?: number[]; - }; - /** - * String ID. - */ - stringId?: string; - /** - * Template. - */ - template?: string; - /** - * Indicates whether a document is required. - */ - requiresDocument?: boolean; - /** - * Indicates whether this payment system has been selected. - */ - selected?: boolean; - /** - * Indicates whether it is custom. - */ - isCustom?: boolean; - /** - * Description. - */ - description?: string; - }[]; - /** - * Payment information. - */ - payments: { - /** - * Account ID. - */ - accountId?: string; - /** - * Payment bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments: number; - /** - * Payment system. - */ - paymentSystem: string; - /** - * Reference value for calculating interest rates, in case it applies. - */ - referenceValue: number; - /** - * Value including interest, in case it applies. - */ - value: number; - }[]; - /** - * Indicates whether this object's information is up to date according to the order's items. An order can not be placed if `"outdated"` - */ - updateStatus?: string; - }; - marketingData?: { - /** - * 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. - */ - coupon?: string; - /** - * UTM source. - */ - utmSource?: string; - /** - * UTM medium. - */ - utmMedium?: string; - /** - * UTM campaign - */ - utmCampaign?: string; - /** - * utmi_page (internal utm) - */ - utmiPage?: string; - /** - * utmi_part (internal utm) - */ - utmiPart?: string; - /** - * utmi_campaign (internal utm) - */ - utmiCampaign?: string; - }; - /** - * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1) - */ - openTextField?: string; - /** - * Sales Associate information. - */ - salesAssociateData?: { - /** - * Sales Associate (Seller) identification code. All information should be registered by the merchant. Maximum of 100 characters. - */ - salesAssociateId?: string; - }; - minItems?: 0; - }; - response: { - /** - * This is `null` since this request does not depend on any previously existing orderForm information in the platform. - */ - orderForm?: null | string; - /** - * Information on each transaction pertinent to the order placed. - */ - transactionData?: { - /** - * Information on each merchant transaction. - */ - merchantTransactions?: { - /** - * ID of the seller. - */ - id?: string; - /** - * ID of the transaction in the platform. - */ - transactionId?: string; - /** - * Name of the merchant responsible for the sale. - */ - merchantName?: string; - /** - * Information on each payment pertinent to the transaction. - */ - payments?: { - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Payment bin. - */ - bin?: null | string; - /** - * Account ID. - */ - accountId?: null | string; - /** - * Token ID. - */ - tokenId?: null | string; - /** - * Total value to be paid in this payment. - */ - value?: number; - /** - * Reference value over which interests may be applied. - */ - referenceValue?: number; - /** - * Gift card redemption code. - */ - giftCardRedemptionCode?: null | string; - /** - * Gift card provider. - */ - giftCardProvider?: null | string; - /** - * Gift card ID. - */ - giftCardId?: null | string; - }[]; - }[]; - /** - * Receiver URI. - */ - receiverUri?: string; - /** - * Template of the gateway callback path, which may later be used to send information about the transaction. - */ - gatewayCallbackTemplatePath?: string; - }; - /** - * Information on each of the orders created. - */ - orders?: { - /** - * ID of the order in the Order Management System (OMS). - */ - orderId?: string; - /** - * Order group. Orders that involve different sellers are split into different orders of a same order group. - */ - orderGroup?: string; - /** - * State. - */ - state?: null | string; - /** - * Indicates whether order is checked in. - */ - isCheckedIn?: boolean; - /** - * ID of the order in the seller. - */ - sellerOrderId?: null | string; - /** - * Store ID. - */ - storeId?: null | string; - /** - * Checked in pickuppoint. - */ - checkedInPickupPointId?: null | string; - /** - * Value of the order. - */ - value?: number; - /** - * Information on each item in the order. - */ - items?: { - /** - * Unique ID. - */ - uniqueId?: string; - /** - * ID of the item. - */ - id?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Product Ref ID. - */ - productRefId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Modal type. - */ - modalType?: null | string; - /** - * Parent item index. - */ - parentItemIndex?: null | number; - /** - * Parent assembly binding. - */ - parentAssemblyBinding?: null | string; - /** - * Price expiration date and time. - */ - priceValidUntil?: string; - /** - * Tax value in cents. - */ - tax?: number; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Manual price in cents. - */ - manualPrice?: null | number; - /** - * User that applied the manual price, if that is the case. - */ - manualPriceAppliedBy?: null | string; - /** - * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. - */ - sellingPrice?: number; - /** - * Reward value in cents. - */ - rewardValue?: number; - /** - * Indicates whether item is a gift. - */ - isGift?: boolean; - /** - * Additional information. - */ - additionalInfo?: { - /** - * Dimension. - */ - dimension?: null | string; - /** - * Brand name. - */ - brandName?: string; - /** - * Brand ID. - */ - brandId?: string; - /** - * Offering information. - */ - offeringInfo?: null | string; - /** - * Offering type. - */ - offeringType?: null | string; - /** - * Offering type ID. - */ - offeringTypeId?: null | string; - }; - /** - * Presale date. - */ - preSaleDate?: null | string; - /** - * Product category IDs. - */ - productCategoryIds?: string; - /** - * Object, where each field is an ID from `productCategoryIds`. - */ - productCategories?: { - /** - * Product category corresponding to the ID in the field key. - */ - "{ID}"?: string; - }; - /** - * Quantity. - */ - quantity?: number; - /** - * Seller. - */ - seller?: string; - /** - * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/pt/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. - */ - sellerChain?: string[]; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - /** - * Information on services sold along with the SKU. Example: a gift package. - */ - bundleItems?: { - /** - * Service type. - */ - type?: string; - /** - * Service identifier. - */ - id?: number; - /** - * Service name. - */ - name?: string; - /** - * Service price in cents. - */ - price?: number; - }[]; - /** - * Array containing information on attachments. - */ - attachments?: string[]; - /** - * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. - */ - priceTags?: { - /** - * Price tag identifier. - */ - identifier?: string; - /** - * Indicates whether price tag value is applied through a percentage. - */ - isPercentual?: boolean; - /** - * Price tag name. - */ - name?: string; - /** - * Price tag raw value. - */ - rawValue?: number; - /** - * Price tag value. - */ - value?: number; - }[]; - /** - * Availability - */ - availability?: string; - /** - * Measurement unit - */ - measurementUnit?: string; - /** - * Unit multiplier - */ - unitMultiplier?: number; - /** - * Manufacturer code. - */ - manufacturerCode?: null | string; - /** - * Price information for all units of a specific item. - */ - priceDefinition?: { - /** - * Item's calculated unitary selling price in cents. - */ - calculatedSellingPrice?: number; - /** - * Total value for all units of the item in cents. - */ - total?: number; - /** - * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. - */ - sellingPrices?: { - /** - * Value in cents for that specific rounding. - */ - value?: number; - /** - * Rounding quantity, meaning how many items are rounded to this value. - */ - quantity?: number; - }[]; - }; - }[]; - /** - * Information on each seller. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - /** - * Information on order totals. - */ - totals?: { - /** - * Total ID. - */ - id?: string; - /** - * Total name. - */ - name?: string; - /** - * Total value. - */ - value?: number; - }[]; - /** - * Customer's profile information. - */ - clientProfileData?: { - /** - * Email address. - */ - email?: string; - /** - * First name. - */ - firstName?: string; - /** - * Last name. - */ - lastName?: string; - /** - * Type of the document informed by the customer. - */ - documentType?: string; - /** - * Document informed by the customer. - */ - document?: string; - /** - * Phone number. - */ - phone?: string; - /** - * Company name, if the customer is a legal entity. - */ - corporateName?: null | string; - /** - * Trade name, if the customer is a legal entity. - */ - tradeName?: null | string; - /** - * Corporate document, if the customer is a legal entity. - */ - corporateDocument?: null | string; - /** - * State inscription, if the customer is a legal entity. - */ - stateInscription?: null | string; - /** - * Corporate phone number, if the customer is a legal entity. - */ - corporatePhone?: null | string; - /** - * Indicates whether the customer is a legal entity. - */ - isCorporate?: boolean; - /** - * Indicates whether profile is complete on loading. - */ - profileCompleteOnLoading?: boolean; - /** - * Indicates whether profile presents error on loading. - */ - profileErrorOnLoading?: null | boolean; - /** - * Customer class. - */ - customerClass?: null | string; - }; - /** - * Information on rates and benefits that apply to the order. - */ - ratesAndBenefitsData?: { - /** - * List with rates and benefits identifiers. - */ - rateAndBenefitsIdentifiers?: string[]; - /** - * List with rates and benefits teasers. - */ - teaser?: string[]; - }; - /** - * Shipping information pertinent to the order. - */ - shippingData?: { - /** - * Address information. - */ - address?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. - */ - logisticsInfo?: { - /** - * Index corresponding to the position of the object in the `items` array. - */ - itemIndex?: number; - /** - * SLA selected by the customer. - */ - selectedSla?: string; - /** - * Delivery channel selected by the customer. For example, `"delivery"` or `"pickup-in-point"`. - */ - selectedDeliveryChannel?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Information on available SLAs. - */ - slas?: { - /** - * SLA ID. - */ - id?: string; - /** - * Delivery channel. - */ - deliveryChannel?: string; - /** - * SLA name. - */ - name?: string; - /** - * Information on each delivery ID. - */ - deliveryIds?: { - /** - * Courier ID. - */ - courierId?: string; - /** - * Warehouse ID. - */ - warehouseId?: string; - /** - * Warehouse ID. - */ - dockId?: string; - /** - * Courier name. - */ - courierName?: string; - /** - * Quantity. - */ - quantity?: number; - }[]; - /** - * Shipping estimate. For instance, Three business days will be represented `3bd`. - */ - shippingEstimate?: string; - /** - * Shipping estimate date. - */ - shippingEstimateDate?: null | string; - /** - * Estimate date of delivery. - */ - lockTTL?: string; - /** - * Price in cents. - */ - price?: number; - /** - * List price in cents. - */ - listPrice?: number; - /** - * Tax in cents. - */ - tax?: number; - /** - * Information on the pickup store. - */ - pickupStoreInfo?: { - /** - * Indicates whether it is the pickup store. - */ - isPickupStore?: boolean; - /** - * Friendly name. - */ - friendlyName?: null | string; - /** - * Address information. - */ - address?: null | { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: null | string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }; - /** - * Additional information. - */ - additionalInfo?: null | string; - /** - * Corresponding dock ID. - */ - dockId?: null | string; - }; - /** - * Pickup point ID. - */ - pickupPointId?: null | string; - /** - * Pickup point distance. - */ - pickupDistance?: number; - /** - * Polygon name. - */ - polygonName?: null | string; - /** - * Transit time. For instance, "three business days" is represented `3bd`. - */ - transitTime?: string; - }[]; - /** - * List of countries that the item may be shipped to. - */ - shipsTo?: string[]; - /** - * Item ID. - */ - itemId?: string; - /** - * List of available delivery channels. - */ - deliveryChannels?: { - /** - * Delivery channel ID. - */ - id?: string; - }[]; - }[]; - /** - * Array with information on the selected addresses for the order. - */ - selectedAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - /** - * Array with information on the available addresses for the order. - */ - availableAddresses?: { - /** - * Type of address. For example, `Residential` or `Pickup`. - */ - addressType?: string; - /** - * Name of the person who is going to receive the order. - */ - receiverName?: string; - /** - * Address ID. - */ - addressId?: string; - /** - * Indicates whether address is disposable. - */ - isDisposable?: boolean; - /** - * Postal code. - */ - postalCode?: string; - /** - * City of the shipping address. - */ - city?: string; - /** - * State of the shipping address. - */ - state?: string; - /** - * Three letter ISO code of the country of the shipping address. - */ - 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, in case it applies. - */ - complement?: string; - /** - * Complement that might help locate the shipping address more precisely in case of delivery. - */ - reference?: null | string; - /** - * Array containing two floats with geocoordinates, first longitude, then latitude. - */ - geoCoordinates?: number[]; - }[]; - }; - /** - * Information on the order's payment. - */ - paymentData?: { - /** - * Gift card information, if it applies to the order. - */ - giftCards?: { - /** - * Gift card redemption code. - */ - redemptionCode?: string; - /** - * Gift card value in cents. - */ - value?: number; - /** - * Gift card balance in cents. - */ - balance?: number; - /** - * Gift card name. - */ - name?: string; - /** - * Gift card ID. - */ - id?: string; - /** - * Indicates whether gift card is in use. - */ - inUse?: boolean; - /** - * Indicates whether gift card is special. - */ - isSpecialCard?: boolean; - }[]; - /** - * Information on each transaction pertinent to the order. - */ - transactions?: { - /** - * Indicates whether transaction is active. - */ - isActive?: boolean; - /** - * Transaction ID. - */ - transactionId?: string; - /** - * Merchant name. - */ - merchantName?: string; - /** - * Information on each payment. - */ - payments?: { - /** - * Account ID. - */ - accountId?: string; - /** - * Bin. - */ - bin?: string; - /** - * Number of installments. - */ - installments?: number; - /** - * Payment system. - */ - paymentSystem?: string; - /** - * Reference value for calculating interest rates, in case it applies. Displayed in cents. - */ - referenceValue?: number; - /** - * Value including interest, in case it applies. Displayed in cents. - */ - value?: number; - }[]; - /** - * Indicates whather transaction is shared. - */ - sharedTransaction?: boolean; - }[]; - }; - /** - * Item metadata. - */ - itemMetadata?: { - /** - * List of objects containing metadata on each item in the order. - */ - items?: { - /** - * Item ID. - */ - id?: string; - /** - * Seller. - */ - seller?: string; - /** - * Product name. - */ - name?: string; - /** - * SKU name. - */ - skuName?: string; - /** - * Product ID. - */ - productId?: string; - /** - * Ref ID. - */ - refId?: string; - /** - * European Article Number. - */ - ean?: null | string; - /** - * Image URL. - */ - imageUrl?: string; - /** - * Detail URL. - */ - detailUrl?: string; - }[]; - }; - /** - * Sales channel. - */ - salesChannel?: string; - /** - * Follow up email address. - */ - followUpEmail?: string; - /** - * Creation date. - */ - creationDate?: string; - /** - * Last change. - */ - lastChange?: string; - /** - * Time zone creation date. - */ - timeZoneCreationDate?: string; - /** - * Time zone last change. - */ - timeZoneLastChange?: string; - /** - * Indicates whether order is completed. - */ - isCompleted?: boolean; - /** - * Host name. - */ - hostName?: string; - /** - * Merchant name. - */ - merchantName?: null | string; - /** - * User type. - */ - userType?: string; - /** - * Rounding error. - */ - roundingError?: number; - /** - * Indicates whether edition is allowed. - */ - allowEdition?: boolean; - /** - * Indicates whether cancelation is allowed. - */ - allowCancelation?: boolean; - /** - * Indicates whether seller changing is allowed. - */ - allowChangeSeller?: boolean; - /** - * Indicates whether user data is visible. - */ - isUserDataVisible?: boolean; - /** - * `orderForm` creation date. - */ - orderFormCreationDate?: string; - /** - * Sales Associate (Seller) identification code. - */ - 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. - */ - "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. - */ - "GET /api/checkout/pub/regions/:regionId": { - searchParams: { - /** - * Three letter country code refering to the `postalCode` field. - */ - country: string; - /** - * Postal code corresponding to the shopper's location. - */ - postalCode?: string; - /** - * Geocoordinates (first longitude, semicolon, then latitude) corresponding to the shopper's location. - */ - geoCoordinates?: number[]; - }; - response: { - /** - * Region ID. - */ - id?: string; - /** - * Array with information on each seller retrieved for the given region. - */ - sellers?: { - /** - * Seller ID. - */ - id?: string; - /** - * Seller name. - */ - name?: string; - /** - * Seller logo. - */ - logo?: null | string; - }[]; - }; - }; -} -export interface GetorUpdateProductSpecification { - /** - * Array with Specification values. - */ - Value: string[]; - /** - * Specification field ID, which is the same as `FieldId` in other specification endpoints. - */ - Id?: number; - /** - * Name of the Specification. - */ - Name?: string; -} -export interface GetSKUandContext { - /** - * SKU ID. - */ - Id: number; - /** - * ID of the related Product. - */ - ProductId: number; - /** - * Product Name and SKU Name concatenated. - */ - NameComplete: string; - /** - * Product Complement Name. - */ - ComplementName?: string; - /** - * Product Name. - */ - ProductName: string; - /** - * Product Description. HTML is allowed. - */ - ProductDescription: string; - /** - * Reference ID of the related Product. - */ - ProductRefId?: string; - /** - * SKU Tax Code. - */ - TaxCode?: string; - /** - * SKU Name. - */ - SkuName: string; - /** - * Defines if the SKU is active or not. - */ - IsActive: boolean; - /** - * @deprecated - */ - IsTransported: boolean; - /** - * @deprecated - */ - IsInventoried: boolean; - /** - * Defines if the purchase will generate a reward. - */ - IsGiftCardRecharge: boolean; - /** - * SKU image URL. - */ - ImageUrl: string; - /** - * Product URL. - */ - DetailUrl: string; - /** - * SKU Seller identification. - */ - CSCIdentification: string; - /** - * Product Brand ID. - */ - BrandId: string; - /** - * Product Brand Name. - */ - BrandName: string; - Dimension: Dimension; - RealDimension: RealDimension; - /** - * Product Supplier ID. - */ - ManufacturerCode: string; - /** - * Defines if the SKU is part of a bundle. - */ - IsKit: boolean; - /** - * Array with SKU IDs of bundle components. - */ - KitItems: string[]; - /** - * Array with Service IDs that are related to the SKU. - */ - Services: string[]; - /** - * Array with Categories from the related Product. - */ - Categories: string[]; - /** - * Array with Attachments ID that are related to the SKU. - */ - Attachments: Attachment[]; - /** - * Array with Collections ID that are related to the Product. - */ - Collections: string[]; - /** - * Array with SKU Sellers data. - */ - SkuSellers: SkuSeller[]; - /** - * Array with the ID of all the Sales Channels that are related to the product. - */ - SalesChannels: number[]; - /** - * Array with SKU images. - */ - Images: Image[]; - /** - * Array with related SKU Specifications. - */ - SkuSpecifications: SkuSpecification[]; - /** - * Array with related Product Specifications. - */ - ProductSpecifications: ProductSpecification[]; - ProductClusterNames?: { - /** - * Collection ID - */ - [k: string]: string; - }; - /** - * Product Clusters IDs. - */ - ProductClustersIds: string; - /** - * Category Hierarchy with Category IDs. - */ - ProductCategoryIds: string; - /** - * Global Category ID. - */ - ProductGlobalCategoryId: number; - /** - * Object containing product categories. Structure: "{CategoryID}": "{CategoryName}". - */ - ProductCategories: { - /** - * Category ID. - */ - [k: string]: string; - }; - /** - * SKU Commercial Condition ID. - */ - CommercialConditionId: number; - /** - * Reward value related to the SKU. - */ - RewardValue: number; - AlternateIds: AlternateIds; - /** - * Array with values of alternative SKU IDs. - */ - AlternateIdValues: string[]; - /** - * To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival: string; - /** - * SKU Measurement Unit. - */ - MeasurementUnit: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier: number; - /** - * Information Source. - */ - InformationSource: string; - /** - * Modal Type. - */ - ModalType: string; - /** - * Keywords related to the product. - */ - KeyWords?: string; - /** - * Release date of the product. - */ - ReleaseDate?: string; - /** - * Defines if the product is visible or not. - */ - ProductIsVisible?: boolean; - /** - * Defines if the product will be shown if it is not available. - */ - ShowIfNotAvailable?: boolean; - /** - * Defines if the product is active or not. - */ - IsProductActive?: boolean; - /** - * Product Final Score. - */ - ProductFinalScore?: number; -} /** - * Object containing the SKU dimensions to be used on the shipping calculation. + * 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. */ -export interface Dimension { - /** - * SKU Cubic Weight. - */ - cubicweight: number; - /** - * SKU Height. - */ - height: number; - /** - * SKU Length. - */ - length: number; - /** - * SKU Weight. - */ - weight: number; - /** - * SKU Width. - */ - width: number; -} +"GET /api/rnb/pvt/calculatorconfiguration/:idCalculatorConfiguration": { +response: { /** - * Object containing the real SKU dimensions, which appear in the product page. + * Promotion ID. */ -export interface RealDimension { - /** - * Real SKU Cubic Weight. - */ - realCubicWeight: number; - /** - * Real SKU Height. - */ - realHeight: number; - /** - * Real SKU Length. - */ - realLength: number; - /** - * Real SKU Weight. - */ - realWeight: number; - /** - * Real SKU Width. - */ - realWidth: number; -} +idCalculatorConfiguration?: string /** - * Object containing information about SKU attachments. + * Promotion Name. */ -export interface Attachment { - /** - * Attachment ID. - */ - Id: number; - /** - * Attachment Name. - */ - Name: string; - /** - * Attachment Keys. - */ - Keys: string[]; - /** - * Array containing Attachment fields. - */ - Fields: Field[]; - /** - * Defines if the Attachment is active or not. - */ - IsActive: boolean; - /** - * Defines if the Attachment is required or not. - */ - IsRequired: boolean; -} -export interface Field { - /** - * Attachment field name. - */ - FieldName: string; - /** - * Maximum number of characters accepted in the attachment field. - */ - MaxCaracters: string; - /** - * Allowed key values. - */ - DomainValues: string; -} +name?: string /** - * Object containing related SKU Sellers data. + * Promotion internal description. */ -export interface SkuSeller { - /** - * SKU Seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. - */ - SellerId: string; - /** - * SKU ID. - */ - StockKeepingUnitId: number; - /** - * SKU ID for the SKU Seller. - */ - SellerStockKeepingUnitId: string; - /** - * Defines if the SKU is active. - */ - IsActive: boolean; - /** - * Registered value for Seller Freight Commission. - */ - FreightCommissionPercentage: number; - /** - * Registered value for Seller Product Commission. - */ - ProductCommissionPercentage: number; -} +description?: string /** - * Object containing SKU images details. + * Promotion Begin Date (UTC). */ -export interface Image { - /** - * Image URL. - */ - ImageUrl: string; - /** - * Image label. - */ - ImageName: string; - /** - * SKU image ID. - */ - FileId: number; -} +beginDateUtc?: string /** - * Object containing related SKU Specifications. + * Promotion End Date (UTC). */ -export interface SkuSpecification { - /** - * Specification field ID. - */ - FieldId: number; - /** - * Specification field Name. - */ - FieldName: string; - /** - * Array with related Specification Values IDs. - */ - FieldValueIds: number[]; - /** - * Array with related Specification Values. - */ - FieldValues: string[]; -} -export interface ProductSpecification { - /** - * Specification field ID. - */ - FieldId: number; - /** - * Specification name. Limited to 100 characters. - */ - FieldName: string; - /** - * Array with related Specification Values IDs. - */ - FieldValueIds: number[]; - /** - * Array with related Specification Values. - */ - FieldValues: string[]; -} +endDateUtc?: string /** - * Array with alternate SKU IDs, such as EAN and RefId. + * When the Promotion was last modified. */ -export interface AlternateIds { - /** - * SKU EAN. - */ - Ean?: string; - /** - * SKU Reference ID. - */ - RefId?: string; -} -export interface GetSKUAltID { - /** - * SKU ID. - */ - Id: number; - /** - * Product ID. - */ - ProductId: number; - /** - * Product Name and SKU Name combined. - */ - NameComplete: string; - /** - * Product Complement Name. - */ - ComplementName?: string; - /** - * Product Name. - */ - ProductName: string; - /** - * Product Description. HTML is allowed. - */ - ProductDescription: string; - /** - * Product Reference ID. - */ - ProductRefId?: string; - /** - * SKU Tax Code. - */ - TaxCode?: string; - /** - * SKU Name. - */ - SkuName: string; - /** - * Defines if the SKU is active or not. - */ - IsActive: boolean; - /** - * @deprecated - */ - IsTransported: boolean; - /** - * @deprecated - */ - IsInventoried: boolean; - /** - * Defines if the purchase of the SKU will generate reward value for the customer. - */ - IsGiftCardRecharge: boolean; - /** - * SKU image URL. - */ - ImageUrl: string; - /** - * Product slug. - */ - DetailUrl: string; - /** - * SKU Seller Identification. - */ - CSCIdentification: string; - /** - * Brand ID. - */ - BrandId: string; - /** - * Brand Name. - */ - BrandName: string; - Dimension: Dimension; - RealDimension: RealDimension; - /** - * Product Supplier ID. - */ - ManufacturerCode: string; - /** - * Defines if the SKU is part of a bundle. - */ - IsKit: boolean; - /** - * Array with SKU IDs of bundle components. - */ - KitItems: string[]; - /** - * Array with Service IDs that are related to the SKU. - */ - Services: string[]; - /** - * Categories of the related product. - */ - Categories: string[]; - /** - * Path of Categories of the related product. - */ - CategoriesFullPath?: string[]; - /** - * Array with Attachments ID that are related to the SKU. - */ - Attachments: Attachment[]; - /** - * Array with Collections IDs that are related to the Product. - */ - Collections: string[]; - /** - * Array with related Sellers data. - */ - SkuSellers: SkuSeller[]; - /** - * Array of trade policy IDs. - */ - SalesChannels: number[]; - /** - * Array of objects with SKU image details. - */ - Images: Image[]; - /** - * Array with related SKU Specifications. - */ - SkuSpecifications: SkuSpecification[]; - /** - * Array with related Product Specifications. - */ - ProductSpecifications: ProductSpecification[]; - /** - * Product Cluster IDs separated by comma (`,`). - */ - ProductClustersIds: string; - /** - * Product Clusters position in each Cluster. Structure: "{Product Cluster ID}": {Position}. - * - * `{Product Cluster ID}` is a string, while `{Position}` is an integer. - */ - PositionsInClusters?: { - /** - * Product Cluster ID. - */ - [k: string]: number; - }; - /** - * Product Clusters Names. Structure: "{Product Cluster ID}": "{Product Cluster Name}". Both the key and the value are strings. - */ - ProductClusterNames?: { - /** - * Product Cluster ID. - */ - [k: string]: string; - }; - /** - * Product Clusters Highlights. Structure: "{Product Cluster ID}": "{Product Cluster Name}". Both the key and the value are strings. - */ - ProductClusterHighlights?: { - /** - * Product Cluster ID. - */ - [k: string]: string; - }; - /** - * Category path composed by category IDs separated by `/`. - */ - ProductCategoryIds: string; - /** - * Indicates if the direct Product Category is active or not. - */ - IsDirectCategoryActive?: boolean; - /** - * Product Global Category ID. - */ - ProductGlobalCategoryId: number; - /** - * Object containing product categories. Structure: "{CategoryID}": "{CategoryName}". Both the key and the value are strings. - */ - ProductCategories: { - /** - * Category ID. - */ - [k: string]: string; - }; - /** - * SKU Commercial Condition ID. - */ - CommercialConditionId: number; - /** - * Reward value related to the SKU. - */ - RewardValue: number; - AlternateIds: AlternateIds; - /** - * Array with values of alternative SKU IDs. - */ - AlternateIdValues: string[]; - /** - * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival: string; - /** - * Measurement unit. - */ - MeasurementUnit: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier: number; - /** - * Information Source. - */ - InformationSource: string; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType: string; - /** - * Keywords related to the product. - */ - KeyWords?: string; - /** - * Release date of the product. - */ - ReleaseDate?: string; - /** - * Defines if the product is visible or not. - */ - ProductIsVisible?: boolean; - /** - * Defines if the product will be shown if it is not available. - */ - ShowIfNotAvailable?: boolean; - /** - * Defines if the product is active or not. - */ - IsProductActive?: boolean; - /** - * Product Final Score. - */ - ProductFinalScore?: number; -} -export interface SkulistbyProductId { - /** - * Defines if the SKU is persisted. - */ - IsPersisted?: boolean; - /** - * @deprecated - * Defines if the SKU is removed. - */ - IsRemoved?: boolean; - /** - * SKU ID. - */ - Id?: number; - /** - * Product ID. - */ - ProductId?: number; - /** - * Defines if the SKU is active or not. - */ - IsActive?: boolean; - /** - * SKU Name. - */ - Name?: string; - /** - * SKU Height. - */ - Height?: number; - /** - * Real SKU Height. - */ - RealHeight?: number; - /** - * SKU Width. - */ - Width?: number; - /** - * Real SKU Width. - */ - RealWidth?: number; - /** - * SKU Length. - */ - Length?: number; - /** - * Real SKU Length. - */ - RealLength?: number; - /** - * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - WeightKg?: number; - /** - * Real Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. - */ - RealWeightKg?: number; - /** - * Delivery Method (Modal Type) ID. - */ - ModalId?: number; - /** - * Product Reference ID. - */ - RefId?: string; - /** - * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). - */ - CubicWeight?: number; - /** - * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. - */ - IsKit?: boolean; - /** - * @deprecated - */ - IsDynamicKit?: string; - /** - * Internal note. - */ - InternalNote?: string; - /** - * Date when the product was updated for the most recent time. - */ - DateUpdated?: string; - /** - * Reward value related to the SKU. - */ - RewardValue?: number; - /** - * SKU Commercial Condition ID. - */ - CommercialConditionId?: number; - /** - * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. - */ - EstimatedDateArrival?: string; - /** - * Defines if the SKU bundle items can be sold separately. - */ - FlagKitItensSellApart?: boolean; - /** - * Product Supplier ID. - */ - ManufacturerCode?: string; - /** - * SKU Reference ID. - */ - ReferenceStockKeepingUnitId?: string; - /** - * SKU Position. - */ - Position?: number; - /** - * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. - */ - ActivateIfPossible?: boolean; - /** - * Measurement unit. - */ - MeasurementUnit?: string; - /** - * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. - */ - UnitMultiplier?: number; - /** - * @deprecated - */ - IsInventoried?: boolean; - /** - * @deprecated - */ - IsTransported?: boolean; - /** - * Defines if the purchase of the SKU will generate reward value for the customer. - */ - IsGiftCardRecharge?: boolean; - /** - * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). - */ - ModalType?: string; - /** - * Defines if the SKU is a Optimized bundle. - */ - isKitOptimized?: boolean; -} -export interface SKUFileURL { - /** - * Defines if the Image is the main image of the SKU. - */ - IsMain?: boolean; - /** - * SKU image label. - */ - Label?: string; - /** - * SKU image name. - */ - Name: string; - /** - * General text of the image. - */ - Text?: string; - /** - * External Image's URL. The URL must start with the protocol identifier (`http://` or `https://`) and end with the file extension (`.jpg`, `.png` or `.gif`). - */ - Url: string; -} -export interface SkuKit { - /** - * SKU Kit ID, same as `StockKeepingUnitParent`. - */ - Id?: number; - /** - * Parent SKU ID. - */ - StockKeepingUnitParent?: number; - /** - * SKU ID of the kit component. - */ - StockKeepingUnitId?: number; - /** - * Component quantity. - */ - Quantity?: number; - /** - * Component price per unit. - */ - UnitPrice?: number; -} -export interface SKUService { - /** - * SKU Service ID. - */ - Id?: number; - /** - * SKU Service Type ID. - */ - SkuServiceTypeId?: number; - /** - * SKU Service Value ID. - */ - SkuServiceValueId?: number; - /** - * SKU ID. - */ - SkuId?: number; - /** - * SKU Service Name. Maximum of 50 characters. - */ - Name?: string; - /** - * Internal description of the SKU Service. Maximum of 100 characters. - */ - Text?: string; - /** - * Defines if the SKU Service is active or not. - */ - IsActive?: boolean; -} -export interface SKUServiceTypeRequest { - /** - * SKU Service Type Name. Maximum of 100 characters. - */ - Name: string; - /** - * Defines if the SKU Service Type is active or not. - */ - IsActive: boolean; - /** - * @deprecated - * Deprecated - */ - ShowOnProductFront: boolean; - /** - * Defines if the SKU Service Type is displayed on the cart screen. - */ - ShowOnCartFront: boolean; - /** - * Defines if the SKU Service Type has an attachment. - */ - ShowOnAttachmentFront: boolean; - /** - * Defines if the SKU Service Type can be associated with an attachment or not. - */ - ShowOnFileUpload: boolean; - /** - * Defines if the SKU Service Type is displayed as a Gift Card. - */ - IsGiftCard: boolean; - /** - * Defines if the SKU Service type is mandatory. - */ - IsRequired: boolean; -} -export interface SKUServiceTypeResponse { - /** - * SKU Service Type ID. - */ - Id?: number; - /** - * SKU Service Type Name. Maximum of 100 characters. - */ - Name?: string; - /** - * Defines if the SKU Service Type is active or not. - */ - IsActive?: boolean; - /** - * @deprecated - * Deprecated. - */ - ShowOnProductFront?: boolean; - /** - * Defines if the SKU Service Type is displayed on the cart screen. - */ - ShowOnCartFront?: boolean; - /** - * Defines if the SKU Service Type has an attachment. - */ - ShowOnAttachmentFront?: boolean; - /** - * Defines if the SKU Service Type can be associated with an attachment or not. - */ - ShowOnFileUpload?: boolean; - /** - * Defines if the SKU Service Type is displayed as a Gift Card. - */ - IsGiftCard?: boolean; - /** - * Defines if the SKU Service type is mandatory. - */ - IsRequired?: boolean; -} -export interface SKUServiceValueRequest { - /** - * SKU Service Type ID. - */ - SkuServiceTypeId: number; - /** - * SKU Service Value name. Maximum of 100 characters. - */ - Name: string; - /** - * SKU Service Value value. - */ - Value: number; - /** - * SKU Service Value cost. - */ - Cost: number; -} -export interface SKUServiceValueResponse { - /** - * SKU Service Value ID. - */ - Id?: number; - /** - * SKU Service Type ID. - */ - SkuServiceTypeId: number; - /** - * SKU Service Value name. Maximum of 100 characters. - */ - Name: string; - /** - * SKU Service Value value. - */ - Value: number; - /** - * SKU Service Value cost. - */ - Cost: number; -} -export interface SKUSpecificationResponse { - /** - * ID of the association of the specification and the SKU. This ID is used to update or delete the specification. - */ - Id?: number; - /** - * SKU ID. - */ - SkuId?: number; - /** - * Specification field ID. - */ - FieldId?: number; - /** - * Specification Value ID. Required only for `FieldTypeId` as `5`, `6` and `7`. - */ - FieldValueId?: number; - /** - * Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`. - */ - Text?: string; -} -export interface GetCategoryTree { - /** - * Category ID. - */ - id: number; - /** - * Category name. - */ - name: string; - /** - * If the category has a category child (`true`) or not (`false`). - */ - hasChildren: boolean; - /** - * Category URL. - */ - url: string; - /** - * Array with information about the category's children. - */ - children: GetCategoryTreeChild[]; - /** - * Category page title. - */ - Title: string; - /** - * Category page Meta tag description. - */ - MetaTagDescription: string; -} -export interface GetCategoryTreeChild { - /** - * Category ID. - */ - id: number; - /** - * Category name. - */ - name: string; - /** - * If the category has a category child (`true`) or not (`false`). - */ - hasChildren: boolean; - /** - * Category URL. - */ - url: string; - /** - * Array with information about the category's children. - */ - children: any[]; - /** - * Category page title. - */ - Title: string; - /** - * Category page Meta tag description. - */ - MetaTagDescription: string; -} -export interface Category { - /** - * Category ID. - */ - Id: number; - /** - * Category name. - */ - Name: string; - /** - * ID of the father category, apply in case of category and subcategory. - */ - FatherCategoryId: number; - /** - * Category page title. - */ - Title: string; - /** - * Describes details about the category. - */ - Description: string; - /** - * Substitutes words for the category. - */ - Keywords: string; - /** - * Shows if the category is active (`true`) or not (`false`). - */ - IsActive: boolean; - /** - * @deprecated - * This is a legacy field. Do not take this information into consideration. - */ - LomadeeCampaignCode: string; - /** - * @deprecated - * This is a legacy field. Do not take this information into consideration. - */ - AdWordsRemarketingCode: string; - /** - * Defines if the category is shown on side and upper menu (`true`) or not (`false`). - */ - ShowInStoreFront: boolean; - /** - * Defines if the category has brand filter (`true`) or not (`false`). - */ - ShowBrandFilter: boolean; - /** - * Defines if the Category has an active link on the website (`true`) or not (`false`). - */ - ActiveStoreFrontLink: boolean; - /** - * Google Global Category ID. - */ - GlobalCategoryId: number; - /** - * Defines how the SKU will be exhibited. - */ - StockKeepingUnitSelectionMode: string; - /** - * Score for search ordination. - */ - Score: number; - /** - * Text Link. - */ - LinkId: string; - /** - * Defines if the category has child categories (`true`) or not (`false`). - */ - HasChildren: boolean; -} -export interface CreateCategoryRequest { - /** - * Category unique identifier. If not informed, it will be automatically generated by VTEX. - */ - Id?: number; - /** - * Category name. - */ - Name: string; - /** - * Substitute words for the Category. - */ - Keywords: string; - /** - * Text used in title tag for Category page. - */ - Title: string; - /** - * Text used in meta description tag for Category page. - */ - Description: string; - /** - * @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; - /** - * ID of the parent category, apply in case of category and subcategory. - */ - FatherCategoryId: number; - /** - * Google Global Category ID. - */ - GlobalCategoryId: number; - /** - * If true, the Category is shown in the top and side menu. - */ - ShowInStoreFront: boolean; - /** - * If true, the Category page becomes available in store. - */ - IsActive: boolean; - /** - * If true, the Category link becomes active in store. - */ - ActiveStoreFrontLink: boolean; - /** - * If true, the Category page displays a Brand filter. - */ - ShowBrandFilter: boolean; - /** - * Score for search sorting order. - */ - Score: number; - /** - * Defines how the SKU will be exhibited - */ - StockKeepingUnitSelectionMode: string; -} +lastModified?: string /** - * Object containing Brand information. + * Number of days that are considered to add the purchase history. */ -export interface BrandGet { - /** - * Brand's unique numerical identifier. - */ - id: number; - /** - * Brand name. - */ - name: string; - /** - * Defines if the brand is active (`true`) or not (`false`). - */ - isActive: boolean; - /** - * Meta Title for the Brand page. - */ - title: string; - /** - * Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description. - */ - metaTagDescription: string; - /** - * URL of the brand's image. - */ - imageUrl: string; -} +daysAgoOfPurchases?: number /** - * Object containing Brand information. + * If set as `true` the Promotion is activated. If set as `false` the Promotion is deactivated. */ -export interface BrandCreateUpdate { - /** - * Brand's unique numerical identifier. - */ - Id: number; - /** - * Brand name. - */ - Name: string; - /** - * Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description. - */ - 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. - */ - Keywords?: string; - /** - * Meta Title for the Brand page. - */ - SiteTitle?: string; - /** - * @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; - /** - * 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 (``). - */ - MenuHome?: boolean; - /** - * Defines if the brand is active (`true`) or not (`false`). - */ - Active?: boolean; - /** - * Brand page slug. Only lowercase letters and hyphens (`-`) are allowed. - */ - LinkId?: string; -} -export interface AttachmentResponse { - /** - * Attachment ID. - */ - Id: number; - /** - * Attachment Name. - */ - Name: string; - /** - * Defines if the attachment is required or not. - */ - IsRequired: boolean; - /** - * Defines if the attachment is active or not. - */ - IsActive: boolean; - /** - * List of characteristics related to the attachment. - */ - Domains: { - /** - * Attachment key name. - */ - FieldName?: string; - /** - * Maximum number of characters in the attachment key. - */ - MaxCaracters?: string; - /** - * Allowed key values. - */ - DomainValues?: string; - }[]; -} -export interface AttachmentRequest { - /** - * Attachment Name. - */ - Name: string; - /** - * Defines if the attachment is required or not. - */ - IsRequired: boolean; - /** - * Defines if the attachment is active or not. - */ - IsActive: boolean; - /** - * List of characteristics related to the attachment. - */ - Domains: { - /** - * Attachment key name. - */ - FieldName?: string; - /** - * Maximum number of characters in the attachment key. - */ - MaxCaracters?: string; - /** - * Allowed key values. - */ - DomainValues?: string; - }[]; -} -export interface SpecificationsInsertFieldRequest { - /** - * Specification Field name. Limited to 100 characters. - */ - Name: string; - /** - * Category ID. - */ - CategoryId: number; - /** - * Specification Field ID. - */ - FieldId: number; - /** - * Defines if the Specification Field is active. The default value is `true`. - */ - IsActive: boolean; - /** - * Makes the Specification Field mandatory (`true`) or optional (`false`). - */ - IsRequired: boolean; - /** - * Specification Field Type ID. - */ - FieldTypeId: number; - /** - * Specification Field Value ID. - */ - FieldValueId: number; - /** - * Specification Field Description. - */ - Description: string; - /** - * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. - */ - IsStockKeepingUnit: boolean; - /** - * 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. - */ - IsOnProductDetails: boolean; - /** - * Specification Field Position. - */ - Position: number; - /** - * @deprecated - * Deprecated field. - */ - IsWizard: boolean; - /** - * 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. - */ - IsSideMenuLinkActive: boolean; - /** - * Specification Field default Value. - */ - DefaultValue: string; - /** - * Specification Field Group ID. - */ - FieldGroupId: number; - /** - * Specification Field Group Name. - */ - FieldGroupName: string; -} -export interface SpecificationsInsertFieldUpdateRequest { - /** - * Specification Field ID. - */ - Name: string; - /** - * Category ID. - */ - CategoryId: number; - /** - * Specification Field ID. - */ - FieldId: number; - /** - * Enables(`true`) or disables (`false`) the Specification Field. - */ - IsActive: boolean; - /** - * Makes the Specification Field mandatory (`true`) or optional (`false`). - */ - IsRequired: boolean; - /** - * Specification Field Type ID. - */ - FieldTypeId: number; - /** - * Specification Field Value ID. - */ - FieldValueId?: number; - /** - * Specification Field Description. - */ - Description: string; - /** - * If `true`, it will be added as a SKU specification field. If `false`, it will be added as a product specification field. - */ - IsStockKeepingUnit: boolean; - /** - * 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. - */ - IsOnProductDetails: boolean; - /** - * Specification Field Position. - */ - Position: number; - /** - * @deprecated - * Deprecated field. - */ - IsWizard: boolean; - /** - * 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. - */ - IsSideMenuLinkActive: boolean; - /** - * Specification Field default Value. - */ - DefaultValue: string; - /** - * Specification Field Group ID. - */ - FieldGroupId: number; - /** - * Specification Field Group Name. - */ - FieldGroupName: string; -} -export interface GetSpecFieldValue { - /** - * Specification Field Value ID. - */ - FieldValueId: number; - /** - * Specification Field Value. - */ - Value: string; - /** - * Defines if the Specification Field is active (`true`) or inactive (`false`). - */ - IsActive: boolean; - /** - * Specification Field Value Position. - */ - Position: number; -} -export interface SpecificationsInsertFieldValueRequest { - /** - * Specification Field ID. - */ - FieldId: number; - /** - * Specification Field Value Name. - */ - Name: string; - /** - * Specification Field Value Description. - */ - Text: string; - /** - * Defines if the Specification Field Value is active (`true`) or inactive (`false`). - */ - IsActive: boolean; - /** - * Specification Field Value Position. - */ - Position: number; -} -export interface SpecificationsUpdateFieldValueRequest { - /** - * Specification Field ID. - */ - FieldId: number; - /** - * Specification Field Value Name. - */ - Name: string; - /** - * Specification Field Value Description. - */ - Text: string; - /** - * Defines if the Specification Field Value is active (`true`) or inactive (`false`). - */ - IsActive: boolean; - /** - * Specification Field Position. - */ - Position: number; -} -export interface SpecificationsGroup { - /** - * Category ID. - */ - CategoryId: number; - /** - * Specification Group ID. - */ - Id: number; - /** - * Specification Group Name. - */ - Name: string; - /** - * Specification Group Position. - */ - Position: number; -} -export interface SpecificationGroupInsertRequest { - /** - * Category ID. - */ - CategoryId: number; - /** - * Specification Group Name. - */ - Name: string; -} -export interface CreateSellerRequest { - /** - * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. - */ - SellerId: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name: string; - /** - * Email of the admin responsible for the seller. - */ - Email: string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions: boolean; - /** - * Seller username. - */ - UserName: string; - /** - * Seller password. - */ - Password: string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy: string; - /** - * Company registration number. - */ - CNPJ: string; - /** - * CSC identification. - */ - CSCIdentification: string; - /** - * Seller archive ID. - */ - ArchiveId: number; - /** - * Seller URL logo. - */ - UrlLogo: string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint: string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId: number; - /** - * Seller type. - */ - SellerType: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - TrustPolicy?: string; -} -export interface UpdateSellerRequest { - /** - * ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. - */ - SellerId: string; - /** - * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. - */ - Name: string; - /** - * Email of the admin responsible for the seller. - */ - Email: string; - /** - * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). - */ - Description: string; - /** - * Text describing the exchange and return policy previously agreed between the marketplace and the seller. - */ - ExchangeReturnPolicy: string; - /** - * Text describing the delivery policy previously agreed between the marketplace and the seller. - */ - DeliveryPolicy: string; - /** - * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. - */ - UseHybridPaymentOptions: boolean; - /** - * Seller username. - */ - UserName: string; - /** - * Seller password. - */ - Password: string; - /** - * Text describing the security policy previously agreed between the marketplace and the seller. - */ - SecutityPrivacyPolicy: string; - /** - * Company registration number. - */ - CNPJ: string; - /** - * CSC identification. - */ - CSCIdentification: string; - /** - * Seller archive ID. - */ - ArchiveId: number; - /** - * Seller URL logo. - */ - UrlLogo: string; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - ProductCommissionPercentage: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - FreightCommissionPercentage: number; - /** - * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. - */ - CategoryCommissionPercentage?: string; - /** - * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. - */ - FulfillmentEndpoint: string; - /** - * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. - */ - CatalogSystemEndpoint: string; - /** - * If the selle is active (`true`) or not (`false`). - */ - IsActive: boolean; - /** - * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more. - */ - MerchantName?: string; - /** - * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. - */ - FulfillmentSellerId: number; - /** - * Seller type. - */ - SellerType: number; - /** - * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). - */ - IsBetterScope: boolean; - /** - * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. - */ - TrustPolicy?: string; -} -export interface SupplierRequest { - /** - * Supplier Name. - */ - Name: string; - /** - * Supplier Corporate Name. - */ - CorporateName: string; - /** - * State Inscription. - */ - StateInscription: string; - /** - * Corporate legal ID. - */ - Cnpj: string; - /** - * Supplier Phone. - */ - Phone: string; - /** - * Supplier Cellphone. - */ - CellPhone: string; - /** - * Supplier Corporate Phone. - */ - CorportePhone: string; - /** - * Supplier email. - */ - Email: string; - /** - * Defines if the Supplier is active (`true`) or not (`false`). - */ - IsActive: boolean; -} -export interface SupplierResponse { - /** - * Supplier unique identifier code. - */ - Id?: number; - /** - * Supplier Name. - */ - Name?: string; - /** - * Supplier Corporate Name. - */ - CorporateName?: string; - /** - * State Inscription. - */ - StateInscription?: string; - /** - * Corporate legal ID. - */ - Cnpj?: string; - /** - * Supplier Phone. - */ - Phone?: string; - /** - * Supplier Cellphone. - */ - CellPhone?: string; - /** - * Supplier Corporate Phone. - */ - CorportePhone?: string; - /** - * Supplier email. - */ - Email?: string; - /** - * Defines if the Supplier is active (`true`) or not (`false`). - */ - IsActive?: boolean; -} -export interface PriceChangeRequest { - /** - * The new price of the item. - */ - price: number; -} -export interface SetsinglecustomfieldvalueRequest { - /** - * The value you want to set to the specified field. - */ - value: string; -} -export interface UpdateorderFormconfigurationRequest { - paymentConfiguration: PaymentConfiguration; - /** - * External tax service configuration. - */ - taxConfiguration: { - /** - * Endpoint URL. - */ - url?: string; - /** - * Authorization header. - */ - authorizationHeader?: string; - /** - * Custom data ID sent to the tax system. - */ - appId?: string; - }; - /** - * Minimum SKU quantity by cart. - */ - minimumQuantityAccumulatedForItems: number; - /** - * Number of price digits. - */ - decimalDigitsPrecision: number; - /** - * Minimum cart value. - */ - minimumValueAccumulated: number; - /** - * Array of objects containing Apps configuration information. - */ - apps: { - /** - * App ID. - */ - id?: string; - /** - * Array of fields available to the app. - */ - fields?: string[]; - /** - * App major version. - */ - major?: number; - }[]; - /** - * On the same purchase, allows the selection of items from multiple delivery channels. - */ - allowMultipleDeliveries: boolean; - /** - * Allows the editing of SKU prices right in the cart. - */ - allowManualPrice: boolean; - /** - * Allows the input of a limit of white label sellers involved on the cart. - */ - maxNumberOfWhiteLabelSellers?: number; - /** - * Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client doesn't want to share its data. - */ - 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. - */ - recaptchaValidation?: string; - /** - * Indicates whether authentication is required for completing purchases. - */ - requiresLoginToPlaceOrder?: boolean; - /** - * Minimum interval (in seconds) between successive purchases. - */ - minimumPurchaseDowntimeSeconds?: number; - /** - * Minimum cart existence period (in seconds) before allowing the use of a new credit card. - */ - cartAgeToUseNewCardSeconds?: number; - /** - * If you want to apply a first installment discount to a particular payment system, set this field to that payment system's ID. Learn more: [Configuring a discount for orders prepaid in full](https://help.vtex.com/en/tutorial/configurar-desconto-de-preco-a-vista--7Lfcj9Wb5dpYfA2gKkACIt). - */ - paymentSystemToCheckFirstInstallment?: string; -} +isActive?: boolean /** - * Payment Configuration object + * If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived. */ -export interface PaymentConfiguration { - /** - * Determines whether pre-authorized payments require authentication - */ - requiresAuthenticationForPreAuthorizedPaymentOption: boolean; - /** - * By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installments options configured by every seller will be available. When `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those don't match. Installment values may not be equal in this case. - */ - allowInstallmentsMerge?: boolean; +isArchived?: boolean +/** + * Insert a flag with the promotion name used in the product's window display and page. + */ +isFeatured?: boolean +/** + * @deprecated + * Indicates whether a deal is disabled (`true`) or not (`false`). + */ +disableDeal?: boolean +/** + * Defines which days of the week the promotion will applied. + */ +activeDaysOfWeek?: string[] +/** + * Time offset from UTC in seconds. + */ +offset?: number +/** + * If set as `true`, it activates gifts Multiplier. + */ +activateGiftsMultiplier?: boolean +/** + * New time offset from UTC in seconds. + */ +newOffset?: number +/** + * @deprecated + * List of max price per items. + */ +maxPricesPerItems?: string[] +/** + * Defines if a promotion can accumulate with another one. (`true`) or not (`false`). + */ +cumulative?: boolean +/** + * The type of discount that will apply to the promotion. + */ +discountType?: string +/** + * Exact discount to be applied for the shipping value. + */ +nominalShippingDiscountValue?: number +/** + * Maximum value for the shipping. + */ +absoluteShippingDiscountValue?: number +/** + * Exact discount to be applied for the total purchase value. + */ +nominalDiscountValue?: number +/** + * Controls the behavior of the `NominalDiscount` effect. This field only accepts two string values: + * + * -`item`: applies the intended nominal discount on every item present on the cart. + * + * -`cart`: keeps the behavior as it currently is: the whole order/cart receives a nominal discount that is distributed among the items. + */ +nominalDiscountType?: string +/** + * The maximum price for each item of the purchase will be the price set up. + */ +maximumUnitPriceDiscount?: number +/** + * Percentage discount to be applied for total purchase value. + */ +percentualDiscountValue?: number +/** + * Percentual Shipping Discount Value. + */ +rebatePercentualDiscountValue?: number +/** + * Percentage discount to be applied for shipping value. + */ +percentualShippingDiscountValue?: number +/** + * Percentual tax over purchase total value. + */ +percentualTax?: number +/** + * Shipping Percentual tax over purchase total value. + */ +shippingPercentualTax?: number +/** + * Valid discounts for the SKUs in `listSku1BuyTogether`, discount list used for Buy Together Promotions. + */ +percentualDiscountValueList1?: number +/** + * Equivalent to `percentualDiscountValueList1`. + */ +percentualDiscountValueList2?: number +/** + * SKU Gift Object. Total discount on the product value set as a gift. + */ +skusGift?: { +/** + * Quantity of SKU Gifts. + */ +quantitySelectable?: number +/** + * Array with SKU Gifts IDs. + */ +gifts?: number } -export interface WaitingTime { - /** - * Number of days after order cancelation by a seller, during which another seller may be assigned to fulfill the order. - */ - waitingTime: number; +/** + * Nominal value for rewards program. + */ +nominalRewardValue?: number +/** + * Percentage value for rewards program. + */ +percentualRewardValue?: number +/** + * Order status reward value. + */ +orderStatusRewardValue?: string +/** + * The maximum number of affected items for a promotion. + */ +maxNumberOfAffectedItems?: number +/** + * The maximum number of affected items by group key for a promotion. + */ +maxNumberOfAffectedItemsGroupKey?: string +/** + * Promotion will be applied to all kind of shipping. + */ +applyToAllShippings?: boolean +/** + * Nominal tax. + */ +nominalTax?: number +/** + * Origin of the promotion, `marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information. + */ +origin?: string +/** + * Seller Name. + */ +idSeller?: string +/** + * If set to `true`, this promotion will be applied to any seller present on the idSeller field. If set to `false`, sellers present on that field will make this promotion not to be applied. + */ +idSellerIsInclusive?: boolean +/** + * List of Trade Policies that activate this promotion. + */ +idsSalesChannel?: string[] +/** + * If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied. + */ +areSalesChannelIdsExclusive?: boolean +/** + * Promotion Marketing tags. + */ +marketingTags?: string[] +/** + * If set to `false`, this promotion will be applied to any marketing tag present on the `marketingTags` field. If set to `true`, marketing tags present on that field will make this promotion not to be applied. + */ +marketingTagsAreNotInclusive?: boolean +/** + * Array composed by all the Payments Methods. + */ +paymentsMethods?: { +/** + * Payment Method ID. + */ +id?: string +/** + * Payment Method Name. + */ +name?: string +}[] +/** + * @deprecated + * List of stores. + */ +stores?: string[] +/** + * Campaign Audiences that activate this promotion. + */ +campaigns?: string[] +/** + * Array with conditions IDs. + */ +conditionsIds?: string[] +/** + * @deprecated + * If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied. + */ +storesAreInclusive?: boolean +/** + * Object composed by the categories that will activate or deactivate the promotion. + */ +categories?: { +/** + * Category ID. + */ +id?: string +/** + * Category Name. + */ +name?: string +}[] +/** + * If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied. + */ +categoriesAreInclusive?: boolean +/** + * Object composed by the brands that will activate or deactivate the promotion. + */ +brands?: { +/** + * Brand ID. + */ +id?: string +/** + * Brand Name. + */ +name?: string +}[] +/** + * If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied. + */ +brandsAreInclusive?: boolean +/** + * Object composed by the products that will activate or deactivate the promotion. + */ +products?: { +/** + * Product ID. + */ +id?: string +/** + * Product Name. + */ +name?: string +}[] +/** + * If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied. + */ +productsAreInclusive?: boolean +/** + * Object composed by the SKUs that will activate or deactivate the promotion. + */ +skus?: { +/** + * SKU ID. + */ +id: string +/** + * SKU Name. + */ +name: string +}[] +/** + * If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied. + */ +skusAreInclusive?: boolean +/** + * Coupon utmSource code. + */ +utmSource?: string +/** + * Coupon utmCampaign code. + */ +utmCampaign?: string +/** + * Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**. + */ +collections1BuyTogether?: { +/** + * ID of the collection to be added to the first list of the **Buy Together** promotion. + */ +id?: string +/** + * Name of the collection to be added to the first list of the **Buy Together** promotion. + */ +name?: string +}[] +/** + * @deprecated + * Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount** or **Buy One Get One**. + */ +collections2BuyTogether?: { +/** + * ID of the collection to be added to the first list of the **Buy Together** promotion. + */ +id?: string +/** + * Name of the collection to be added to the first list of the **Buy Together** promotion. + */ +name?: string +}[] +/** + * Minimum quantity for **Buy Together** promotion. + */ +minimumQuantityBuyTogether?: number +/** + * Quantity to affect **Buy Together** promotion. + */ +quantityToAffectBuyTogether?: number +/** + * Enable **Buy Together** per SKU. + */ +enableBuyTogetherPerSku?: boolean +/** + * Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation. + */ +listSku1BuyTogether?: { +/** + * ID of the SKU to be added to the first list of the **Buy Together** promotion. + */ +id?: string +/** + * Name of the SKU to be added to the first list of the **Buy Together** promotion. + */ +name?: string +}[] +/** + * Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation. + */ +listSku2BuyTogether?: { +/** + * ID of the SKU to be added to the second list of the **Buy Together** promotion. + */ +id?: string +/** + * Name of the SKU to be added to the second list of the **Buy Together** promotion. + */ +name?: string +}[] +/** + * @deprecated + * List of coupons. + */ +coupon?: string[] +/** + * Minimum chart value to activate the promotion. + */ +totalValueFloor?: number +/** + * Maximum chart value to activate the promotion. + */ +totalValueCeling?: number +/** + * @deprecated + * Total value including all items. + */ +totalValueIncludeAllItems?: boolean +/** + * If products that already are receiving a promotion, will be considered on the chart total value. There are three options available: `IncludeMatchedItems`, `ExcludeMatchedItems`, `AllItems`. + */ +totalValueMode?: string +/** + * Array composed by the collections that will be activated or deactivated the promotion. + */ +collections?: { +/** + * Collection ID. + */ +id?: string +/** + * Collection Name. + */ +name?: string +}[] +/** + * If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied. + */ +collectionsIsInclusive?: boolean +/** + * The discount will be granted if the card's BIN is given. + */ +restrictionsBins?: string[] +/** + * @deprecated + * List of card issuers. + */ +cardIssuers?: string[] +/** + * Total value a client must have in past orders to active the promotion. + */ +totalValuePurchase?: number +/** + * The discount will be granted if the shipping method is the same as the one given. + */ +slasIds?: string[] +/** + * Applies selected discount only when one of the defined shipping method is selected by the customer. + */ +isSlaSelected?: boolean +/** + * Applies the discount only if it's a first buy. + */ +isFirstBuy?: boolean +/** + * Applies the discount even if the user is not logged. + */ +firstBuyIsProfileOptimistic?: boolean +/** + * If the **List Price** and **Price** are the same. + */ +compareListPriceAndPrice?: boolean +/** + * Applies the promotion only if the list price and price is different. + */ +isDifferentListPriceAndPrice?: boolean +/** + * Range of the zip code that applies the promotion. + */ +zipCodeRanges?: { +/** + * Initial Zip Code. + */ +zipCodeFrom?: string +/** + * Final Zip Code. + */ +zipCodeTo?: string +/** + * Defines if the zip code range is included in the promotion. + */ +inclusive?: boolean +}[] +/** + * List of countries that are activated for this promotion. + */ +countries?: string[] +/** + * Maximum price of the item. + */ +itemMaxPrice?: number +/** + * Minimum price of the item. + */ +itemMinPrice?: number +/** + * @deprecated + * Installment. + */ +installment?: number +/** + * Set if the promotion will be applied considering a minimum and maximum values for installments. + */ +isMinMaxInstallments?: boolean +/** + * Minimum value for installment. + */ +minInstallment?: number +/** + * Maximum value for installment. + */ +maxInstallment?: number +/** + * @deprecated + * List of merchants. + */ +merchants?: string[] +/** + * Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field). + */ +clusterExpressions?: string[] +/** + * Object composed by a list of SKUs on a Multiple Effects promotion. Structure: `"{SkuId}": {PercentageDiscount}`. There is a limit of 400 SKUs for this type of promotion. + */ +multipleSkusCause?: { +/** + * SKU ID. + */ +[k: string]: string +} +/** + * @deprecated + * List of payment rules. + */ +paymentsRules?: string[] +/** + * Gifts List Type. + */ +giftListTypes?: string[] +/** + * @deprecated + * List of product specifications. + */ +productsSpecifications?: string[] +/** + * Marketplace order identifier. The discount will apply to selected affiliates. + */ +affiliates?: { +/** + * Affiliate ID. + */ +id?: string +/** + * Affiliate Name. + */ +name?: string +}[] +/** + * Defines how many times the promotion can be used. + */ +maxUsage?: number +/** + * Defines if the promotion can be used multiple times per client. + */ +maxUsagePerClient?: number +/** + * Should distribute discount among matched items. + */ +shouldDistributeDiscountAmongMatchedItems?: boolean +/** + * Defines if the promotion can be used multiple times per client. + */ +multipleUsePerClient?: boolean +/** + * Allows the promotion to apply to products whose prices have been manually added by a call center operator. + */ +accumulateWithManualPrice?: boolean +/** + * Defines what is the type of the promotion or indicates if it is a tax. Possible values: `regular` ([Regular Promotion](https://help.vtex.com/tutorial/regular-promotion--tutorials_327)), `combo` ([Buy Together](https://help.vtex.com/en/tutorial/buy-together--tutorials_323)), `forThePriceOf` ([More for Less](https://help.vtex.com/en/tutorial/creating-a-more-for-less-promotion--tutorials_325)), `progressive` ([Progressive Discount](https://help.vtex.com/en/tutorial/progressive-discount--tutorials_324)), `buyAndWin` ([Buy One Get One](https://help.vtex.com/en/tutorial/buy-one-get-one--tutorials_322)), `maxPricePerItem` (Deprecated), `campaign` ([Campaign Promotion](https://help.vtex.com/en/tutorial/campaign-promotion--1ChYXhK2AQGuS6wAqS8Ume)), `tax` (Tax), `multipleEffects` (Multiple Effects). + */ +type?: string +/** + * Use new progressive algorithm. + */ +useNewProgressiveAlgorithm?: boolean +/** + * Percentual discount value list. + */ +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 + * ``` + * + * +> 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": { +searchParams: { +/** + * 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. + */ +_fields?: string +/** + * Specification of filters. + */ +_where?: string +/** + * Inform a field name plus `ASC` to sort results by this field value in ascending order or `DESC` to sort by descending order. + */ +_sort?: string +} +/** + * List of documents. + */ +response: { +/** + * Custom properties. + */ +additionalProperties?: 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 +}[] +} +"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. + * + * ## 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": { +searchParams: { +/** + * 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. + */ +_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). + * + * >❗ 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": { +/** + * Object with document fields and their respective values. + */ +body: { +/** + * Field name and value. + */ +"{fieldName}"?: string +[k: string]: any +} +} +/** + * 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). + * + * >❗ 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": { +/** + * Object with the fields to be updated and their respective values. + */ +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": { +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. + */ +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 +} +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's recommended that you don't 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 +} +} +/** + * Retrieves a specific product's general information as name, description and the trade policies that it is included. + */ +"GET /api/catalog_system/pvt/products/productget/:productId": { +response: { +/** + * Product ID. + */ +Id?: number +/** + * Product's name. Limited to 150 characters. + */ +Name?: string +/** + * Product department ID. + */ +DepartmentId?: number +/** + * Product category ID. + */ +CategoryId?: number +/** + * Product brand ID. + */ +BrandId?: number +/** + * Product text link. + */ +LinkId?: string +/** + * Product referecial code. + */ +RefId?: string +/** + * If the Product is visible on the store. + */ +IsVisible?: boolean +/** + * Product description. + */ +Description?: string +/** + * Product complement name. + */ +DescriptionShort?: string +/** + * Product release date. + */ +ReleaseDate?: string +/** + * Substitutes words for the product. + */ +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 +/** + * If the product is active (`true`) or not (`false`) at the store. + */ +IsActive?: boolean +/** + * Product fiscal code. + */ +TaxCode?: string +/** + * Product meta tag description. + */ +MetaTagDescription?: string +/** + * Product supplier ID. + */ +SupplierId?: number +/** + * Defines if the Product will remain being shown in the store even if it’s out of stock. + */ +ShowWithoutStock?: boolean +/** + * List with the Trade Policies IDs that the product is included. + */ +ListStoreId?: number[] +/** + * @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 +} +} +/** + * Retrieves a specific product by its Reference ID. + */ +"GET /api/catalog_system/pvt/products/productgetbyrefid/:refId": { +response: { +/** + * ID of the Product. + */ +Id?: number +/** + * Name of the Product. + */ +Name?: string +/** + * ID of product department. + */ +DepartmentId?: number +/** + * ID of product Category. + */ +CategoryId?: number +/** + * ID of the product Brand. + */ +BrandId?: number +/** + * Category URL. + */ +LinkId?: string +/** + * Product Reference ID. + */ +RefId?: string +/** + * If the product are visible in search and list pages. + */ +IsVisible?: boolean +/** + * Product Description, HTML is allowed. + */ +Description?: string +/** + * Product Short Description. + */ +DescriptionShort?: string +/** + * Product Release Date, for list ordering and product cluster highlight. + */ +ReleaseDate?: string +/** + * Alternatives Keywords to improve the product findability. + */ +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 +/** + * If the product is Active. + */ +IsActive?: boolean +/** + * SKU Tax Code. + */ +TaxCode?: string +/** + * Meta Description for the Product page. + */ +MetaTagDescription?: string +/** + * Product Supplier ID. + */ +SupplierId?: number +/** + * If the product can be visible without stock. + */ +ShowWithoutStock?: boolean +/** + * Array with the ID of all the trade policies that are related to the product. + */ +ListStoreId?: number[] +/** + * @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 +} +} +/** + * 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": { +/** + * Response body. + */ +response: { +/** + * Product’s unique numerical identifier. + */ +productId?: number +/** + * Product name. + */ +name?: string +/** + * Trade policy ID. + */ +salesChannel?: string +/** + * Defines if the product is available (`true`) or not (`false`). + */ +available?: boolean +/** + * Defines the mannner SKUs are displayed. + */ +displayMode?: string +/** + * Lists SKU specifications. + */ +dimensions?: string[] +/** + * Lists SKU specifications and their field type, in the following format: `"{specificationName}":"{fieldType}"`. + */ +dimensionsInputType?: { +[k: string]: string +} +/** + * Lists SKU specifications and their possible values inside arrays. + */ +dimensionsMap?: { +[k: string]: any[] +} +/** + * Array containing information about the product's SKUs. + */ +skus?: { +/** + * SKU ID. + */ +sku?: number +/** + * SKU Name. + */ +skuname?: string +/** + * Lists SKU specifications and their respective values. + */ +dimensions?: { +[k: string]: string +} +/** + * Defines if the SKU is available (`true`) or not (`false`). + */ +available?: boolean +/** + * Available quantity of the SKU in stock. + */ +availablequantity?: number +/** + * Cache version used to call Checkout. + */ +cacheVersionUsedToCallCheckout?: (null | string) +/** + * List price formatted according to the valid currency. + */ +listPriceFormated?: string +/** + * List price. + */ +listPrice?: number +/** + * Tax value formatted according to the valid currency. + */ +taxFormated?: string +/** + * Tax value. + */ +taxAsInt?: number +/** + * Best price formatted according to the valid currency. + */ +bestPriceFormated?: string +/** + * Best price. + */ +bestPrice?: number +/** + * Spot price. + */ +spotPrice?: number +/** + * Number of installments. + */ +installments?: number +/** + * Value of installments. + */ +installmentsValue?: number +/** + * Interest rate of installments. + */ +installmentsInsterestRate?: (null | number) +/** + * SKU image URL. + */ +image?: string +/** + * Seller ID. + */ +sellerId?: string +/** + * SKU measures. + */ +measures?: { +/** + * Cubic weight. + */ +cubicweight?: number +/** + * Height. + */ +height?: number +/** + * Length. + */ +length?: number +/** + * Weight. + */ +weight?: number +/** + * Width. + */ +width?: number +} +/** + * SKU Unit Multiplier. + */ +unitMultiplier?: number +/** + * SKU reward value for rewards program. + */ +rewardValue?: number +}[] +} +} +/** + * Retrieves the review rate of a product by this product's ID. + */ +"GET /api/addon/pvt/review/GetProductRate/:productId": { +/** + * Review rate numeber. + */ +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 + * > + * > 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": { +body: { +/** + * Product’s unique numerical identifier. If not informed, it will be automatically generated by VTEX. + */ +Id?: number +/** + * Product's name. Limited to 150 characters. + */ +Name: string +/** + * Path of categories associated with this product, from the highest level of category to the lowest level, separated by `/`. It is mandatory to use either this field or the `CategoryId` field. + */ +CategoryPath?: string +/** + * ID of an existing Category that will be associated with this product. It is mandatory to use either this field or the `CategoryPath` field. + */ +CategoryId?: number +/** + * Name of the brand that will be associated with this product. It is mandatory to use either this field or the `BrandId` field. If you wish to create a new brand, that is, in case the brand does not exist yet, use this field instead of `BrandId`. + */ +BrandName?: string +/** + * ID of an existing Brand that will be associated with this product. It is mandatory to use either this field or the `BrandName` field. + */ +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 +} +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's recommended that you don't 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 +} +} +/** + * 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" + * } + * ] + * ``` + */ +"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" + * } + * ] + * ``` + */ +"GET /api/catalog/pvt/product/:productId/specification": { +response: { +/** + * ID of the association of the specification and the product. This ID is used to update or delete the specification. + */ +Id?: number +/** + * Product ID. + */ +ProductId?: number +/** + * Specification field ID. + */ +FieldId?: number +/** + * Current specification value ID. + */ +FieldValueId?: number +/** + * Current specification value text. + */ +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" + * } + * ``` + */ +"POST /api/catalog/pvt/product/:productId/specification": { +body: { +/** + * Specification field ID. + */ +FieldId: number +/** + * Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types + */ +FieldValueId?: number +/** + * Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`. + */ +Text?: string +} +response: { +/** + * ID of the association of the specification and the product. This ID is used to update or delete the specification. + */ +Id?: number +/** + * Product ID. + */ +ProductId?: number +/** + * Specification field ID. + */ +FieldId?: number +/** + * Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types + */ +FieldValueId?: number +/** + * Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`. + */ +Text?: string +} +} +/** + * Deletes all Product Specifications given a specific Product ID. + */ +"DELETE /api/catalog/pvt/product/:productId/specification": { + +} +/** + * Deletes a specific Product Specification given a Product ID and a Specification ID. + */ +"DELETE /api/catalog/pvt/product/:productId/specification/:specificationId": { + +} +/** + * 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": { +body: { +/** + * Specification name. Limited to 100 characters. + */ +FieldName: string +/** + * Group name. + */ +GroupName: string +/** + * Root level specification. + */ +RootLevelSpecification: boolean +/** + * Array of specification values. + */ +FieldValues: string[] +} +/** + * Array with information of all product specifications. + */ +response: { +/** + * ID of the association of the Product and the specification. + */ +Id?: number +/** + * Product ID. + */ +ProductId?: number +/** + * Specification field ID. + */ +FieldId?: number +/** + * Current specification value ID. + */ +FieldValueId?: number +/** + * Current specification value text. + */ +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 + * ] + * ``` + */ +"GET /api/catalog_system/pvt/sku/stockkeepingunitids": { +searchParams: { +/** + * Number of the page from where you need to retrieve SKU IDs. + */ +page: number +/** + * Size of the page from where you need retrieve SKU IDs. The maximum value is `1000`. + */ +pagesize: number +} +/** + * Array composed by SKU IDs, in the search context. + */ +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 + * } + * ``` + */ +"GET /api/catalog_system/pvt/sku/stockkeepingunitbyid/:skuId": { +searchParams: { +/** + * Trade Policy's unique identifier number. + */ +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 + * } + * ``` + */ +"GET /api/catalog/pvt/stockkeepingunit": { +searchParams: { +/** + * SKU Reference ID. + */ +refId: string +} +response: { +/** + * SKU ID. + */ +Id?: number +/** + * Product ID. + */ +ProductId?: number +/** + * Defines if the SKU is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. + */ +ActivateIfPossible?: boolean +/** + * SKU Name. + */ +Name?: string +/** + * SKU RefId. + */ +RefId?: string +/** + * Packaged Height. + */ +PackagedHeight?: number +/** + * Packaged Length. + */ +PackagedLength?: number +/** + * Packaged Width. + */ +PackagedWidth?: number +/** + * Packaged Weight, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +PackagedWeightKg?: number +/** + * SKU Height. + */ +Height?: number +/** + * SKU Length. + */ +Length?: number +/** + * SKU Width. + */ +Width?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * [Cubic Weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Shows if the SKU is a Kit (`true`) or not (`false`). + */ +IsKit?: boolean +/** + * SKU Creation Date. + */ +CreationDate?: string +/** + * Defines the value of the reward for clients who purchase the SKU. + */ +RewardValue?: number +/** + * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: (null | string) +/** + * Manufacturer Code. + */ +ManufacturerCode?: string +/** + * Commercial Condition ID. + */ +CommercialConditionId?: number +/** + * Measurement Unit. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: (null | string) +/** + * Defines if Kit components can be sold apart. + */ +KitItensSellApart?: boolean +/** + * Video URLs. + */ +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/" ] + * } + * ``` + */ +"POST /api/catalog/pvt/stockkeepingunit": { +body: { +/** + * SKU unique identifier. If not informed, it will be automatically generated by VTEX. + */ +Id?: number +/** + * ID of the Product associated with this SKU. + */ +ProductId: number +/** + * Defines if the SKU is active (`true`) or not (`false`). During SKU creation, do not set this field as `true` or you will receive a `400 Bad Request` error. You should activate the SKU afterwards, as explained in [Activating an SKU](https://developers.vtex.com/docs/guides/skus#activating-an-sku). + */ +IsActive?: boolean +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. We recommend setting it to `true`, unless you plan to have an internal workflow to manually activate SKUs. + */ +ActivateIfPossible?: boolean +/** + * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. Limited to 200 characters. + */ +Name: string +/** + * Reference code used internally for organizational purposes. Must be unique. Required only if `Ean` is not informed, but can be used alongside `Ean` as well. + */ +RefId?: string +/** + * EAN code. Required only if `RefId` is not informed, but can be used alongside `RefId` as well. + */ +Ean?: string +/** + * Height used for shipping calculation. + */ +PackagedHeight: number +/** + * Length used for shipping calculation. + */ +PackagedLength: number +/** + * Width used for shipping calculation. + */ +PackagedWidth: number +/** + * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. Do not fill in this field with `0` or `null`, because this might result in shipping issues. + */ +PackagedWeightKg: number +/** + * SKU real height. + */ +Height?: number +/** + * SKU real length. + */ +Length?: number +/** + * SKU real width. + */ +Width?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. + */ +IsKit?: boolean +/** + * Date and time of the SKU's creation. + */ +CreationDate?: string +/** + * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. + */ +RewardValue?: number +/** + * To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: (null | string) +/** + * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. + */ +ManufacturerCode?: string +/** + * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). + */ +CommercialConditionId?: number +/** + * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: (null | string) +/** + * Defines if Kit components can be sold apart. + */ +KitItensSellApart?: boolean +/** + * Videos URLs + */ +Videos?: string[] +} +response: { +/** + * SKU unique identifier. + */ +Id?: number +/** + * ID of the Product associated with this SKU. + */ +ProductId?: number +/** + * Defines if the SKU is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. + */ +ActivateIfPossible?: boolean +/** + * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. + */ +Name?: string +/** + * Reference code used internally for organizational purposes. Must be unique. Required only if `Ean` is not informed, but can be used alongside `Ean` as well. + */ +RefId?: string +/** + * EAN code. Required only if `RefId` is not informed, but can be used alongside `RefId` as well. + */ +Ean?: string +/** + * Height used for shipping calculation. + */ +PackagedHeight?: number +/** + * Length used for shipping calculation. + */ +PackagedLength?: number +/** + * Width used for shipping calculation. + */ +PackagedWidth?: number +/** + * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +PackagedWeightKg?: number +/** + * SKU real height. + */ +Height?: number +/** + * SKU real length. + */ +Length?: number +/** + * SKU real width. + */ +Width?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. + */ +IsKit?: boolean +/** + * Date and time of the SKU's creation. + */ +CreationDate?: string +/** + * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. + */ +RewardValue?: number +/** + * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: (null | string) +/** + * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. + */ +ManufacturerCode?: string +/** + * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). + */ +CommercialConditionId?: number +/** + * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: (null | string) +/** + * Defines if Kit components can be sold apart. + */ +KitItensSellApart?: boolean +/** + * Videos URLs. + */ +Videos?: string[] +} +} +/** + * Retrieves an SKU ID by the SKU's Reference ID. + * + * ### Response body example + * + * ```json + * "310118450" + * ``` + */ +"GET /api/catalog_system/pvt/sku/stockkeepingunitidbyrefid/:refId": { +/** + * SKU ID. + */ +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 + * } + * ``` + */ +"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": "" + * } + * ] + * ``` + */ +"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" + * } + * ``` + */ +"POST /api/catalog_system/pub/sku/stockkeepingunitidsbyrefids": { +/** + * Array with SKU reference IDs from which you need to retrieve the related SKU IDs. Don't repeat values in the array, or the API will return an error 500. + */ +body: string[] +/** + * Object composed by a list of SKU IDs related to each Reference ID list searched. Structure: "{RefId}": "{SkuId}". + */ +response: { +/** + * Reference ID. + */ +[k: string]: string +} +} +/** + * 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": { +response: { +/** + * SKU unique identifier. + */ +Id?: number +/** + * ID of the Product associated with this SKU. + */ +ProductId?: number +/** + * Shows if the SKU is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. + */ +ActivateIfPossible?: boolean +/** + * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. + */ +Name?: string +/** + * Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided. + */ +RefId?: string +/** + * Height used for shipping calculation. + */ +PackagedHeight?: number +/** + * Length used for shipping calculation. + */ +PackagedLength?: number +/** + * Width used for shipping calculation. + */ +PackagedWidth?: number +/** + * Weight used for shipping calculation. + */ +PackagedWeightKg?: number +/** + * SKU real height. + */ +Height?: number +/** + * SKU real length. + */ +Length?: number +/** + * SKU real width. + */ +Width?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. + */ +IsKit?: boolean +/** + * Date and time of the SKU's creation. + */ +CreationDate?: string +/** + * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. + */ +RewardValue?: number +/** + * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: (null | string) +/** + * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. + */ +ManufacturerCode?: string +/** + * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). + */ +CommercialConditionId?: number +/** + * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: (null | string) +/** + * Defines if Kit components can be sold apart. + */ +KitItensSellApart?: boolean +/** + * Videos URLs. + */ +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/" ] + * } + * ``` + */ +"PUT /api/catalog/pvt/stockkeepingunit/:skuId": { +body: { +/** + * ID of the Product associated with this SKU. + */ +ProductId: number +/** + * Shows if the SKU is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. + */ +ActivateIfPossible?: boolean +/** + * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. + */ +Name: string +/** + * Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided. + */ +RefId?: string +/** + * Height used for shipping calculation. + */ +PackagedHeight: number +/** + * Length used for shipping calculation. + */ +PackagedLength: number +/** + * Width used for shipping calculation. + */ +PackagedWidth: number +/** + * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. Do not fill in this field with `0` or `null`, because this might result in shipping issues. + */ +PackagedWeightKg: number +/** + * SKU real height. + */ +Height?: number +/** + * SKU real length. + */ +Length?: number +/** + * SKU real width. + */ +Width?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. + */ +IsKit?: boolean +/** + * Date and time of the SKU's creation. + */ +CreationDate?: string +/** + * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. + */ +RewardValue?: number +/** + * To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: (null | string) +/** + * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. + */ +ManufacturerCode?: string +/** + * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). + */ +CommercialConditionId?: number +/** + * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: (null | string) +/** + * Defines if Kit components can be sold apart. + */ +KitItensSellApart?: boolean +/** + * Videos URLs + */ +Videos?: string[] +} +response: { +/** + * SKU unique identifier. + */ +Id?: number +/** + * ID of the Product associated with this SKU. + */ +ProductId?: number +/** + * Shows if the SKU is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. + */ +ActivateIfPossible?: boolean +/** + * SKU name, meaning the variation of the previously added product. For example: **Product** - _Fridge_, **SKU** - _110V_. + */ +Name?: string +/** + * Reference code used internally for organizational purposes. Must be unique. It is not required only if EAN code already exists. If not, this field must be provided. + */ +RefId?: string +/** + * Height used for shipping calculation. + */ +PackagedHeight?: number +/** + * Length used for shipping calculation. + */ +PackagedLength?: number +/** + * Width used for shipping calculation. + */ +PackagedWidth?: number +/** + * Weight used for shipping calculation, in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +PackagedWeightKg?: number +/** + * SKU real height. + */ +Height?: number +/** + * SKU real length. + */ +Length?: number +/** + * SKU real width. + */ +Width?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. + */ +IsKit?: boolean +/** + * Date and time of the SKU's creation. + */ +CreationDate?: string +/** + * Credit that the customer receives when finalizing an order of one specific SKU unit. By filling this field out with `1`, the customer gets U$ 1 credit on the site. + */ +RewardValue?: number +/** + * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: (null | string) +/** + * Provided by the manufacturers to identify their product. This field should be filled in if the product has a specific manufacturer’s code. + */ +ManufacturerCode?: string +/** + * Used to define SKU specific promotions or installment rules. In case of no specific condition, use `1` (default value). This field does not accept `0`. Find out more by reading [Registering a commercial condition](https://help.vtex.com/tutorial/registering-a-commercial-condition--tutorials_445). + */ +CommercialConditionId?: number +/** + * Used only in cases when you need to convert the unit of measure for sale. If a product is sold in boxes for example, but customers want to buy per square meter (m²). In common cases, use `'un'`. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: (null | string) +/** + * Defines if Kit components can be sold apart. + */ +KitItensSellApart?: boolean +/** + * Videos URLs. + */ +Videos?: string[] +} +} +/** + * 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 + * } + * ] + * ``` + */ +"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" + * } + * ``` + */ +"GET /api/catalog_system/pvt/sku/complements/:parentSkuId/:type": { +response: { +/** + * ID of the Parent SKU, where the Complement is inserted. + */ +ParentSkuId: number +/** + * Array with SKU complements IDs. + */ +ComplementSkuIds: number[] +/** + * Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together. + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/skucomplement": { +body: { +/** + * ID of the Parent SKU, where the Complement is inserted. + */ +ParentSkuId: number +/** + * ID of the SKU which will be inserted as a Complement in the Parent SKU. + */ +SkuId: number +/** + * Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together. + */ +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 + * } + * ``` + */ +"GET /api/catalog/pvt/skucomplement/:skuComplementId": { +response: SkuComplement +} +/** + * Deletes a previously existing SKU Complement by SKU Complement ID. + */ +"DELETE /api/catalog/pvt/skucomplement/:skuComplementId": { + +} +/** + * 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" + * ] + * ``` + */ +"GET /api/catalog/pvt/stockkeepingunit/:skuId/ean": { +/** + * Array with EANs associated with the SKU. + */ +response: string[] +} +/** + * Deletes all EAN values of an SKU. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/:skuId/ean": { + +} +/** + * Creates or updates the EAN value of an SKU. + */ +"POST /api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean": { + +} +/** + * Deletes the EAN value of an SKU. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/:skuId/ean/:ean": { + +} +/** + * 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": { +body: { +/** + * Attachment ID. + */ +AttachmentId: number +/** + * Unique identifier of an SKU. + */ +SkuId: number +} +/** + * Object containing information about the association between the SKU and the attachment. + */ +response: { +/** + * Identifier of the SKU's association to the attachment. + */ +Id?: number +/** + * Attachment ID. + */ +AttachmentId?: number +/** + * Unique identifier of the SKU. + */ +SkuId?: number +} +} +/** + * Dissociates attachments and SKUs based on an SKU ID or an attachment ID. + */ +"DELETE /api/catalog/pvt/skuattachment": { +searchParams: { +/** + * SKU ID. By using this query param, you can dissociate all the attachments from an SKU based on its SKU ID. + */ +skuId?: number +/** + * Attachment ID. By using this query param, you can dissociate the given attachment from all previously associated SKUs. + */ +attachmentId?: number +} +} +/** + * Retrieves existing SKU Attachments by SKU ID. + * ## Response body example + * + * ```json + * [ + * { + * "Id": 97, + * "AttachmentId": 1, + * "SkuId": 1 + * } + * ] + * ``` + */ +"GET /api/catalog/pvt/stockkeepingunit/:skuId/attachment": { +/** + * Array of objects with information about the association between the attachments and the SKU. + */ +response: { +/** + * Identifier of the SKU's association to the attachment. + */ +Id?: number +/** + * Attachment ID. + */ +AttachmentId?: number +/** + * Unique identifier of the SKU. + */ +SkuId?: number +}[] +} +/** + * Deletes the association of an SKU to an Attachment. + */ +"DELETE /api/catalog/pvt/skuattachment/:skuAttachmentAssociationId": { + +} +/** + * 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" + * ] + * } + * ``` + */ +"POST /api/catalog_system/pvt/sku/associateattachments": { +body: { +/** + * Unique identifier of the SKU. + */ +SkuId: number +/** + * Array with all the names of the attachments that you need to associate to the SKU. + */ +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 + * } + * ] + * ``` + */ +"GET /api/catalog/pvt/stockkeepingunit/:skuId/file": { +/** + * Array with objects containing SKU Files information. + */ +response: { +/** + * Unique identifier of the association of the Image to the SKU. + */ +Id?: number +/** + * Unique identifier of the Image. + */ +ArchiveId?: number +/** + * Unique identifier of the SKU. + */ +SkuId?: number +/** + * Image name. + */ +Name?: string +/** + * Defines if the Image is the Main Image of the SKU. + */ +IsMain?: boolean +/** + * Image label. + */ +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": "" + * } + * ``` + */ +"POST /api/catalog/pvt/stockkeepingunit/:skuId/file": { +body: SKUFileURL +response: { +/** + * ID of the association of the SKU and the image (`SkuFileId`). This is the ID that is used to update or delete it. + */ +Id?: number +/** + * Unique identifier of the image file. + */ +ArchiveId?: number +/** + * SKU ID. + */ +SkuId?: number +/** + * Set the image as the main image for the product. + */ +IsMain?: boolean +/** + * Image label. + */ +Label?: string +} +} +/** + * Deletes all SKU Image Files. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/:skuId/file": { + +} +/** + * 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": { +body: SKUFileURL +response: { +/** + * ID of the association of the SKU and the image (`SkuFileId`). This is the ID that is used to update or delete it. + */ +Id?: number +/** + * Unique identifier of the image file. + */ +ArchiveId?: number +/** + * SKU ID. + */ +SkuId?: number +/** + * Set the image as the main image for the product. + */ +IsMain?: boolean +/** + * Image label. + */ +Label?: string +} +} +/** + * Deletes a specific SKU Image File. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/:skuId/file/:skuFileId": { + +} +/** + * 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/": { +/** + * Array with objects containing information about each of the target SKU's Files. + */ +response: { +/** + * Unique identifier of the association of the Image to the SKU. + */ +Id?: number +/** + * Unique identifier of the image file. + */ +ArchiveId?: number +/** + * Unique identifier of the SKU. + */ +SkuId?: number +/** + * Defines if the Image is the Main Image of the SKU. + */ +IsMain?: boolean +/** + * Image label. + */ +Label?: (null | string) +}[] +} +/** + * Disassociates an SKU File from an SKU. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/disassociate/:skuId/file/:skuFileId": { + +} +/** + * 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": { +searchParams: { +/** + * SKU’s unique numerical identifier. + */ +skuId?: number +/** + * Parent SKU’s unique numerical identifier. + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/stockkeepingunitkit": { +body: { +/** + * SKU ID of the SKU Kit. + */ +StockKeepingUnitParent: number +/** + * Component SKU ID. + */ +StockKeepingUnitId: number +/** + * Component quantity. + */ +Quantity: number +/** + * Component price per unit. + */ +UnitPrice: number +} +response: SkuKit +} +/** + * Deletes all Kit’s components based on the Parent SKU ID or deletes a specific Kit’s component based on the SKU ID. + */ +"DELETE /api/catalog/pvt/stockkeepingunitkit": { +searchParams: { +/** + * SKU’s unique numerical identifier. + */ +skuId?: number +/** + * Parent SKU’s unique numerical identifier. + */ +parentSkuId?: number +} +} +/** + * Retrieves general information about a component of a Kit. + */ +"GET /api/catalog/pvt/stockkeepingunitkit/:kitId": { +response: SkuKit +} +/** + * Deletes a specific Kit’s component based on its Kit ID. + */ +"DELETE /api/catalog/pvt/stockkeepingunitkit/:kitId": { + +} +/** + * > ⚠️ 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 + * } + * ``` + */ +"GET /api/catalog_system/pvt/skuseller/:sellerId/:sellerSkuId": { +response: { +/** + * Defines if the seller is persisted. + */ +IsPersisted: boolean +/** + * Defines if the seller is removed. + */ +IsRemoved: boolean +/** + * SKU ID in the seller's store. + */ +SkuSellerId: number +/** + * ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. + */ +SellerId: string +/** + * SKU ID in the VTEX marketplace. + */ +StockKeepingUnitId: number +/** + * SKU seller ID. + */ +SellerStockKeepingUnitId: string +/** + * Defines if the SKU binding is active. + */ +IsActive: boolean +/** + * Date when the SKU binding was updated for the last time, in UTC format. + */ +UpdateDate: string +/** + * Date when an SKU binding update was requested for the last time, in UTC format. + */ +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. + * + * Remove a seller's SKU binding, given the seller ID and the SKU ID in the seller's store. + */ +"POST /api/catalog_system/pvt/skuseller/remove/:sellerId/:sellerSkuId": { + +} +/** + * > ⚠️ 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 price or inventory, or that this is a new SKU that the seller would like to offer to the marketplace. + * + * There are two information expected by the marketplace in this request: the `sellerId`, which identifies the seller, and the `sellerSkuId`, which identifies the binding of the seller with the SKU. + * + * Both information are passed through the request URL. The body of the request should be empty. + */ +"POST /api/catalog_system/pvt/skuseller/changenotification/:sellerId/:sellerSkuId": { + +} +/** + * > ⚠️ 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 + * } + * ``` + */ +"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 + * } + * ``` + */ +"PUT /api/catalog/pvt/skuservice/:skuServiceId": { +body: { +/** + * SKU Service Type ID. + */ +SkuServiceTypeId: number +/** + * SKU Service Value ID. + */ +SkuServiceValueId: number +/** + * SKU ID. + */ +SkuId: number +/** + * SKU Service Name. Maximum of 50 characters. + */ +Name: string +/** + * Internal description for the SKU Service. Maximum of 100 characters. + */ +Text: string +/** + * Defines if the SKU Service is active or not. + */ +IsActive: boolean +} +response: SKUService +} +/** + * Dissociates an SKU Service from an SKU. + */ +"DELETE /api/catalog/pvt/skuservice/:skuServiceId": { + +} +/** + * Associates an SKU Service to an SKU. + */ +"POST /api/catalog/pvt/skuservice": { +body: { +/** + * SKU Service Type ID. + */ +SkuServiceTypeId: number +/** + * SKU Service Value ID. + */ +SkuServiceValueId: number +/** + * SKU ID. + */ +SkuId: number +/** + * SKU Service Name. Maximum of 50 characters. + */ +Name: string +/** + * Internal description of the SKU Service. Maximum of 100 characters. + */ +Text: string +/** + * Defines if the SKU Service is active or not. + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/skuservicetypeattachment": { +body: { +/** + * Attachment ID. + */ +AttachmentId: number +/** + * An explanation about the purpose of this instance. + */ +SkuServiceTypeId: number +} +response: { +/** + * SKU Service Type Attachment association ID. + */ +Id?: number +/** + * Attachment ID. + */ +AttachmentId?: number +/** + * SKU Service Type ID. + */ +SkuServiceTypeId?: number +} +} +/** + * Dissociates an Attachment by its Attachment ID or SKU Service Type ID from an SKU Service Type. + */ +"DELETE /api/catalog/pvt/skuservicetypeattachment": { +searchParams: { +/** + * SKU Service Attachment unique identifier. + */ +attachmentId?: number +/** + * SKU Service Type unique identifier. + */ +skuServiceTypeId?: number +} +} +/** + * Dissociates an Attachment from an SKU Service Type + */ +"DELETE /api/catalog/pvt/skuservicetypeattachment/:skuServiceTypeAttachmentId": { + +} +/** + * 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": { +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 + * } + * ``` + */ +"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 + * } + * ``` + */ +"PUT /api/catalog/pvt/skuservicetype/:skuServiceTypeId": { +body: SKUServiceTypeRequest +response: SKUServiceTypeResponse +} +/** + * Deletes an existing SKU Service Type. + */ +"DELETE /api/catalog/pvt/skuservicetype/:skuServiceTypeId": { + +} +/** + * 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": { +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 + * } + * ``` + */ +"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 + * } + * ``` + */ +"PUT /api/catalog/pvt/skuservicevalue/:skuServiceValueId": { +body: SKUServiceValueRequest +response: SKUServiceValueResponse +} +/** + * Deletes an existing SKU Service Value. + */ +"DELETE /api/catalog/pvt/skuservicevalue/:skuServiceValueId": { + +} +/** + * 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" + * } + * ``` + */ +"POST /api/catalog/pvt/stockkeepingunit/:skuId/specification": { +body: { +/** + * Specification field ID. + */ +FieldId: number +/** + * Specification Value ID. Required only for `FieldTypeId` as `5`, `6` and `7`. + */ +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" + * } + * ``` + */ +"PUT /api/catalog/pvt/stockkeepingunit/:skuId/specification": { +body: { +/** + * Specification and SKU association unique identifier. This field cannot be updated. + */ +Id: number +/** + * SKU unique identifier. This field cannot be updated. + */ +SkuId?: number +/** + * Specification field unique identifier. This field cannot be updated. + */ +FieldId: number +/** + * Specification value unique identifier. This field can only be updated with other values of the same `FieldId`. + */ +FieldValueId: number +/** + * Specification Value Name. This field is automatically updated if the `FieldValue` is updated. Otherwise, the value cannot be modified. + */ +Text?: string +} +response: SKUSpecificationResponse[] +} +/** + * Deletes all SKU Specifications. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/:skuId/specification": { + +} +/** + * Deletes a specific SKU Specification. + */ +"DELETE /api/catalog/pvt/stockkeepingunit/:skuId/specification/:specificationId": { + +} +/** + * 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": { +body: { +/** + * Specification name. Limited to 100 characters. + */ +FieldName: string +/** + * Group name. + */ +GroupName: string +/** + * Root level specification. + */ +RootLevelSpecification: boolean +/** + * Array of specification values. SKU Specifications must contain only one value. + */ +FieldValues: string[] +} +/** + * Array with information of all SKU specifications. + */ +response: { +/** + * ID of the association of the SKU and the specification. + */ +Id?: number +/** + * SKU ID. + */ +SkuId?: number +/** + * Specification field ID. + */ +FieldId?: number +/** + * Current specification value ID. + */ +FieldValueId?: number +/** + * Current specification value text. + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit": { +body: { +/** + * Unique identifier of an SKU. + */ +SkuId: number +} +response: { +/** + * Subcollection’s unique numerical identifier. + */ +SubCollectionId?: number +/** + * Unique identifier of the SKU. + */ +SkuId?: 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). + * + * Deletes an SKU from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + */ +"DELETE /api/catalog/pvt/subcollection/:subCollectionId/stockkeepingunit/:skuId": { + +} +/** + * 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 + * } + * ``` + */ +"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 + * } + * ``` + */ +"PUT /api/catalog/pvt/category/:categoryId": { +body: { +/** + * Category name. + */ +Name: string +/** + * Substitute words for the Category. + */ +Keywords: string +/** + * Text used in title tag for Category page. + */ +Title: string +/** + * Text used in meta description tag for Category page. + */ +Description: string +/** + * @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 +/** + * ID of the parent category, apply in case of category and subcategory. + */ +FatherCategoryId: (null | number) +/** + * Google Global Category ID. + */ +GlobalCategoryId: number +/** + * If true, the Category is shown in the top and side menu. + */ +ShowInStoreFront: boolean +/** + * If true, the Category page becomes available in store. + */ +IsActive: boolean +/** + * If true, the Category link becomes active in store. + */ +ActiveStoreFrontLink: boolean +/** + * If true, the Category page displays a Brand filter. + */ +ShowBrandFilter: boolean +/** + * Score for search sorting order. + */ +Score: number +/** + * Defines how the SKU will be exhibited + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/category": { +body: CreateCategoryRequest +response: Category +} +/** + * 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/": { +/** + * Array of objects with similar category information. + */ +response: { +/** + * Product ID. + */ +ProductId?: number +/** + * Similar Category ID. + */ +CategoryId?: number +}[] +} +/** + * Adds a Similar Category to a Product. + * + * ## Response body example + * + * ```json + * { + * "ProductId": 1, + * "StoreId": 1 + * } + * ``` + */ +"POST /api/catalog/pvt/product/:productId/similarcategory/:categoryId": { +/** + * Object containing information related to the similar category. + */ +response: { +/** + * Product ID. + */ +ProductId?: number +/** + * Trade Policy ID. + */ +StoreId?: number +} +} +/** + * Deletes a Similar Category from a Product. + */ +"DELETE /api/catalog/pvt/product/:productId/similarcategory/:categoryId": { + +} +/** + * 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 + * } + * ] + * ``` + */ +"GET /api/catalog_system/pub/specification/field/listTreeByCategoryId/:categoryId": { +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 + * } + * ``` + */ +"POST /api/catalog/pvt/subcollection/:subCollectionId/category": { +body: { +/** + * Unique identifier of a Category. + */ +CategoryId: number +} +response: { +/** + * Subcollection’s unique numerical identifier. + */ +SubCollectionId?: number +/** + * Unique identifier of the Category. + */ +CategoryId?: 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). + * + * Deletes a Category from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + */ +"DELETE /api/catalog/pvt/subcollection/:subCollectionId/brand/:categoryId": { + +} +/** + * 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": { +/** + * An array with all brands registered in the store. + */ +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 + * } + * } + * ``` + */ +"GET /api/catalog_system/pvt/brand/pagedlist": { +searchParams: { +/** + * Quantity of brands per page. + */ +pageSize: number +/** + * Page number of the brand list. + */ +page: number +} +response: { +/** + * Array of objects with information of the store's brands. + */ +items: BrandGet[] +/** + * Object with pagination information. + */ +paging: { +/** + * Page number of the brand list. + */ +page: number +/** + * Quantity of brands per page. + */ +perPage: number +/** + * Total of brands in the store. + */ +total: number +/** + * Total number of pages. + */ +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 + * } + * ``` + */ +"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" + * } + * ``` + */ +"POST /api/catalog/pvt/brand": { +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" + * } + * ``` + */ +"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" + * } + * ``` + */ +"PUT /api/catalog/pvt/brand/:brandId": { +body: BrandCreateUpdate +response: BrandCreateUpdate +} +/** + * Deletes an existing Brand. + */ +"DELETE /api/catalog/pvt/brand/:brandId": { + +} +/** + * >⚠️ 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 + * } + * ``` + */ +"POST /api/catalog/pvt/subcollection/:subCollectionId/brand": { +body: { +/** + * Unique identifier of a Brand. + */ +BrandId: number +} +response: { +/** + * Subcollection’s unique numerical identifier. + */ +SubCollectionId?: number +/** + * Unique identifier of the Brand. + */ +BrandId?: 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). + * + * Deletes a Brand from a Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + */ +"DELETE /api/catalog/pvt/subcollection/:subCollectionId/brand/:brandId": { + +} +/** + * 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" + * } + * ] + * } + * ``` + */ +"PUT /api/catalog/pvt/attachment/:attachmentid": { +body: AttachmentRequest +response: AttachmentResponse +} +/** + * Deletes a previously existing SKU attachment. + */ +"DELETE /api/catalog/pvt/attachment/:attachmentid": { + +} +/** + * 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": { +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": "[]" + * } + * ] + * } + * ] + * } + * ``` + */ +"GET /api/catalog/pvt/attachments": { +response: { +/** + * Current page of results. + */ +Page?: number +/** + * Total number of results in the current page. + */ +Size?: number +/** + * Total number of rows with results. + */ +TotalRows?: number +/** + * Total number of pages with results. + */ +TotalPage?: number +/** + * Array containing attachments data. + */ +Data?: AttachmentResponse[] +} +} +/** + * Retrieves a list of all collections matching a filter. + */ +"GET /api/catalog_system/pvt/collection/search": { +searchParams: { +/** + * Page number. + */ +page: number +/** + * Number of the items of the page. + */ +pageSize: number +/** + * Defines if the items of the page are in ascending order. + */ +orderByAsc: boolean +} +} +/** + * Retrieves a list of Collection IDs of the inactive Collections. + */ +"GET /api/catalog/pvt/collection/inactive": { + +} +/** + * Creates a new collection. + */ +"POST /api/catalog/pvt/collection/": { +body: { +/** + * Collection's Name. + */ +Name: string +/** + * Collection's description for internal use, with the collection's details. It will not be used for search engines. + */ +Description: string +/** + * Option making the collection searchable in the store. + */ +Searchable: boolean +/** + * Option if you want the collection to highlight specific products using a tag. + */ +Highlight: boolean +/** + * Collection start date and time. If a future date and time are set, the collection will have a scheduled status. + */ +DateFrom: string +/** + * Collection end date and time. + */ +DateTo: string +} +} +/** + * Retrieves a list of collections matching a filter. + */ +"GET /api/catalog_system/pvt/collection/search/:searchTerms": { +searchParams: { +/** + * Page number. + */ +page?: number +/** + * Number of the items of the page. + */ +pageSize?: number +/** + * Defines if the items of the page are in ascending order. + */ +orderByAsc?: boolean +} +} +/** + * Imports a sample of the imported XLS file. You need to save the response file to your device. + */ +"GET /api/catalog/pvt/collection/stockkeepingunit/importfileexample": { + +} +/** + * Adds products to a collection from the request body file. The file must be an imported template. + */ +"POST /api/catalog/pvt/collection/:collectionId/stockkeepingunit/importinsert": { + +} +/** + * Removes products from a collection from the request body file. The file must be an imported template. + */ +"POST /api/catalog/pvt/collection/:collectionId/stockkeepingunit/importexclude": { + +} +/** + * Retrieves information about the products from a collection. + */ +"GET /api/catalog/pvt/collection/:collectionId/products": { +searchParams: { +/** + * Page number. + */ +page?: number +/** + * Number of the items of the page. + */ +pageSize?: number +/** + * Filter used to refine the Collection's products. + */ +Filter?: string +/** + * Defines if the status of the product is active or not. + */ +Active?: boolean +/** + * Defines if the product is visible on the store or not. + */ +Visible?: boolean +/** + * Product's Category unique identifier. + */ +CategoryId?: number +/** + * Product's Brand unique identifier. + */ +BrandId?: number +/** + * Product's Supplier unique identifier. + */ +SupplierId?: number +/** + * Product's Trade Policy unique identifier. + */ +SalesChannelId?: number +/** + * Product past release date. + */ +ReleaseFrom?: string +/** + * Product future release date. + */ +ReleaseTo?: string +/** + * Product Specification Field Value. You must also fill in `SpecificationFieldId` to use this parameter. + */ +SpecificationProduct?: string +/** + * Product Specification Field unique identifier. + */ +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" + * } + * ``` + */ +"GET /api/catalog/pvt/collection/:collectionId": { +response: { +/** + * Collection ID. + */ +Id?: number +/** + * Collection Name. + */ +Name?: string +/** + * Collection description. + */ +Description?: (null | string) +/** + * Defines if the Collection is searchable or not. + */ +Searchable?: boolean +/** + * Defines if the Collection is highlighted or not. + */ +Highlight?: boolean +/** + * Initial value date for the Collection. + */ +DateFrom?: string +/** + * Final value date for the Collection. + */ +DateTo?: string +/** + * Total quantity of products in the collection. + */ +TotalProducts?: number +/** + * Type of collection. + */ +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" + * } + * ``` + */ +"PUT /api/catalog/pvt/collection/:collectionId": { +body: { +/** + * Collection Name. + */ +Name: string +/** + * Defines if the Collection is searchable or not. + */ +Searchable: boolean +/** + * Defines if the Collection is highlighted or not + */ +Highlight: boolean +/** + * Initial value date for the Collection. + */ +DateFrom: string +/** + * Final value date for the Collection. + */ +DateTo: string +} +response: { +/** + * Collection ID. + */ +Id?: number +/** + * Collection Name. + */ +Name?: string +/** + * Collection description. + */ +Description?: (null | string) +/** + * Defines if the Collection is searchable or not. + */ +Searchable?: boolean +/** + * Defines if the Collection is highlighted or not. + */ +Highlight?: boolean +/** + * Initial value date for the Collection. + */ +DateFrom?: string +/** + * Final value date for the Collection. + */ +DateTo?: string +/** + * Total quantity of products in the collection. + */ +TotalProducts?: number +/** + * Type of collection. + */ +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). + * + * Deletes a previously existing Collection. + */ +"DELETE /api/catalog/pvt/collection/:collectionId": { + +} +/** + * >⚠️ 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" + * } + * ``` + */ +"POST /api/catalog/pvt/collection": { +body: { +/** + * Collection Name. + */ +Name: string +/** + * Defines if the Collection is searchable or not. + */ +Searchable: boolean +/** + * Defines if the Collection is highlighted or not. + */ +Highlight: boolean +/** + * Initial value date for the Collection. + */ +DateFrom: string +/** + * Final value date for the Collection. + */ +DateTo: string +} +response: { +/** + * Collection ID. + */ +Id?: number +/** + * Collection Name. + */ +Name?: string +/** + * Collection description. + */ +Description?: (null | string) +/** + * Defines if the Collection is searchable or not. + */ +Searchable?: boolean +/** + * Defines if the Collection is highlighted or not. + */ +Highlight?: boolean +/** + * Initial value date for the Collection. + */ +DateFrom?: string +/** + * Final value date for the Collection. + */ +DateTo?: string +/** + * Total quantity of products in the collection. + */ +TotalProducts?: number +/** + * Type of collection. + */ +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 + * } + * ] + * ``` + */ +"GET /api/catalog/pvt/collection/:collectionId/subcollection": { +response: { +/** + * Subcollection ID. + */ +Id?: number +/** + * Collection ID. + */ +CollectionId?: number +/** + * Subcollection Name. + */ +Name?: string +/** + * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). + */ +Type?: string +/** + * Defines if the collection is on PreSale. + */ +PreSale?: boolean +/** + * Defines if the collection is a new released one. + */ +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 + * } + * ``` + */ +"GET /api/catalog/pvt/subcollection/:subCollectionId": { +response: { +/** + * Subcollection ID. + */ +Id?: number +/** + * Collection ID. + */ +CollectionId?: number +/** + * Subcollection Name. + */ +Name?: string +/** + * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). + */ +Type?: string +/** + * Defines if the collection is on PreSale. + */ +PreSale?: boolean +/** + * Defines if the collection is a new released one. + */ +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 + * } + * ``` + */ +"PUT /api/catalog/pvt/subcollection/:subCollectionId": { +body: { +/** + * Collection ID. + */ +CollectionId: number +/** + * Subcollection Name. + */ +Name: string +/** + * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). + */ +Type: string +/** + * Defines PreSale date. + */ +PreSale: boolean +/** + * Defines Release date. + */ +Release: boolean +} +response: { +/** + * Subcollection ID. + */ +Id?: number +/** + * Collection ID. + */ +CollectionId?: number +/** + * Subcollection Name. + */ +Name?: string +/** + * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). + */ +Type?: string +/** + * Defines if the collection is on PreSale. + */ +PreSale?: boolean +/** + * Defines if the collection is a new released one. + */ +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). + * + * Deletes a previously created Subcollection, which is a [Group](https://help.vtex.com/en/tutorial/adding-collections-cms--2YBy6P6X0NFRpkD2ZBxF6L#group-types) within a Collection. + */ +"DELETE /api/catalog/pvt/subcollection/:subCollectionId": { + +} +/** + * >⚠️ 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 + * } + * ``` + */ +"POST /api/catalog/pvt/subcollection": { +body: { +/** + * SubCollection ID. + */ +CollectionId: number +/** + * SubCollection Name. + */ +Name: string +/** + * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). + */ +Type: string +/** + * Defines PreSale date. + */ +PreSale: boolean +/** + * Defines Release date. + */ +Release: boolean +} +response: { +/** + * Subcollection ID. + */ +Id?: number +/** + * Collection ID. + */ +CollectionId?: number +/** + * Subcollection Name. + */ +Name?: string +/** + * Either `“Exclusive”` (all the products contained in it will not be used) or `“Inclusive”` (all the products contained in it will be used). + */ +Type?: string +/** + * Defines if the collection is on PreSale. + */ +PreSale?: boolean +/** + * Defines if the collection is a new released one. + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/collection/:collectionId/position": { +body: { +/** + * SKU ID. + */ +skuId: number +/** + * SKU position. + */ +position: number +/** + * Subcollection ID. + */ +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" + * } + * ``` + * + */ +"GET /api/catalog/pvt/specification/:specificationId": { +response: { +/** + * Created Specification’s ID. + */ +Id: number +/** + * Field Type can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. + */ +FieldTypeId: number +/** + * Specification Category ID. + */ +CategoryId: number +/** + * Numerical ID of the Group of Specifications that contains the new Specification. + */ +FieldGroupId: number +/** + * Specification name. Limited to 100 characters. + */ +Name: string +/** + * Specification Description. + */ +Description: string +/** + * The current Specification's position in comparison to the other Specifications. + */ +Position: number +/** + * Defines if the Specification can be used as a Filter. + */ +IsFilter: boolean +/** + * Defines if the Specification is required or not. + */ +IsRequired: boolean +/** + * Defines if the Specification will be shown on the Product screen in the specification area. + */ +IsOnProductDetails: boolean +/** + * Defines if the Specification is applied to a specific SKU. + */ +IsStockKeepingUnit: boolean +/** + * @deprecated + * Deprecated + */ +IsWizard: boolean +/** + * Defines if the Specification is active or not. + */ +IsActive: boolean +/** + * Defines if the Specification is shown in the main menu of the site. + */ +IsTopMenuLinkActive: boolean +/** + * Defines if the Specification is shown in the side menu. + */ +IsSideMenuLinkActive: boolean +/** + * Specification Default Value. + */ +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" + * } + * ``` + * + */ +"PUT /api/catalog/pvt/specification/:specificationId": { +body: { +/** + * Field Type can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. This information is not editable. + */ +FieldTypeId: number +/** + * Specification Category ID. This information is not editable. + */ +CategoryId: number +/** + * Numerical ID of the Group of Specifications that contains the new Specification. This information is not editable. + */ +FieldGroupId: number +/** + * Specification name. Limited to 100 characters. + */ +Name: string +/** + * Specification Description. + */ +Description: string +/** + * The current Specification's position in comparison to the other Specifications. + */ +Position: number +/** + * Defines if the Specification can be used as a Filter. + */ +IsFilter: boolean +/** + * Defines if the Specification is required or not. + */ +IsRequired: boolean +/** + * Defines if the Specification will be shown on the Product screen in the specification area. + */ +IsOnProductDetails: boolean +/** + * Defines if the Specification is applied to a specific SKU. This information is not editable. + */ +IsStockKeepingUnit: boolean +/** + * @deprecated + * Deprecated + */ +IsWizard: boolean +/** + * Defines if the Specification is active or not. + */ +IsActive: boolean +/** + * Defines if the Specification is shown in the main menu of the site. + */ +IsTopMenuLinkActive: boolean +/** + * Defines if the Specification is shown in the side menu. + */ +IsSideMenuLinkActive: boolean +/** + * Specification Default Value. + */ +DefaultValue: string +} +response: { +/** + * Specification ID. + */ +Id?: number +/** + * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. + */ +FieldTypeId?: number +/** + * Category ID associated with this specification. + */ +CategoryId?: number +/** + * ID of the group of specifications that contains the new specification. + */ +FieldGroupId?: number +/** + * Specification name. Limited to 100 characters. + */ +Name?: string +/** + * @deprecated + */ +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. + * + */ +Position?: number +/** + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * + */ +IsFilter?: boolean +/** + * Makes the specification mandatory (`true`) or optional (`false`). + */ +IsRequired?: boolean +/** + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. + * + */ +IsOnProductDetails?: boolean +/** + * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. + */ +IsStockKeepingUnit?: boolean +/** + * @deprecated + */ +IsWizard?: (null | boolean) +/** + * Enable (`true`) or disable (`false`) specification. + */ +IsActive?: boolean +/** + * 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. + * + */ +IsSideMenuLinkActive?: boolean +/** + * Specification default value. + */ +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" + * } + * ``` + * + */ +"POST /api/catalog/pvt/specification": { +body: { +/** + * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. + */ +FieldTypeId: number +/** + * Category ID associated with this specification. + */ +CategoryId?: number +/** + * ID of the group of specifications that contains the new specification. + */ +FieldGroupId: number +/** + * Specification name. Limited to 100 characters. + */ +Name: string +/** + * @deprecated + */ +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. + * + */ +Position?: number +/** + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * + */ +IsFilter?: boolean +/** + * Makes the specification mandatory (`true`) or optional (`false`). + */ +IsRequired?: boolean +/** + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. + * + */ +IsOnProductDetails?: boolean +/** + * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. + */ +IsStockKeepingUnit?: boolean +/** + * @deprecated + */ +IsWizard?: (null | boolean) +/** + * Enable (`true`) or disable (`false`) specification. + */ +IsActive?: boolean +/** + * 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. + * + */ +IsSideMenuLinkActive?: boolean +/** + * Specification default value. + */ +DefaultValue?: string +} +response: { +/** + * Specification ID. + */ +Id?: number +/** + * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. + */ +FieldTypeId?: number +/** + * Category ID associated with this specification. + */ +CategoryId?: number +/** + * ID of the group of specifications that contains the new specification. + */ +FieldGroupId?: number +/** + * Specification name. Limited to 100 characters. + */ +Name?: string +/** + * @deprecated + */ +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. + * + */ +Position?: number +/** + * Store Framework - Deprecated. + * Legacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar. + * + */ +IsFilter?: boolean +/** + * Makes the specification mandatory (`true`) or optional (`false`). + */ +IsRequired?: boolean +/** + * Store Framework - Deprecated. + * Legacy CMS Portal -If specification is visible on the product page. + * + */ +IsOnProductDetails?: boolean +/** + * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. + */ +IsStockKeepingUnit?: boolean +/** + * @deprecated + */ +IsWizard?: (null | boolean) +/** + * Enable (`true`) or disable (`false`) specification. + */ +IsActive?: boolean +/** + * 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. + * + */ +IsSideMenuLinkActive?: boolean +/** + * Specification default value. + */ +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" + * } + * ``` + * + * + */ +"GET /api/catalog_system/pub/specification/fieldGet/:fieldId": { +response: { +/** + * Specification field name. + */ +Name?: string +/** + * Specification field ID. + */ +FieldId?: number +/** + * Enable (`true`) or disable (`false`) specification. + */ +IsActive?: boolean +/** + * Makes the specification mandatory (`true`) or optional (`false`). + */ +IsRequired?: boolean +/** + * Field Type ID can be `1 - Text`, `2 - Multi-Line Text`, `4 - Number`, `5 - Combo`, `6 - Radio`, `7 - Checkbox`, `8 - Indexed Text`, `9 - Indexed Multi-Line Text`. + */ +FieldTypeId?: number +/** + * Field Type name, which can be `Text`, `Multi-Line Text`, `Number`, `Combo`, `Radio`, `Checkbox`, `Indexed Text` or `Indexed Multi-Line Text`. + */ +FieldTypeName?: string +/** + * Specification value ID. + */ +FieldValueId?: (null | number) +/** + * @deprecated + */ +Description?: (null | string) +/** + * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. + */ +IsStockKeepingUnit?: boolean +/** + * 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. + * + */ +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. + * + */ +Position?: number +/** + * @deprecated + */ +IsWizard?: (null | boolean) +/** + * 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. + * + */ +IsSideMenuLinkActive?: boolean +/** + * Specification default value. + */ +DefaultValue?: (null | string) +/** + * ID of the group of specifications that contains the new specification. + */ +FieldGroupId?: number +/** + * Specification Field Group Name. + */ +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 + * ``` + */ +"POST /api/catalog_system/pvt/specification/field": { +body: SpecificationsInsertFieldRequest +/** + * Specification field ID. + */ +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 + * ``` + */ +"PUT /api/catalog_system/pvt/specification/field": { +body: SpecificationsInsertFieldUpdateRequest +/** + * Specification field ID. + */ +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 + * } + * ``` + */ +"GET /api/catalog_system/pvt/specification/fieldValue/:fieldValueId": { +response: { +/** + * Specification Field Value ID. + */ +FieldValueId?: number +/** + * Specification Field ID. + */ +FieldId?: number +/** + * Specification Field Value Name. + */ +Name?: string +/** + * Specification Field Value Description. + */ +Text?: string +/** + * Defines if the Specification Field Value is active (`true`) or inactive (`false`). + */ +IsActive?: boolean +/** + * Specification Field Value Position. + */ +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 + * } + * ] + * ``` + */ +"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 + * } + * ``` + */ +"POST /api/catalog_system/pvt/specification/fieldValue": { +body: SpecificationsInsertFieldValueRequest +response: { +/** + * Specification Field Value ID. + */ +FieldValueId?: number +/** + * Specification Field ID. + */ +FieldId?: number +/** + * Specification Field Value Name. + */ +Name?: string +/** + * Specification Field Value Description. + */ +Text?: string +/** + * Defines if the Specification Field Value is active (`true`) or inactive (`false`). + */ +IsActive?: boolean +/** + * Specification Field Value Position. + */ +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" + * ``` + */ +"PUT /api/catalog_system/pvt/specification/fieldValue": { +body: SpecificationsUpdateFieldValueRequest +/** + * Status of the request. + */ +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 + * } + * ``` + */ +"GET /api/catalog/pvt/specificationvalue/:specificationValueId": { +response: { +/** + * Specification Field Value ID. + */ +FieldValueId?: number +/** + * Specification Field ID. + */ +FieldId?: number +/** + * Specification Field Value Name. + */ +Name?: string +/** + * Specification Field Value Description. + */ +Text?: string +/** + * Defines if the Specification Field Value is active (`true`) or inactive (`false`). + */ +IsActive?: boolean +/** + * Specification Field Value Position. + */ +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 + * } + * ``` + */ +"PUT /api/catalog/pvt/specificationvalue/:specificationValueId": { +body: { +/** + * Specification ID associated with this specification value. + */ +FieldId: number +/** + * Specification Value name. + */ +Name: string +/** + * @deprecated + * Specification Value Text. + */ +Text?: (null | string) +/** + * Enable (`true`) or disable (`false`) specification value. + */ +IsActive?: boolean +/** + * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). + */ +Position?: number +} +response: { +/** + * Specification value ID. + */ +FieldValueId?: number +/** + * Specification field ID associated with this specification value. + */ +FieldId?: number +/** + * Specification Value name. + */ +Name?: string +/** + * @deprecated + * Specification Value Text. + */ +Text?: (null | string) +/** + * Enable (`true`) or disable (`false`) specification value. + */ +IsActive?: boolean +/** + * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/specificationvalue": { +body: { +/** + * Specification field ID associated with this specification value. + */ +FieldId: number +/** + * Specification Value name. + */ +Name: string +/** + * @deprecated + * Specification Value Text. + */ +Text?: (null | string) +/** + * Enable (`true`) or disable (`false`) specification value. + */ +IsActive?: boolean +/** + * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). + */ +Position?: number +} +response: { +/** + * Specification value ID. + */ +FieldValueId?: number +/** + * Specification field ID associated with this specification value. + */ +FieldId?: number +/** + * Specification Value name. + */ +Name?: string +/** + * @deprecated + * Specification Value Text. + */ +Text?: (null | string) +/** + * Enable (`true`) or disable (`false`) specification value. + */ +IsActive?: boolean +/** + * The position of the value to be shown on product registration page (`/admin/Site/Produto.aspx`). + */ +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 + * } + * ] + * ``` + */ +"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 + * } + * ``` + */ +"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 + * } + * ``` + */ +"POST /api/catalog/pvt/specificationgroup": { +body: SpecificationGroupInsertRequest +response: { +/** + * Specification Group ID. + */ +Id?: number +/** + * Category ID. + */ +CategoryId?: number +/** + * Specification Group Name. + */ +Name?: string +/** + * 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 + * } + * ``` + */ +"PUT /api/catalog/pvt/specificationgroup/:groupId": { +body: { +/** + * Category ID where the Specification Group is contained. + */ +CategoryId: number +/** + * Specification Group ID. + */ +Id: number +/** + * Specification Group Name. + */ +Name: string +/** + * Specification Group Position. + */ +Position: number +} +response: { +/** + * Category ID where the Specification Group is contained. + */ +CategoryId?: number +/** + * Specification Group ID. + */ +Id?: number +/** + * Specification Group Name. + */ +Name?: string +/** + * Specification Group Position. + */ +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" + * } + * ``` + */ +"GET /api/catalog/pvt/specification/nonstructured/:id": { +response: { +/** + * Non Structured Specification’s unique numerical identifier. + */ +Id?: number +/** + * SKU's unique numerical identifier. + */ +SkuId?: number +/** + * Name of the Non Structured Specification. + */ +SpecificationName?: string +/** + * Value of the Non Structured Specification. + */ +SpecificationValue?: string +}[] +} +/** + * Deletes unmapped Specifications of a Seller'S SKU in a Marketplace by its unique ID. + */ +"DELETE /api/catalog/pvt/specification/nonstructured/:id": { + +} +/** + * 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": { +searchParams: { +/** + * SKU’s unique numerical identifier. + */ +skuId: number +} +response: { +/** + * Non Structured Specification’s unique numerical identifier. + */ +Id?: number +/** + * SKU's unique numerical identifier. + */ +SkuId?: number +/** + * Name of the Non Structured Specification. + */ +SpecificationName?: string +/** + * Value of the Non Structured Specification. + */ +SpecificationValue?: string +}[] +} +/** + * Deletes unmapped Specifications of a Seller'S SKU in a Marketplace by SKU ID. + */ +"DELETE /api/catalog/pvt/specification/nonstructured": { +searchParams: { +/** + * SKU’s unique numerical identifier. + */ +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 + * } + * ] + * ``` + */ +"GET /api/catalog_system/pvt/saleschannel/list": { +response: { +/** + * Sales Channel unique identifier. + */ +Id?: number +/** + * Sales Channel name. + */ +Name?: string +/** + * Defines if the Sales Channel is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Product Cluster ID, if the Sales Channel has releated Product Cluster. + */ +ProductClusterId?: (null | number) +/** + * Country Code in ISO 3166-1 alfa-3 Standard. + */ +CountryCode?: string +/** + * Language Country code in LCIDstring Standard. + */ +CultureInfo?: string +/** + * Name of Time Zone. + */ +TimeZone?: string +/** + * Currency Code in ISO 4217 standard. + */ +CurrencyCode?: string +/** + * Currency symbol. + */ +CurrencySymbol?: string +/** + * Currency Locale Code in LCID standard. + */ +CurrencyLocale?: number +/** + * Object with currency format. + */ +CurrencyFormatInfo?: { +/** + * Quantity of Currency Decimal Digits. + */ +CurrencyDecimalDigits?: number +/** + * Defines which Currency Decimal Separator will be applied. + */ +CurrencyDecimalSeparator?: string +/** + * Defines which Currency Group Separator will be applied. + */ +CurrencyGroupSeparator?: string +/** + * Define how many characters will be grouped. + */ +CurrencyGroupSize?: number +/** + * Defines if all prices will be initiated with Currency Symbol (`true`) or not (`false`). + */ +StartsWithCurrencySymbol?: boolean +} +/** + * Origin of products in the Sales Channel. + */ +Origin?: (null | string) +/** + * Defines the position on index. + */ +Position?: (null | number) +/** + * Defines what is the conditional rule to activate de Sales Channel. + */ +ConditionRule?: (null | string) +/** + * Quantity of Currency Decimal Digits. + */ +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 + * } + * ``` + */ +"GET /api/catalog_system/pub/saleschannel/:salesChannelId": { +response: { +/** + * Sales Channel unique identifier. + */ +Id?: number +/** + * Sales Channel name. + */ +Name?: string +/** + * Defines if the Sales Channel is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Product Cluster ID, if the Sales Channel has releated Product Cluster. + */ +ProductClusterId?: (null | number) +/** + * Country Code in ISO 3166-1 alfa-3 Standard. + */ +CountryCode?: string +/** + * Language Country code in LCIDstring Standard. + */ +CultureInfo?: string +/** + * Name of Time Zone. + */ +TimeZone?: string +/** + * Currency Code in ISO 4217 standard. + */ +CurrencyCode?: string +/** + * Currency symbol. + */ +CurrencySymbol?: string +/** + * Currency Locale Code in LCID standard. + */ +CurrencyLocale?: number +/** + * Object with currency format. + */ +CurrencyFormatInfo?: { +/** + * Quantity of Currency Decimal Digits. + */ +CurrencyDecimalDigits?: number +/** + * Defines which Currency Decimal Separator will be applied. + */ +CurrencyDecimalSeparator?: string +/** + * Defines which Currency Group Separator will be applied. + */ +CurrencyGroupSeparator?: string +/** + * Define how many characters will be grouped. + */ +CurrencyGroupSize?: number +/** + * Defines if all prices will be initiated with Currency Symbol (`true`) or not (`false`). + */ +StartsWithCurrencySymbol?: boolean +} +/** + * Origin of products in the Sales Channel. + */ +Origin?: (null | string) +/** + * Defines the position on index. + */ +Position?: (null | number) +/** + * Defines what is the conditional rule to activate de Sales Channel. + */ +ConditionRule?: (null | string) +/** + * Quantity of Currency Decimal Digits. + */ +CurrencyDecimalDigits?: number +} +} +/** + * Retrieves the seller's details by its ID. + */ +"GET /api/catalog_system/pvt/seller/list": { +searchParams: { +/** + * Trade policy ID. + */ +sc?: number +/** + * Seller type. + */ +sellerType?: number +/** + * If the seller is better scope. + */ +isBetterScope?: boolean +} +response: { +/** + * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. + */ +SellerId?: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name?: string +/** + * Email of the admin responsible for the seller. + */ +Email?: string +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description?: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy?: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy?: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions?: boolean +/** + * Seller username. + */ +UserName?: (null | string) +/** + * Seller password. + */ +Password?: (null | string) +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy?: string +/** + * Company registration number. + */ +CNPJ?: string +/** + * CSC identification. + */ +CSCIdentification?: string +/** + * Seller archive ID. + */ +ArchiveId?: (null | number) +/** + * Seller URL logo. + */ +UrlLogo?: (null | string) +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint?: (null | string) +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint?: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId?: (null | number) +/** + * Seller type. + */ +SellerType?: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope?: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +TrustPolicy?: string +} +} +/** + * Retrieves the seller's details by its ID. + */ +"GET /api/catalog_system/pvt/seller/:sellerId": { +/** + * Object with information of all sellers in the store. + */ +response: { +/** + * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. + */ +SellerId?: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name?: string +/** + * Email of the admin responsible for the seller. + */ +Email?: string +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description?: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy?: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy?: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions?: boolean +/** + * Seller username. + */ +UserName?: (null | string) +/** + * Seller password. + */ +Password?: (null | string) +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy?: string +/** + * Company registration number. + */ +CNPJ?: string +/** + * CSC identification. + */ +CSCIdentification?: string +/** + * Seller archive ID. + */ +ArchiveId?: (null | number) +/** + * Seller URL logo. + */ +UrlLogo?: string +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint?: (null | string) +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint?: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId?: (null | number) +/** + * Seller type. + */ +SellerType?: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope?: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +TrustPolicy?: string +} +} +/** + * Creates a new seller. + */ +"POST /api/catalog_system/pvt/seller": { +body: CreateSellerRequest +response: { +/** + * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. + */ +SellerId?: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name?: string +/** + * Email of the admin responsible for the seller. + */ +Email?: string +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description?: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy?: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy?: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions?: boolean +/** + * Seller username. + */ +UserName?: (null | string) +/** + * Seller password. + */ +Password?: (null | string) +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy?: string +/** + * Company registration number. + */ +CNPJ?: string +/** + * CSC identification. + */ +CSCIdentification?: string +/** + * Seller archive ID. + */ +ArchiveId?: (null | number) +/** + * Seller URL logo. + */ +UrlLogo?: (null | string) +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint?: (null | string) +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint?: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId?: (null | number) +/** + * Seller type. + */ +SellerType?: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope?: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +TrustPolicy?: string +} +} +/** + * Updates a seller. + */ +"PUT /api/catalog_system/pvt/seller": { +body: UpdateSellerRequest +response: { +/** + * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. + */ +SellerId?: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name?: string +/** + * Email of the admin responsible for the seller. + */ +Email?: string +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description?: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy?: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy?: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions?: boolean +/** + * Seller username. + */ +UserName?: (null | string) +/** + * Seller password. + */ +Password?: (null | string) +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy?: string +/** + * Company registration number. + */ +CNPJ?: string +/** + * CSC identification. + */ +CSCIdentification?: string +/** + * Seller archive ID. + */ +ArchiveId?: (null | number) +/** + * Seller URL logo. + */ +UrlLogo?: (null | string) +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint?: (null | string) +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint?: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId?: (null | number) +/** + * Seller type. + */ +SellerType?: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope?: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +TrustPolicy?: string +} +} +/** + * Retrieves the seller's details by its ID. + */ +"GET /api/catalog_system/pvt/sellers/:sellerId": { +/** + * Object with information of all sellers in the store. + */ +response: { +/** + * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. + */ +SellerId?: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name?: (null | string) +/** + * Email of the admin responsible for the seller. + */ +Email?: (null | string) +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description?: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy?: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy?: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions?: boolean +/** + * Seller username. + */ +UserName?: (null | string) +/** + * Seller password. + */ +Password?: (null | string) +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy?: string +/** + * Company registration number. + */ +CNPJ?: string +/** + * CSC identification. + */ +CSCIdentification?: string +/** + * Seller archive ID. + */ +ArchiveId?: (null | number) +/** + * Seller URL logo. + */ +UrlLogo?: string +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage?: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint?: (null | string) +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint?: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive?: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-de-pagamento--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId?: (null | number) +/** + * Seller type. + */ +SellerType?: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope?: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +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 + * } + * ``` + */ +"POST /api/catalog/pvt/supplier": { +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 + * } + * ``` + */ +"PUT /api/catalog/pvt/supplier/:supplierId": { +body: SupplierRequest +response: SupplierResponse +} +/** + * Deletes an existing Supplier. + */ +"DELETE /api/catalog/pvt/supplier/:supplierId": { + +} +/** + * 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": { +response: { +/** + * Product’s unique numerical identifier. + */ +ProductId?: number +/** + * Trade policy's unique numerical identifier. + */ +StoreId?: number +}[] +} +/** + * Associates an existing Trade Policy with a Product. + */ +"POST /api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId": { + +} +/** + * Disassociates a Trade Policy of a Product. + */ +"DELETE /api/catalog/pvt/product/:productId/salespolicy/:tradepolicyId": { + +} +/** + * 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": { +searchParams: { +/** + * Trade Policy’s unique numerical identifier. + */ +sc: number +/** + * Page number. + */ +page?: number +/** + * Number of items in the page. + */ +pageSize?: number +/** + * If set as `false`, it allows the user to decide if the SKUs that are not assigned to a specific trade policy should be also returned. + */ +onlyAssigned?: boolean +} +/** + * List of SKU IDs of the Trade Policy. + */ +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" + * ``` + */ +"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 + * } + * ] + * ``` + */ +"GET /api/catalog_system/pvt/commercialcondition/list": { +response: { +/** + * Commercial condition ID. + */ +Id?: number +/** + * Commercial condition name. + */ +Name?: string +/** + * Defines if the commercial condition is default (`true`) or not (`false`). + */ +IsDefault?: boolean +}[] +} +/** + * 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": { +/** + * Object with information of the commercial condition. + */ +response: { +/** + * Commercial condition ID. + */ +Id?: number +/** + * Commercial condition name. + */ +Name?: string +/** + * If the commercial condition is default (`true`) or not (`false`). + */ +IsDefault?: boolean +} +} +/** + * Retrieves information about a Gift List by its ID. + */ +"GET /api/addon/pvt/giftlist/get/:listId": { +/** + * Object with information about the Gift List. + */ +response: { +/** + * Gift List ID. + */ +giftListId?: number +/** + * Gift List name. + */ +name?: string +/** + * User ID. + */ +userId?: string +/** + * File ID. + */ +fileId?: (null | number) +/** + * Gift List Type ID. + */ +giftListTypeId?: number +/** + * Gift List Type name. + */ +giftListTypeName?: string +/** + * Gift Card ID. + */ +giftCardId?: number +/** + * Gift List message. + */ +message?: string +/** + * Slug of the gift list that will be part of its URL. + */ +urlFolder?: string +/** + * Date when the gift list was created. + */ +dateCreated?: string +/** + * Name of the user's address. + */ +profileSystemUserAddressName?: string +/** + * User ID on Profile System. + */ +profileSystemUserId?: string +/** + * Date of the event associated with the Gift List. + */ +eventDate?: string +/** + * Location of the event associated with the Gift List. + */ +eventLocation?: string +/** + * City of the event associated with the Gift List. + */ +eventCity?: string +/** + * State of the event associated with the Gift List. + */ +eventState?: string +/** + * Telemarketing ID. + */ +telemarketingId?: (null | number) +/** + * Telemarketing observation. + */ +telemarketingObservation?: string +/** + * Defines if the gift list is public. + */ +IsPublic?: boolean +/** + * Defines if the gift list is active. + */ +isActive?: boolean +/** + * Defines if items purchased from the gift list will be shipped to the owner of the gift list. + */ +shipsToOwner?: boolean +/** + * Validates the address of the gift list. + */ +isAddressOk?: boolean +/** + * Version of the gift list. + */ +version?: number +/** + * ID of the SKU that recharges the gift card. + */ +giftCardRechargeSkuId?: (null | number) +/** + * Name of the members of the gift list. + */ +memberNames?: string +/** + * Array of members of the gift list. + */ +giftListMembers?: { +/** + * Gift List member ID. + */ +giftListMemberId?: number +/** + * Gift List ID. + */ +giftListId?: number +/** + * User ID. + */ +userId?: string +/** + * Client ID. + */ +clientId?: (null | string) +/** + * Title of the Gift List member. + */ +title?: (null | string) +/** + * Name of the Gift List member. + */ +name?: string +/** + * Surname of the Gift List member. + */ +surname?: string +/** + * Defines if the Gift List member is an administrator of the Gift List or not. + */ +isAdmin?: boolean +/** + * Defines if the Gift List user is active or not. + */ +isActive?: boolean +/** + * Complementary text. + */ +text1?: (null | string) +/** + * Complementary text. + */ +text2?: (null | string) +}[] +/** + * Array with the IDs of SKUs that are part of the gift list. + */ +giftListSkuIds?: string[] +/** + * Address of the gift list. + */ +address?: (null | string) +/** + * File URL. + */ +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. + * + * **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`. + */ +RnbBehavior?: number +/** + * Trade Policy (Sales Channel) identification. + */ +sc?: number +} +body: { +/** + * Array containing information about the SKUs inside the cart to be simulated. + */ +items?: { +/** + * The SKU ID. + */ +id?: string +/** + * The quantity of items of this specific SKU in the cart to be simulated. + */ +quantity?: number +/** + * The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin. + */ +seller?: string +}[] +marketingData?: { +[k: string]: any +} +priceTables?: string[] +/** + * Three letter ISO code of the country of the shipping address. This value must be sent along with the `postalCode` or `geoCoordinates` values. + */ +country?: string +/** + * Postal code. + */ +postalCode?: string +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +minItems?: 0 +} +response: { +/** + * Information on each item in the cart. + */ +items?: { +/** + * ID of the item. + */ +id?: string +/** + * Request index information. + */ +requestIndex?: number +/** + * The quantity of the item the cart. + */ +quantity?: number +/** + * The seller responsible for the SKU. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Tax value in cents. + */ +tax?: number +/** + * A unique identifier code assigned to a tax within the VTEX Admin. + */ +taxCode?: string +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Array containing offering information. + */ +offerings?: any[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag name. + */ +name?: string +/** + * Price tag value. + */ +value?: number +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag identifier. + */ +identifier?: string +/** + * Identification of the responsible for the price tag. + */ +owner?: string +}[] +/** + * Measurement unit. + */ +measurementUnit?: string +/** + * Unit multiplier. + */ +unitMultiplier?: number +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Availability. + */ +availability?: string +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: any[] +/** + * List with rates and benefits teasers. + */ +teaser?: any[] +} +/** + * Payment data information. + */ +paymentData?: { +/** + * Installment options information. + */ +installmentOptions?: any[] +/** + * Information on payment systems. + */ +paymentSystems?: { +/** + * Payment system ID. + */ +id?: number +/** + * Payment system name. + */ +name?: string +/** + * Payment group name. + */ +groupName?: string +/** + * Payment system validator. + */ +validator?: (null | { + +}) +/** + * String ID. + */ +stringId?: string +/** + * Template. + */ +template?: string +/** + * Indicates whether a document is required. + */ +requiresDocument?: boolean +/** + * Indicates whether a document is shown. + */ +displayDocument?: boolean +/** + * Indicates whether it is custom. + */ +isCustom?: boolean +/** + * Description. + */ +description?: string +/** + * Indicates whether a authentication is required. + */ +requiresAuthentication?: boolean +/** + * Payment due date. + */ +dueDate?: string +/** + * Availability of payment. + */ +availablePayments?: (null | string) +}[] +/** + * Information on each payment. + */ +payments?: any[] +/** + * Gift card information, if it applies to the order. + */ +giftCards?: any[] +/** + * Array of gift card messages. + */ +giftCardMessages?: any[] +/** + * Available accounts. + */ +availableAccounts?: any[] +/** + * Available tokens. + */ +availableTokens?: any[] +/** + * Available associations. + */ +availableAssociations?: { + +} +} +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Object containing promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: (null | { + +}) +/** + * Postal Code. + */ +postalCode?: (null | string) +/** + * Three letter ISO code of the country of the shipping address. + */ +country?: string +/** + * Array with logistics information on each item of the `items` array in the `orderForm`. + */ +logisticsInfo?: { +/** + * Index of item in items array. + */ +itemIndex?: number +/** + * Address ID. + */ +addressId?: (null | string) +/** + * Selected SLA. For example, `"normal"` or `"express"`. + */ +selectedSla?: (null | string) +/** + * Delivery channel selected by the customer. For example, `"delivery"` or `"pickup-in-point"`. + */ +selectedDeliveryChannel?: (null | string) +/** + * Quantity. + */ +quantity?: number +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: any[] +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, "three business days" will be represented as `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * This object contains information about the delivery window available to the shopper. + */ +availableDeliveryWindows?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +/** + * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. + */ +deliveryWindow?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { + +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented as `3bd`. + */ +transitTime?: string +}[] +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Purchase conditions information. + */ +purchaseConditions?: { +/** + * List of objects containing purchase condition information on each item in the order. + */ +itemPurchaseConditions?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: any[] +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, "three business days" will be represented as `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * This object contains information about the delivery window available to the shopper. + */ +availableDeliveryWindows?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +/** + * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. + */ +deliveryWindow?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { + +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented as `3bd`. + */ +transitTime?: string +}[] +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +}[] +} +/** + * Array containing pickup points information. + */ +pickupPoints?: any[] +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Information on order totals. + */ +totals?: { +/** + * Total ID. + */ +id?: string +/** + * Total name. + */ +name?: string +/** + * Total value. + */ +value?: number +}[] +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Assembly options information. + */ +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`. + * + * 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. + */ +"GET /api/checkout/pub/orderForm": { +searchParams: { +/** + * Use this query parameter to create a new empty shopping cart. + */ +forceNewCart?: boolean +} +} +/** + * 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. + */ +"GET /api/checkout/pub/orderForm/:orderFormId": { +searchParams: { +/** + * It is possible to use the [Update cart items request](https://developers.vtex.com/vtex-rest-api/reference/cart-update#itemsupdate) so as to allow outdated information in the `orderForm`, which may improve performance in some cases. To guarantee that all cart information is updated, send this request with this parameter as `true`. We recommend doing this in the final stages of the shopping experience, starting from the checkout page. + */ +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. + * + * **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. + */ +"POST /api/checkout/pub/orderForm/:orderFormId/items/removeAll": { +/** + * This object must be empty. + */ +body: { + +} +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 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": { + +} +/** + * 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. + * + * 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. + */ +"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”`. + */ +allowedOutdatedData?: any[] +} +body: { +/** + * Avoid split items on cart + */ +noSplitItem?: boolean +/** + * Array containing the cart items. Each object inside this array corresponds to a different item. + */ +orderItems?: { +/** + * The quantity of the item in the cart. + */ +quantity: number +/** + * The position of the item in the array. + */ +index: number +}[] +} +response: { +/** + * ID of the orderForm corresponding to a specific cart. + */ +orderFormId?: string +/** + * Attribute created by the seller, in their VTEX store configuration. + */ +salesChannel?: string +/** + * Indicates whether the user is logged into the store. + */ +loggedIn?: boolean +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the store. + */ +storeId?: (null | string) +/** + * Permission to modify item price manually. + */ +allowManualPrice?: boolean +/** + * Data can be edited. + */ +canEditData?: boolean +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: string +/** + * Profile provider. + */ +profileProvider?: string +/** + * Available accounts. + */ +availableAccounts?: string[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * List with the two geocoordinates. + */ +geoCoordinates?: string[] +}[] +/** + * User type. + */ +userType?: (null | string) +/** + * Ignore customer profile data. + */ +ignoreProfileData?: boolean +/** + * Total value of the order without separating cents. For example, $24.99 is represented as `2499`. + */ +value?: number +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * A unique identifier code assigned to a tax within the VTEX Admin. + */ +taxCode?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability. + */ +availability?: string +/** + * Measurement unit. + */ +measurementUnit?: string +/** + * Unit multiplier. + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). + */ +totalizers?: any[] +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array with two strings with geocoordinates, first latitude, then longitude. + */ +geoCoordinates?: string[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: string +/** + * Delivery channel selected by the customer. + */ +selectedDeliveryChannel?: string +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, "three business days" will be represented as `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array with two strings with geocoordinates, first latitude, then longitude. + */ +geoCoordinates?: string[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented as `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array with two strings with geocoordinates, first latitude, then longitude. + */ +geoCoordinates?: string[] +}[] +/** + * Array with information on the available addresses for the order. + */ +availableAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array with two strings with geocoordinates, first latitude, then longitude. + */ +geoCoordinates?: string[] +}[] +} +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Information on the order's payment. + */ +paymentData?: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode?: string +/** + * Gift card value in cents. + */ +value?: number +/** + * Gift card balance in cents. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Information on each transaction pertinent to the order. + */ +transactions?: { +/** + * Indicates whether transaction is active. + */ +isActive?: boolean +/** + * Transaction ID. + */ +transactionId?: string +/** + * Merchant name. + */ +merchantName?: string +/** + * Information on each payment. + */ +payments?: { +/** + * Account ID. + */ +accountId?: string +/** + * Bin. + */ +bin?: string +/** + * Number of installments. + */ +installments?: number +/** + * Payment system. + */ +paymentSystem?: string +/** + * Reference value for calculating interest rates, in case it applies. Displayed in cents. + */ +referenceValue?: number +/** + * Value including interest, in case it applies. Displayed in cents. + */ +value?: number +}[] +/** + * Indicates whather transaction is shared. + */ +sharedTransaction?: boolean +}[] +} +/** + * Object containing promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: { +/** + * 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. + */ +coupon?: string +/** + * UTM source. + */ +utmSource?: string +/** + * UTM medium. + */ +utmMedium?: string +/** + * UTM campaign + */ +utmCampaign?: string +/** + * utmi_page (internal utm). + */ +utmiPage?: (null | string) +/** + * utmi_part (internal utm). + */ +utmiPart?: (null | string) +/** + * utmi_campaign (internal utm). + */ +utmiCampaign?: (null | string) +} +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Object containing preferences from the client who placed the order. + */ +clientPreferencesData?: { +/** + * Client's locale. Examples: `pt-BR` and `en-US`. + */ +locale?: string +/** + * `true` if the client opted to receive newsletter from the store. + */ +optinNewsLetter?: boolean +} +/** + * Object containing commercial condition information. + */ +commercialConditionData?: (null | { + +}) +/** + * Object containing data from the store's configuration (stored in VTEX's License Manager). + */ +storePreferencesData?: { + +} +/** + * Gift registry list information. + */ +giftRegistryData?: (null | { + +}) +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). + */ +openTextField?: (null | string) +/** + * Object containing information pertinent to the order's invoice. + */ +invoiceData?: (null | { + +}) +/** + * Customer additional information. + */ +customData?: (null | { + +}) +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Product ID. + */ +productId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +}[] +} +/** + * Hooks information. + */ +hooksData?: (null | { + +}) +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: string[] +/** + * List with rates and benefits teasers. + */ +teaser?: string[] +} +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Object containing information about the ordering of items within the `orderForm`. + */ +itemsOrdination?: { +/** + * Criteria adopted to order the items in the list. + */ +criteria?: string +/** + * Indicates whether the ordering is ascending. + */ +ascending?: boolean +} +} +} +/** + * 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. + */ +"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”`. + */ +allowedOutdatedData?: any[] +} +body: { +/** + * Array containing the cart items. Each object inside this array corresponds to a different item. + */ +orderItems?: { +/** + * The quantity of the item (SKU) in the cart. + */ +quantity: number +/** + * The seller responsible for the SKU. + */ +seller: string +/** + * The ID of the SKU in VTEX platform. + */ +id: string +/** + * The position of the item in the array. + */ +index: number +/** + * Price of the item in cents. Send this value in case you want to make a bulk price change. + */ +price?: number +}[] +} +response: { +/** + * ID of the orderForm corresponding to a specific cart. + */ +orderFormId?: string +/** + * Attribute created by the seller, in their VTEX store configuration. + */ +salesChannel?: string +/** + * Indicates whether the user is logged into the store. + */ +loggedIn?: boolean +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the store. + */ +storeId?: (null | string) +/** + * Permission to modify item price manually. + */ +allowManualPrice?: boolean +/** + * Data can be edited. + */ +canEditData?: boolean +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: string +/** + * Profile provider. + */ +profileProvider?: string +/** + * Available accounts. + */ +availableAccounts?: string[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * User type. + */ +userType?: (null | string) +/** + * Ignore customer profile data. + */ +ignoreProfileData?: boolean +/** + * Total value of the order without separating cents. For example, $24.99 is represented `2499`. + */ +value?: number +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * A unique identifier code assigned to a tax within the VTEX Admin. + */ +taxCode?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability. + */ +availability?: string +/** + * Measurement unit. + */ +measurementUnit?: string +/** + * Unit multiplier. + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). + */ +totalizers?: any[] +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: string +/** + * Delivery channel selected by the customer. + */ +selectedDeliveryChannel?: string +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, Three business days will be represented `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array with information on the available addresses for the order. + */ +availableAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +} +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Information on the order's payment. + */ +paymentData?: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode?: string +/** + * Gift card value in cents. + */ +value?: number +/** + * Gift card balance in cents. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Information on each transaction pertinent to the order. + */ +transactions?: { +/** + * Indicates whether transaction is active. + */ +isActive?: boolean +/** + * Transaction ID. + */ +transactionId?: string +/** + * Merchant name. + */ +merchantName?: string +/** + * Information on each payment. + */ +payments?: { +/** + * Account ID. + */ +accountId?: string +/** + * Bin. + */ +bin?: string +/** + * Number of installments. + */ +installments?: number +/** + * Payment system. + */ +paymentSystem?: string +/** + * Reference value for calculating interest rates, in case it applies. Displayed in cents. + */ +referenceValue?: number +/** + * Value including interest, in case it applies. Displayed in cents. + */ +value?: number +}[] +/** + * Indicates whather transaction is shared. + */ +sharedTransaction?: boolean +}[] +} +/** + * Object containing promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: { +/** + * 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. + */ +coupon?: string +/** + * UTM source. + */ +utmSource?: string +/** + * UTM medium. + */ +utmMedium?: string +/** + * UTM campaign + */ +utmCampaign?: string +/** + * utmi_page (internal utm). + */ +utmiPage?: (null | string) +/** + * utmi_part (internal utm). + */ +utmiPart?: (null | string) +/** + * utmi_campaign (internal utm). + */ +utmiCampaign?: (null | string) +} +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Object containing preferences from the client who placed the order. + */ +clientPreferencesData?: { +/** + * Client's locale. Examples: `pt-BR` and `en-US`. + */ +locale?: string +/** + * `true` if the client opted to receive newsletter from the store. + */ +optinNewsLetter?: boolean +} +/** + * Object containing commercial condition information. + */ +commercialConditionData?: (null | { + +}) +/** + * Object containing data from the store's configuration (stored in VTEX's License Manager). + */ +storePreferencesData?: { + +} +/** + * Gift registry list information. + */ +giftRegistryData?: (null | { + +}) +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). + */ +openTextField?: (null | string) +/** + * Object containing information pertinent to the order's invoice. + */ +invoiceData?: (null | { + +}) +/** + * Customer additional information. + */ +customData?: (null | { + +}) +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Product ID. + */ +productId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +}[] +} +/** + * Hooks information. + */ +hooksData?: (null | { + +}) +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: string[] +/** + * List with rates and benefits teasers. + */ +teaser?: string[] +} +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Object containing information about the ordering of items within the orderForm. + */ +itemsOrdination?: { +/** + * Criteria adopted to order the items in the list. + */ +criteria?: string +/** + * Indicates whether the ordering is ascending. + */ +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. + * + * 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. + */ +"PATCH /api/checkout/pub/orderForm/:orderFormId/items": { +body: { +/** + * Array containing the cart items. Each object inside this array corresponds to a different item. + */ +orderItems?: { +/** + * The ID of the SKU in VTEX platform. + */ +id: string +/** + * The quantity of the item (SKU) in the cart. + */ +quantity: number +/** + * The seller responsible for the SKU. + */ +seller: string +/** + * The position of the item in the array. This string should be sent only to modify price or quantity of an item. NOTE: This string should not be sent when you are adding a new item to the cart. + */ +index?: number +/** + * Price of the item in cents. Send this value in case you want to make a bulk price change. + */ +price?: number +/** + * Array containing information on attachments. + */ +attachments?: { +/** + * Attachment identification. + */ +name?: string +/** + * Attachment content data. E.g. `"Do you want to receive packages?": "Yes"`. + */ +content?: (null | { + +}) +}[] +/** + * Indicates whether the item can be splitted. + */ +noSplitItem?: boolean +/** + * 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"`. + */ +allowedOutdatedData?: string[] +}[] +} +response: { +/** + * ID of the orderForm corresponding to a specific cart. + */ +orderFormId?: string +/** + * Attribute created by the seller, in their VTEX store configuration. + */ +salesChannel?: string +/** + * Indicates whether the user is logged into the store. + */ +loggedIn?: boolean +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the store. + */ +storeId?: (null | string) +/** + * Permission to modify item price manually. + */ +allowManualPrice?: boolean +/** + * Data can be edited. + */ +canEditData?: boolean +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: string +/** + * Profile provider. + */ +profileProvider?: string +/** + * Available accounts. + */ +availableAccounts?: string[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * User type. + */ +userType?: (null | string) +/** + * Ignore customer profile data. + */ +ignoreProfileData?: boolean +/** + * Total value of the order without separating cents. For example, $24.99 is represented `2499`. + */ +value?: number +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * A unique identifier code assigned to a tax within the VTEX Admin. + */ +taxCode?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability. + */ +availability?: string +/** + * Measurement unit. + */ +measurementUnit?: string +/** + * Unit multiplier. + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). + */ +totalizers?: any[] +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: string +/** + * Delivery channel selected by the customer. + */ +selectedDeliveryChannel?: string +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, Three business days will be represented `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array with information on the available addresses for the order. + */ +availableAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +} +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Information on the order's payment. + */ +paymentData?: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode?: string +/** + * Gift card value in cents. + */ +value?: number +/** + * Gift card balance in cents. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Information on each transaction pertinent to the order. + */ +transactions?: { +/** + * Indicates whether transaction is active. + */ +isActive?: boolean +/** + * Transaction ID. + */ +transactionId?: string +/** + * Merchant name. + */ +merchantName?: string +/** + * Information on each payment. + */ +payments?: { +/** + * Account ID. + */ +accountId?: string +/** + * Bin. + */ +bin?: string +/** + * Number of installments. + */ +installments?: number +/** + * Payment system. + */ +paymentSystem?: string +/** + * Reference value for calculating interest rates, in case it applies. Displayed in cents. + */ +referenceValue?: number +/** + * Value including interest, in case it applies. Displayed in cents. + */ +value?: number +}[] +/** + * Indicates whather transaction is shared. + */ +sharedTransaction?: boolean +}[] +} +/** + * Object containing promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: { +/** + * Sending an existing coupon code in this field will return the corresponding discount in the purchase. Use the [cart simulation](https://developers.vtex.com/docs/api-reference/checkout-api#post-/api/checkout/pub/orderForms/simulation) request to check which coupons might apply before placing the order. + */ +coupon?: string +/** + * UTM source. + */ +utmSource?: string +/** + * UTM medium. + */ +utmMedium?: string +/** + * UTM campaign + */ +utmCampaign?: string +/** + * utmi_page (internal utm). + */ +utmiPage?: (null | string) +/** + * utmi_part (internal utm). + */ +utmiPart?: (null | string) +/** + * utmi_campaign (internal utm). + */ +utmiCampaign?: (null | string) +} +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Object containing preferences from the client who placed the order. + */ +clientPreferencesData?: { +/** + * Client's locale. Examples: `pt-BR` and `en-US`. + */ +locale?: string +/** + * `true` if the client opted to receive newsletter from the store. + */ +optinNewsLetter?: boolean +} +/** + * Object containing commercial condition information. + */ +commercialConditionData?: (null | { + +}) +/** + * Object containing data from the store's configuration (stored in VTEX's License Manager). + */ +storePreferencesData?: { + +} +/** + * Gift registry list information. + */ +giftRegistryData?: (null | { + +}) +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/docs/guides/customizable-fields-with-checkout-api). + */ +openTextField?: (null | string) +/** + * Object containing information pertinent to the order's invoice. + */ +invoiceData?: (null | { + +}) +/** + * Customer additional information. + */ +customData?: (null | { + +}) +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Product ID. + */ +productId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +}[] +} +/** + * Hooks information. + */ +hooksData?: (null | { + +}) +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: string[] +/** + * List with rates and benefits teasers. + */ +teaser?: string[] +} +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Object containing information about the ordering of items within the orderForm. + */ +itemsOrdination?: { +/** + * Criteria adopted to order the items in the list. + */ +criteria?: string +/** + * Indicates whether the ordering is ascending. + */ +ascending?: boolean +} +} +} +/** + * 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. + */ +"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. + * + * 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": { +body: { +/** + * Indicates whether profile data should be ignored. + */ +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). + * + * >⚠️ 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": { +searchParams: { +/** + * Client's email address to be searched. + */ +email: string +/** + * Indicates whether the returned profiles must be complete or not. + */ +ensureComplete?: boolean +} +response: { +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: string +/** + * Profile provider. + */ +profileProvider?: string +/** + * Available accounts. + */ +availableAccounts?: string[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Customer profile information. + */ +userProfile?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Document. + */ +document?: string +/** + * Document type. + */ +documentType?: string +/** + * Telephone number. + */ +phone?: string +/** + * Name of the company. Used for corporate clients. + */ +corporateName?: (null | string) +/** + * Trade name. Used for corporate clients. + */ +tradeName?: (null | string) +/** + * Document. Used for corporate clients. + */ +corporateDocument?: (null | string) +/** + * State inscription. Used for corporate clients. + */ +stateInscription?: (null | string) +/** + * Telephone number. Used for corporate clients. + */ +corporatePhone?: (null | string) +/** + * Indicates whether client is corporate. + */ +isCorporate?: boolean +/** + * Profile complete when loading. + */ +profileCompleteOnLoading?: (null | string) +/** + * Profile error when loading. + */ +profileErrorOnLoading?: (null | string) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Indicates whether customer profile is complete. + */ +isComplete?: boolean +} +} +/** + * 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. + * + * >⚠️ 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": { +/** + * Customer's profile information. + */ +body: { +/** + * Customer's email address. + */ +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 number informed by the customer. + */ +document: string +/** + * Customer's phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: string +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: string +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: string +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: string +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: string +/** + * `true` if the customer is a legal entity. + */ +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. + * + * 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. + * + * >⚠️ 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": { +body: { +/** + * This field should be sent as `false` to prevent the address information from being filled in automatically based on the `postalCode` information. + */ +clearAddressIfPostalCodeNotFound?: boolean +/** + * List of objects with addresses information. + */ +selectedAddresses?: { +/** + * 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 +/** + * Address ID. + */ +addressId?: string +/** + * Postal Code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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 in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: string +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array with logistics information on each item of the `items` array in the `orderForm`. + */ +logisticsInfo?: { +/** + * Index of item in items array + */ +itemIndex?: number +/** + * Delivery channel selected by the customer. For example, `"delivery"` or `"pickup-in-point"`. + */ +selectedDeliveryChannel?: string +/** + * Selected SLA. For example, `"normal"` or `"express"`. + */ +selectedSla?: string +}[] +} +response: { +/** + * ID of the `orderForm` corresponding to a specific cart. + */ +orderFormId?: string +/** + * Attribute created by the seller, in their VTEX store configuration. + */ +salesChannel?: string +/** + * Indicates whether the user is logged into the store. + */ +loggedIn?: boolean +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the store. + */ +storeId?: (null | string) +/** + * Checked in pickuppoint identification. + */ +checkedInPickupPointId?: (null | string) +/** + * Permission to modify item price manually. + */ +allowManualPrice?: boolean +/** + * Data can be edited. + */ +canEditData?: boolean +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: (null | string) +/** + * User type. + */ +userType?: (null | string) +/** + * Ignore customer profile data. + */ +ignoreProfileData?: boolean +/** + * Total value of the order without separating cents. For example, $24.99 is represented `2499`. + */ +value?: number +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability. + */ +availability?: string +/** + * Measurement unit. + */ +measurementUnit?: string +/** + * Unit multiplier. + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). + */ +totalizers?: any[] +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: (null | string) +/** + * Delivery channel selected by the customer. + */ +selectedDeliveryChannel?: (null | string) +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, Three business days will be represented `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: (null | string) +/** + * This object contains information about the delivery window available to the shopper. + */ +availableDeliveryWindows?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +/** + * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. + */ +deliveryWindow?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array containing pickup points information. + */ +pickupPoints?: any[] +} +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Payment data information. + */ +paymentData?: { +/** + * Indicate whether this object's information is up to date according to the order's items. An order can not be placed if `"outdated"` + */ +updateStatus?: string +/** + * Installment options information. + */ +installmentOptions?: any[] +/** + * Information on payment systems. + */ +paymentSystems?: { +/** + * Payment system ID. + */ +id?: number +/** + * Payment system name. + */ +name?: string +/** + * Payment group name. + */ +groupName?: string +/** + * Payment system validator. + */ +validator?: (null | { + +}) +/** + * String ID. + */ +stringId?: string +/** + * Template. + */ +template?: string +/** + * Indicates whether a document is required. + */ +requiresDocument?: boolean +/** + * Indicates whether a document is shown. + */ +displayDocument?: boolean +/** + * Indicates whether it is custom. + */ +isCustom?: boolean +/** + * Description. + */ +description?: string +/** + * Indicates whether a authentication is required. + */ +requiresAuthentication?: boolean +/** + * Payment due date. + */ +dueDate?: string +/** + * Availability of payment. + */ +availablePayments?: (null | string) +}[] +/** + * Information on each payment. + */ +payments?: any[] +/** + * Gift card information, if it applies to the order. + */ +giftCards?: any[] +/** + * Array of gift card messages. + */ +giftCardMessages?: any[] +/** + * Available accounts. + */ +availableAccounts?: any[] +/** + * Available tokens. + */ +availableTokens?: any[] +/** + * Available associations. + */ +availableAssociations?: { + +} +} +/** + * Object containing promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: (null | { + +}) +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Object containing preferences from the client who placed the order. + */ +clientPreferencesData?: { +/** + * Client's locale. Examples: `pt-BR` and `en-US`. + */ +locale?: string +/** + * `true` if the client opted to receive newsletter from the store. + */ +optinNewsLetter?: boolean +} +/** + * Object containing commercial condition information. + */ +commercialConditionData?: (null | { + +}) +/** + * Object containing data from the store's configuration (stored in VTEX's License Manager). + */ +storePreferencesData?: { +/** + * Three letters ISO code of the country (ISO 3166 ALPHA-3). + */ +countryCode?: string +/** + * Defines whether the customer want the store to keep their personal and payment data saved. + */ +saveUserData?: boolean +/** + * Time zone from where the order was made. + */ +timeZone?: string +/** + * Currency code in ISO 4217. For example, `BRL`. + */ +currencyCode?: string +/** + * Currency Locale Code in LCID in decimal. + */ +currencyLocale?: number +/** + * Currency symbol. + */ +currencySymbol?: string +/** + * Object with currency format details. + */ +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 +} +} +/** + * Gift registry list information. + */ +giftRegistryData?: (null | { + +}) +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). + */ +openTextField?: (null | string) +/** + * Object containing information pertinent to the order's invoice. + */ +invoiceData?: (null | { + +}) +/** + * Customer additional information. + */ +customData?: (null | { + +}) +/** + * Item metadata. + */ +itemMetadata?: (null | { + +}) +/** + * Hooks information. + */ +hooksData?: (null | { + +}) +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: (null | { + +}) +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Object containing information about the ordering of items within the orderForm. + */ +itemsOrdination?: (null | { + +}) +} +} +/** + * 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. + */ +"POST /api/checkout/pub/orderForm/:orderFormId/attachments/clientPreferencesData": { +body: { +/** + * Locale chosen by the shopper. Determines website language. + */ +locale?: string +/** + * Indicates whether the shopper opted in to receive the store's news letter. + */ +optinNewsLetter?: boolean +} +response: any +} +/** + * 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. + */ +"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"`. + */ +coupon?: string +/** + * Marketing tags. Limited to a maximum of 50 items. + */ +marketingTags?: string[] +/** + * UTM source. + */ +utmSource?: string +/** + * UTM medium. + */ +utmMedium?: string +/** + * UTM campaign + */ +utmCampaign?: string +/** + * utmi_page (internal utm) + */ +utmiPage?: string +/** + * utmi_part (internal utm) + */ +utmiPart?: string +/** + * utmi_campaign (internal utm) + */ +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. + * + * 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. + */ +"POST /api/checkout/pub/orderForm/:orderFormId/attachments/paymentData": { +body: { +/** + * Array with information on each payment chosen by the shopper. + */ +payments?: { +/** + * Payment system ID. + */ +paymentSystem?: number +/** + * Payment system name. + */ +paymentSystemName?: string +/** + * Payment system group. + */ +group?: string +/** + * Selected number of installments. + */ +installments?: number +/** + * Installments' interest rate. + */ +installmentsInterestRate?: number +/** + * Value of the installments. + */ +installmentsValue?: number +/** + * Total value assigned to this payment. + */ +value?: number +/** + * Reference value used to calculate total order value with interest. + */ +referenceValue?: number +/** + * Indicates whether billing address for this payment is the default address. + */ +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. + * + * 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. + */ +"POST /api/checkout/pub/orderForm/:orderFormId/attachments/merchantContextData": { +body: { +/** + * Sales Associate information. + */ +salesAssociateData: { +/** + * Sales Associate (Seller) identification code. All information should be registered by the merchant. Maximum of 100 characters. + */ +salesAssociateId?: string +} +} +response: { +/** + * Sales Associate (Seller) identification code. + */ +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`). + * + * 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": { +/** + * Here you must add the pairs of Field Name and Field Value. + */ +body: { +[k: string]: any +} +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). + * + * 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": { +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. + */ +"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. + */ +"GET /api/checkout/pvt/configuration/orderForm": { +response: { +/** + * Payment configuration information. + */ +paymentConfiguration?: { +/** + * Determines whether pre-authorized payments require authentication. + */ +requiresAuthenticationForPreAuthorizedPaymentOption?: boolean +/** + * By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installment options configured by every seller will be available. When indicated as `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those do not match. Installment values may not be equal in this case. + */ +allowInstallmentsMerge?: boolean +} +/** + * External tax service configuration information. + */ +taxConfiguration?: (null | { +/** + * Endpoint URL. + */ +url?: (null | string) +/** + * Authorization header. + */ +authorizationHeader?: (null | string) +/** + * Custom data ID sent to the tax system. + */ +appId?: string +}) +/** + * Minimum SKU quantity by cart. + */ +minimumQuantityAccumulatedForItems?: number +/** + * Number of price digits. + */ +decimalDigitsPrecision?: number +/** + * Minimum cart value. + */ +minimumValueAccumulated?: (null | number) +/** + * Array of objects containing Apps configuration information. + */ +apps?: (null | { +/** + * App ID. + */ +id?: string +/** + * Array of fields available to the app. + */ +fields?: string[] +/** + * App major version. + */ +major?: number +}[]) +/** + * On the same purchase, allows the selection of items from multiple delivery channels. + */ +allowMultipleDeliveries?: (null | boolean) +/** + * Allows the editing of SKU prices right in the cart. + */ +allowManualPrice?: (null | boolean) +/** + * Allows users to select whether they want the store to keep their personal and payment data saved. + */ +savePersonalDataAsOptIn?: (null | boolean) +/** + * Allows the input of a limit of white label sellers involved on the cart. + */ +maxNumberOfWhiteLabelSellers?: (null | number) +/** + * Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client does not want to share its data. + */ +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. + */ +recaptchaValidation?: string +/** + * Indicates whether authentication is required for completing purchases. + */ +requiresLoginToPlaceOrder?: boolean +/** + * Minimum interval (in seconds) between successive purchases. + */ +minimumPurchaseDowntimeSeconds?: number +/** + * Minimum cart existence period (in seconds) before allowing the use of a new credit card. + */ +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). + */ +"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. + */ +"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. + */ +"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. + * + * **Important**: **Request Body** must always be sent with empty value "{ }" in this endpoint. + */ +"POST /api/checkout/pub/orderForm/:orderFormId/messages/clear": { +/** + * This object must be empty. + */ +body: { + +} +response: { +/** + * ID of the orderForm corresponding to a specific cart. + */ +orderFormId?: string +/** + * Attribute created by the seller, in their VTEX store configuration. + */ +salesChannel?: string +/** + * Indicates whether the user is logged into the store. + */ +loggedIn?: boolean +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the store. + */ +storeId?: (null | string) +/** + * Permission to modify item price manually. + */ +allowManualPrice?: boolean +/** + * Data can be edited. + */ +canEditData?: boolean +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: string +/** + * Profile provider. + */ +profileProvider?: string +/** + * Available accounts. + */ +availableAccounts?: string[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * User type. + */ +userType?: (null | string) +/** + * Ignore customer profile data. + */ +ignoreProfileData?: boolean +/** + * Total value of the order without separating cents. For example, $24.99 is represented `2499`. + */ +value?: number +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability. + */ +availability?: string +/** + * Measurement unit. + */ +measurementUnit?: string +/** + * Unit multiplier. + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). + */ +totalizers?: any[] +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: string +/** + * Delivery channel selected by the customer. + */ +selectedDeliveryChannel?: string +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, Three business days will be represented `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array with information on the available addresses for the order. + */ +availableAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +} +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Information on the order's payment. + */ +paymentData?: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode?: string +/** + * Gift card value in cents. + */ +value?: number +/** + * Gift card balance in cents. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Information on each transaction pertinent to the order. + */ +transactions?: { +/** + * Indicates whether transaction is active. + */ +isActive?: boolean +/** + * Transaction ID. + */ +transactionId?: string +/** + * Merchant name. + */ +merchantName?: string +/** + * Information on each payment. + */ +payments?: { +/** + * Account ID. + */ +accountId?: string +/** + * Bin. + */ +bin?: string +/** + * Number of installments. + */ +installments?: number +/** + * Payment system. + */ +paymentSystem?: string +/** + * Reference value for calculating interest rates, in case it applies. Displayed in cents. + */ +referenceValue?: number +/** + * Value including interest, in case it applies. Displayed in cents. + */ +value?: number +}[] +/** + * Indicates whather transaction is shared. + */ +sharedTransaction?: boolean +}[] +} +/** + * Object containing promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: { +/** + * 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. + */ +coupon?: string +/** + * UTM source. + */ +utmSource?: string +/** + * UTM medium. + */ +utmMedium?: string +/** + * UTM campaign + */ +utmCampaign?: string +/** + * utmi_page (internal utm) + */ +utmiPage?: (null | string) +/** + * utmi_part (internal utm). + */ +utmiPart?: (null | string) +/** + * utmi_campaign (internal utm). + */ +utmiCampaign?: (null | string) +} +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Object containing preferences from the client who placed the order. + */ +clientPreferencesData?: { +/** + * Client's locale. Examples: `pt-BR` and `en-US`. + */ +locale?: string +/** + * `true` if the client opted to receive newsletter from the store. + */ +optinNewsLetter?: boolean +} +/** + * Object containing commercial condition information. + */ +commercialConditionData?: (null | { + +}) +/** + * Object containing data from the store's configuration (stored in VTEX's License Manager). + */ +storePreferencesData?: { + +} +/** + * Gift registry list information. + */ +giftRegistryData?: (null | { + +}) +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1). + */ +openTextField?: (null | string) +/** + * Object containing information pertinent to the order's invoice. + */ +invoiceData?: (null | { + +}) +/** + * Customer additional information. + */ +customData?: (null | { + +}) +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Product ID. + */ +productId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +}[] +} +/** + * Hooks information. + */ +hooksData?: (null | { + +}) +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: string[] +/** + * List with rates and benefits teasers. + */ +teaser?: string[] +} +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Object containing information about the ordering of items within the orderForm. + */ +itemsOrdination?: { +/** + * Criteria adopted to order the items in the list. + */ +criteria?: string +/** + * Indicates whether the ordering is ascending. + */ +ascending?: boolean +} +} +} +/** + * 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`. + */ +"GET /api/checkout/pub/orderForm/:orderFormId/installments": { +searchParams: { +/** + * ID of the payment method to be consulted for installments. + */ +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"}. + * + * 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": { +body: { +/** + * Sending an existing coupon code in this field will return the corresponding discount in the purchase. + */ +text?: string +} +response: { +/** + * ID of the orderForm corresponding to a specific cart. + */ +orderFormId?: string +/** + * Attribute created by the seller, in their VTEX store configuration. + */ +salesChannel?: string +/** + * Indicates whether the user is logged into the store. + */ +loggedIn?: boolean +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the store. + */ +storeId?: (null | string) +/** + * Permission to modify item price manually. + */ +allowManualPrice?: boolean +/** + * Data can be edited. + */ +canEditData?: boolean +/** + * Unique ID associated with the customer profile. + */ +userProfileId?: string +/** + * Profile provider. + */ +profileProvider?: string +/** + * Available accounts. + */ +availableAccounts?: string[] +/** + * Information on each available address. + */ +availableAddresses?: { +/** + * Address type. + */ +addressType?: string +/** + * Name of the receiver. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * City of the address. + */ +city?: string +/** + * State of the address. + */ +state?: string +/** + * Country of the address. ISO three-letter code. + */ +country?: string +/** + * Street of the address. + */ +street?: string +/** + * Number of the address. + */ +number?: string +/** + * Neighborhood of the address. + */ +neighborhood?: string +/** + * Complement to the address. + */ +complement?: (null | string) +/** + * Reference that may help in the location of the address. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * User type. + */ +userType?: (null | string) +/** + * Ignore customer profile data. + */ +ignoreProfileData?: boolean +/** + * Total value of the order without separating cents. For example, $24.99 is represented `2499`. + */ +value?: number +/** + * Array containing an object for each message generated by our servers while processing the request. + */ +messages?: any[] +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/en/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability + */ +availability?: string +/** + * Measurement unit + */ +measurementUnit?: string +/** + * Unit multiplier + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Array containing the data of the item selected as a gift. + */ +selectableGifts?: any[] +/** + * Array containing an object for each totalizer for the purchase. Totalizers contain the sum of values for a specific part of the order (e.g. Total item value, Total shipping value). + */ +totalizers?: any[] +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: string +/** + * Delivery channel selected by the customer. + */ +selectedDeliveryChannel?: string +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, Three business days will be represented `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array with information on the available addresses for the order. + */ +availableAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +} +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Information on the order's payment. + */ +paymentData?: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode?: string +/** + * Gift card value in cents. + */ +value?: number +/** + * Gift card balance in cents. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Information on each transaction pertinent to the order. + */ +transactions?: { +/** + * Indicates whether transaction is active. + */ +isActive?: boolean +/** + * Transaction ID. + */ +transactionId?: string +/** + * Merchant name. + */ +merchantName?: string +/** + * Information on each payment. + */ +payments?: { +/** + * Account ID. + */ +accountId?: string +/** + * Bin. + */ +bin?: string +/** + * Number of installments. + */ +installments?: number +/** + * Payment system. + */ +paymentSystem?: string +/** + * Reference value for calculating interest rates, in case it applies. Displayed in cents. + */ +referenceValue?: number +/** + * Value including interest, in case it applies. Displayed in cents. + */ +value?: number +}[] +/** + * Indicates whather transaction is shared. + */ +sharedTransaction?: boolean +}[] +} +/** + * Object containIng promotion data such as coupon tracking information and internal or external UTMs. + */ +marketingData?: { +/** + * 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. + */ +coupon?: string +/** + * UTM source. + */ +utmSource?: (null | string) +/** + * UTM medium. + */ +utmMedium?: (null | string) +/** + * UTM campaign. + */ +utmCampaign?: (null | string) +/** + * utmi_page (internal utm). + */ +utmiPage?: (null | string) +/** + * utmi_part (internal utm). + */ +utmiPart?: (null | string) +/** + * utmi_campaign (internal utm). + */ +utmiCampaign?: (null | string) +} +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Object containing preferences from the client who placed the order. + */ +clientPreferencesData?: { +/** + * Client's locale. Examples: `pt-BR` and `en-US`. + */ +locale?: string +/** + * `true` if the client opted to receive newsletter from the store. + */ +optinNewsLetter?: boolean +} +/** + * Object containing commercial condition information. + */ +commercialConditionData?: (null | { + +}) +/** + * Object containing data from the store's configuration (stored in VTEX's License Manager). + */ +storePreferencesData?: { + +} +/** + * Gift registry list information. + */ +giftRegistryData?: (null | { + +}) +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1) + */ +openTextField?: (null | string) +/** + * Object containing information pertinent to the order's invoice. + */ +invoiceData?: (null | { + +}) +/** + * Customer additional information. + */ +customData?: (null | { + +}) +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Product ID. + */ +productId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +}[] +} +/** + * Hooks information. + */ +hooksData?: (null | { + +}) +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: string[] +/** + * List with rates and benefits teasers. + */ +teaser?: string[] +} +/** + * Subscription information. + */ +subscriptionData?: (null | { + +}) +/** + * Object containing information about the ordering of items within the orderForm. + */ +itemsOrdination?: { +/** + * Criteria adopted to order the items in the list. + */ +criteria?: string +/** + * Indicates whether the ordering is ascending. + */ +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. + */ +"GET /api/checkout/pub/pickup-points": { +searchParams: { +/** + * Geocoordinates (first longitude, then latitude) around which to search for pickup points. If you use this type of search, do not pass postal and country codes. + */ +geoCoordinates?: number[] +/** + * Postal code around which to search for pickup points. If you use this type of search, make sure to pass a `countryCode` and do not pass `geoCoordinates`. + */ +postalCode?: string +/** + * Three letter country code refering to the `postalCode` field. Pass the country code only if you are searching pickup points by postal code. + */ +countryCode?: string +} +response: { +/** + * Paging. + */ +paging?: { +/** + * Page number. + */ +page?: number +/** + * Page size. + */ +pageSize?: number +/** + * Total pages. + */ +total?: number +/** + * Pages. + */ +pages?: number +} +/** + * Items. + */ +items?: { +/** + * Distance. + */ +distance?: number +/** + * Pickup point. + */ +pickupPoint?: { +/** + * Friendly name. + */ +friendlyName?: string +/** + * Address. + */ +address?: { +/** + * Address type. + */ +addressType?: string +/** + * Receiver name. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: (null | string) +/** + * Is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City. + */ +city?: string +/** + * State. + */ +state?: string +/** + * Country. + */ +country?: string +/** + * Street. + */ +street?: string +/** + * Number. + */ +number?: string +/** + * Neighborhood. + */ +neighborhood?: string +/** + * Complement to the shipping address, in case it applies. + */ +complement?: (null | string) +/** + * Racao. + */ +reference?: string +/** + * Geo coordinates. + */ +geoCoordinates?: number[] +} +/** + * Additional info. + */ +additionalInfo?: string +/** + * ID. + */ +id?: string +/** + * Array with business hours. + */ +businessHours?: { +/** + * Day of week. + */ +DayOfWeek?: number +/** + * Opening time. + */ +OpeningTime?: string +/** + * Closing time. + */ +ClosingTime?: string +}[] +} +}[] +} +} +/** + * 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": { +/** + * Address. + */ +response: { +/** + * Postal code. + */ +postalCode?: string +/** + * City. + */ +city?: string +/** + * State. + */ +state?: string +/** + * Country. + */ +country?: string +/** + * Street. + */ +street?: string +/** + * Number. + */ +number?: string +/** + * Neighborhood. + */ +neighborhood?: string +/** + * Complement to the shipping address, in case it applies. + */ +complement?: (null | string) +/** + * Reference. + */ +reference?: string +/** + * Geo coordinates. + */ +geoCoordinates?: number[] +} +} +/** + * 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. + */ +"POST /api/checkout/pub/orderForm/:orderFormId/transaction": { +body: { +referenceId: ReferenceId +savePersonalData?: SavePersonalData +optinNewsLetter?: OptinNewsLetter +/** + * Total value of the order without separating cents. For example, $24.99 is represented `2499`. + */ +value: number +/** + * Reference value of the order for calculating interest if that is the case. Can be equal to the total value and does not separate cents. For example, $24.99 is represented `2499`. + */ +referenceValue: number +/** + * Interest rate to be used in case it applies. + */ +interestValue: number +} +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. + * + * >⚠️ 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": { +searchParams: { +/** + * Trade Policy (Sales Channel) identification. This query can be used to create an order for a specific sales channel. + */ +sc?: number +} +body: { +/** + * Array of objects containing information on each of the order's items. + */ +items: { +/** + * The SKU ID. + */ +id: string +/** + * The quantity of items of this specific SKU in the cart to be simulated. + */ +quantity: number +/** + * The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin. + */ +seller: string +/** + * Comission. + */ +commission?: number +/** + * Freight comission + */ +freightCommission?: number +/** + * Item price within the context of the order without separating cents. For example, $24.99 is represented `2499`. + */ +price?: number +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: string +/** + * Service name. + */ +name?: string +/** + * Service price. The last two digits are the cents. + */ +price?: number +}[] +/** + * Item attachment. + */ +itemAttachment?: { +/** + * Attachment name. + */ +name?: string +/** + * Content referring to the customization requested by the customer. + */ +content?: string +} +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * `true` if price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * SKU measurement unit. + */ +measurementUnit?: string +/** + * SKU unit multiplier. + */ +unitMultiplier?: number +/** + * Indicates whether the order is a gift. + */ +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. + */ +clientProfileData: { +/** + * Customer's email address. + */ +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 number informed by the customer. + */ +document?: string +/** + * Customer's phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: string +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: string +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: string +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: string +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: string +/** + * `true` if the customer is a legal entity. + */ +isCorporate?: boolean +} +/** + * Shipping information. + */ +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. + */ +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 +/** + * Address ID. + */ +addressId?: string +/** + * Postal Code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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 in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: string +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array of objects containing logistics information of each item. + */ +logisticsInfo?: { +/** + * Index of the item in the `items` array, starting from 0. + */ +itemIndex: number +/** + * Selected shipping option + */ +selectedSla: string +/** + * String with the selected delivery channel. This field supports the following values: + * + * - `delivery`, + * + * - `pickup-in-point`. + */ +selectedDeliveryChannel?: string +/** + * Logistics reservation waiting time. + */ +lockTTL?: string +/** + * Estimated time until delivery for the item. + */ +shippingEstimate?: string +/** + * Shipping price for the item. Does not account for the whole order's shipping price. + */ +price: number +/** + * In case of scheduled delivery, this object will contain information on the delivery window selected by the shopper. + */ +deliveryWindow?: { +/** + * Delivery window starting day and time in UTC. + */ +startDateUtc?: string +/** + * Delivery window ending day and time in UTC. + */ +endDateUtc?: string +/** + * Delivery window price. + */ +price?: number +/** + * Delivery window list price. + */ +lisPrice?: number +/** + * Delivery window tax. + */ +tax?: number +} +}[] +/** + * Indicate whether this object's information is up to date according to the order's items. An order can not be placed if `"outdated"` + */ +updateStatus?: string +} +/** + * Payment infomation. + */ +paymentData: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode: string +/** + * Gift card value. + */ +value: number +/** + * Gift card balance. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Array of gift card messages. + */ +giftCardMessages?: string[] +/** + * Information on payment systems. + */ +paymentSystems?: { +/** + * Payment system ID. + */ +id?: number +/** + * Payment system name. + */ +name?: string +/** + * Payment group name. + */ +groupName?: string +/** + * Payment system validator. + */ +validator?: { +regex?: string +/** + * Validator mask. + */ +mask?: string +/** + * Card code regular expression. + */ +cardCodeRegex?: string +/** + * Card code mask. + */ +cardCodeMask?: string +/** + * Weights. + */ +weights?: number[] +} +/** + * String ID. + */ +stringId?: string +/** + * Template. + */ +template?: string +/** + * Indicates whether a document is required. + */ +requiresDocument?: boolean +/** + * Indicates whether this payment system has been selected. + */ +selected?: boolean +/** + * Indicates whether it is custom. + */ +isCustom?: boolean +/** + * Description. + */ +description?: string +}[] +/** + * Payment information. + */ +payments: { +/** + * Account ID. + */ +accountId?: string +/** + * Payment bin. + */ +bin?: string +/** + * Number of installments. + */ +installments: number +/** + * Payment system. + */ +paymentSystem: string +/** + * Reference value for calculating interest rates, in case it applies. + */ +referenceValue: number +/** + * Value including interest, in case it applies. + */ +value: number +}[] +/** + * Indicates whether this object's information is up to date according to the order's items. An order can not be placed if `"outdated"` + */ +updateStatus?: string +} +marketingData?: { +/** + * 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. + */ +coupon?: string +/** + * UTM source. + */ +utmSource?: string +/** + * UTM medium. + */ +utmMedium?: string +/** + * UTM campaign + */ +utmCampaign?: string +/** + * utmi_page (internal utm) + */ +utmiPage?: string +/** + * utmi_part (internal utm) + */ +utmiPart?: string +/** + * utmi_campaign (internal utm) + */ +utmiCampaign?: string +} +/** + * Optional field meant to hold additional information about the order. We recommend using this field for text, not data formats such as `JSON` even if escaped. For that purpose, see [Creating customizable fields](https://developers.vtex.com/vtex-rest-api/docs/creating-customizable-fields-in-the-cart-with-checkout-api-1) + */ +openTextField?: string +/** + * Sales Associate information. + */ +salesAssociateData?: { +/** + * Sales Associate (Seller) identification code. All information should be registered by the merchant. Maximum of 100 characters. + */ +salesAssociateId?: string +} +minItems?: 0 +} +response: { +/** + * This is `null` since this request does not depend on any previously existing orderForm information in the platform. + */ +orderForm?: (null | string) +/** + * Information on each transaction pertinent to the order placed. + */ +transactionData?: { +/** + * Information on each merchant transaction. + */ +merchantTransactions?: { +/** + * ID of the seller. + */ +id?: string +/** + * ID of the transaction in the platform. + */ +transactionId?: string +/** + * Name of the merchant responsible for the sale. + */ +merchantName?: string +/** + * Information on each payment pertinent to the transaction. + */ +payments?: { +/** + * Payment system. + */ +paymentSystem?: string +/** + * Payment bin. + */ +bin?: (null | string) +/** + * Account ID. + */ +accountId?: (null | string) +/** + * Token ID. + */ +tokenId?: (null | string) +/** + * Total value to be paid in this payment. + */ +value?: number +/** + * Reference value over which interests may be applied. + */ +referenceValue?: number +/** + * Gift card redemption code. + */ +giftCardRedemptionCode?: (null | string) +/** + * Gift card provider. + */ +giftCardProvider?: (null | string) +/** + * Gift card ID. + */ +giftCardId?: (null | string) +}[] +}[] +/** + * Receiver URI. + */ +receiverUri?: string +/** + * Template of the gateway callback path, which may later be used to send information about the transaction. + */ +gatewayCallbackTemplatePath?: string +} +/** + * Information on each of the orders created. + */ +orders?: { +/** + * ID of the order in the Order Management System (OMS). + */ +orderId?: string +/** + * Order group. Orders that involve different sellers are split into different orders of a same order group. + */ +orderGroup?: string +/** + * State. + */ +state?: (null | string) +/** + * Indicates whether order is checked in. + */ +isCheckedIn?: boolean +/** + * ID of the order in the seller. + */ +sellerOrderId?: (null | string) +/** + * Store ID. + */ +storeId?: (null | string) +/** + * Checked in pickuppoint. + */ +checkedInPickupPointId?: (null | string) +/** + * Value of the order. + */ +value?: number +/** + * Information on each item in the order. + */ +items?: { +/** + * Unique ID. + */ +uniqueId?: string +/** + * ID of the item. + */ +id?: string +/** + * Product ID. + */ +productId?: string +/** + * Product Ref ID. + */ +productRefId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Modal type. + */ +modalType?: (null | string) +/** + * Parent item index. + */ +parentItemIndex?: (null | number) +/** + * Parent assembly binding. + */ +parentAssemblyBinding?: (null | string) +/** + * Price expiration date and time. + */ +priceValidUntil?: string +/** + * Tax value in cents. + */ +tax?: number +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Manual price in cents. + */ +manualPrice?: (null | number) +/** + * User that applied the manual price, if that is the case. + */ +manualPriceAppliedBy?: (null | string) +/** + * Selling price in cents. Note that this field may be subject to rounding discrepancies. We recommend retrieving data from the `priceDefinition` data structure instead. + */ +sellingPrice?: number +/** + * Reward value in cents. + */ +rewardValue?: number +/** + * Indicates whether item is a gift. + */ +isGift?: boolean +/** + * Additional information. + */ +additionalInfo?: { +/** + * Dimension. + */ +dimension?: (null | string) +/** + * Brand name. + */ +brandName?: string +/** + * Brand ID. + */ +brandId?: string +/** + * Offering information. + */ +offeringInfo?: (null | string) +/** + * Offering type. + */ +offeringType?: (null | string) +/** + * Offering type ID. + */ +offeringTypeId?: (null | string) +} +/** + * Presale date. + */ +preSaleDate?: (null | string) +/** + * Product category IDs. + */ +productCategoryIds?: string +/** + * Object, where each field is an ID from `productCategoryIds`. + */ +productCategories?: { +/** + * Product category corresponding to the ID in the field key. + */ +"{ID}"?: string +} +/** + * Quantity. + */ +quantity?: number +/** + * Seller. + */ +seller?: string +/** + * Sellers involved in the chain. The list should contain only one seller, unless it is a [Multilevel Omnichannel Inventory](https://help.vtex.com/pt/tutorial/multilevel-omnichannel-inventory--7M1xyCZWUyCB7PcjNtOyw4) order. + */ +sellerChain?: string[] +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +/** + * Information on services sold along with the SKU. Example: a gift package. + */ +bundleItems?: { +/** + * Service type. + */ +type?: string +/** + * Service identifier. + */ +id?: number +/** + * Service name. + */ +name?: string +/** + * Service price in cents. + */ +price?: number +}[] +/** + * Array containing information on attachments. + */ +attachments?: string[] +/** + * Array of price tags, each of which, modifies the price in some way, like discounts or rates that apply to the item in the context of the order. + */ +priceTags?: { +/** + * Price tag identifier. + */ +identifier?: string +/** + * Indicates whether price tag value is applied through a percentage. + */ +isPercentual?: boolean +/** + * Price tag name. + */ +name?: string +/** + * Price tag raw value. + */ +rawValue?: number +/** + * Price tag value. + */ +value?: number +}[] +/** + * Availability + */ +availability?: string +/** + * Measurement unit + */ +measurementUnit?: string +/** + * Unit multiplier + */ +unitMultiplier?: number +/** + * Manufacturer code. + */ +manufacturerCode?: (null | string) +/** + * Price information for all units of a specific item. + */ +priceDefinition?: { +/** + * Item's calculated unitary selling price in cents. + */ +calculatedSellingPrice?: number +/** + * Total value for all units of the item in cents. + */ +total?: number +/** + * Array of objects, each containing value (in cents) and quantity for the different rounding instances that can be combined to form the correctly rounded total. + */ +sellingPrices?: { +/** + * Value in cents for that specific rounding. + */ +value?: number +/** + * Rounding quantity, meaning how many items are rounded to this value. + */ +quantity?: number +}[] +} +}[] +/** + * Information on each seller. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +logo?: (null | string) +}[] +/** + * Information on order totals. + */ +totals?: { +/** + * Total ID. + */ +id?: string +/** + * Total name. + */ +name?: string +/** + * Total value. + */ +value?: number +}[] +/** + * Customer's profile information. + */ +clientProfileData?: { +/** + * Email address. + */ +email?: string +/** + * First name. + */ +firstName?: string +/** + * Last name. + */ +lastName?: string +/** + * Type of the document informed by the customer. + */ +documentType?: string +/** + * Document informed by the customer. + */ +document?: string +/** + * Phone number. + */ +phone?: string +/** + * Company name, if the customer is a legal entity. + */ +corporateName?: (null | string) +/** + * Trade name, if the customer is a legal entity. + */ +tradeName?: (null | string) +/** + * Corporate document, if the customer is a legal entity. + */ +corporateDocument?: (null | string) +/** + * State inscription, if the customer is a legal entity. + */ +stateInscription?: (null | string) +/** + * Corporate phone number, if the customer is a legal entity. + */ +corporatePhone?: (null | string) +/** + * Indicates whether the customer is a legal entity. + */ +isCorporate?: boolean +/** + * Indicates whether profile is complete on loading. + */ +profileCompleteOnLoading?: boolean +/** + * Indicates whether profile presents error on loading. + */ +profileErrorOnLoading?: (null | boolean) +/** + * Customer class. + */ +customerClass?: (null | string) +} +/** + * Information on rates and benefits that apply to the order. + */ +ratesAndBenefitsData?: { +/** + * List with rates and benefits identifiers. + */ +rateAndBenefitsIdentifiers?: string[] +/** + * List with rates and benefits teasers. + */ +teaser?: string[] +} +/** + * Shipping information pertinent to the order. + */ +shippingData?: { +/** + * Address information. + */ +address?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +} +/** + * Array with logistics information. Each object in this array corresponds to an object in the `items` array, based on the respective `itemIndex`. + */ +logisticsInfo?: { +/** + * Index corresponding to the position of the object in the `items` array. + */ +itemIndex?: number +/** + * SLA selected by the customer. + */ +selectedSla?: string +/** + * Delivery channel selected by the customer. For example, `"delivery"` or `"pickup-in-point"`. + */ +selectedDeliveryChannel?: string +/** + * Address ID. + */ +addressId?: string +/** + * Information on available SLAs. + */ +slas?: { +/** + * SLA ID. + */ +id?: string +/** + * Delivery channel. + */ +deliveryChannel?: string +/** + * SLA name. + */ +name?: string +/** + * Information on each delivery ID. + */ +deliveryIds?: { +/** + * Courier ID. + */ +courierId?: string +/** + * Warehouse ID. + */ +warehouseId?: string +/** + * Warehouse ID. + */ +dockId?: string +/** + * Courier name. + */ +courierName?: string +/** + * Quantity. + */ +quantity?: number +}[] +/** + * Shipping estimate. For instance, Three business days will be represented `3bd`. + */ +shippingEstimate?: string +/** + * Shipping estimate date. + */ +shippingEstimateDate?: (null | string) +/** + * Estimate date of delivery. + */ +lockTTL?: string +/** + * Price in cents. + */ +price?: number +/** + * List price in cents. + */ +listPrice?: number +/** + * Tax in cents. + */ +tax?: number +/** + * Information on the pickup store. + */ +pickupStoreInfo?: { +/** + * Indicates whether it is the pickup store. + */ +isPickupStore?: boolean +/** + * Friendly name. + */ +friendlyName?: (null | string) +/** + * Address information. + */ +address?: (null | { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: (null | string) +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}) +/** + * Additional information. + */ +additionalInfo?: (null | string) +/** + * Corresponding dock ID. + */ +dockId?: (null | string) +} +/** + * Pickup point ID. + */ +pickupPointId?: (null | string) +/** + * Pickup point distance. + */ +pickupDistance?: number +/** + * Polygon name. + */ +polygonName?: (null | string) +/** + * Transit time. For instance, "three business days" is represented `3bd`. + */ +transitTime?: string +}[] +/** + * List of countries that the item may be shipped to. + */ +shipsTo?: string[] +/** + * Item ID. + */ +itemId?: string +/** + * List of available delivery channels. + */ +deliveryChannels?: { +/** + * Delivery channel ID. + */ +id?: string +}[] +}[] +/** + * Array with information on the selected addresses for the order. + */ +selectedAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +/** + * Array with information on the available addresses for the order. + */ +availableAddresses?: { +/** + * Type of address. For example, `Residential` or `Pickup`. + */ +addressType?: string +/** + * Name of the person who is going to receive the order. + */ +receiverName?: string +/** + * Address ID. + */ +addressId?: string +/** + * Indicates whether address is disposable. + */ +isDisposable?: boolean +/** + * Postal code. + */ +postalCode?: string +/** + * City of the shipping address. + */ +city?: string +/** + * State of the shipping address. + */ +state?: string +/** + * Three letter ISO code of the country of the shipping address. + */ +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, in case it applies. + */ +complement?: string +/** + * Complement that might help locate the shipping address more precisely in case of delivery. + */ +reference?: (null | string) +/** + * Array containing two floats with geocoordinates, first longitude, then latitude. + */ +geoCoordinates?: number[] +}[] +} +/** + * Information on the order's payment. + */ +paymentData?: { +/** + * Gift card information, if it applies to the order. + */ +giftCards?: { +/** + * Gift card redemption code. + */ +redemptionCode?: string +/** + * Gift card value in cents. + */ +value?: number +/** + * Gift card balance in cents. + */ +balance?: number +/** + * Gift card name. + */ +name?: string +/** + * Gift card ID. + */ +id?: string +/** + * Indicates whether gift card is in use. + */ +inUse?: boolean +/** + * Indicates whether gift card is special. + */ +isSpecialCard?: boolean +}[] +/** + * Information on each transaction pertinent to the order. + */ +transactions?: { +/** + * Indicates whether transaction is active. + */ +isActive?: boolean +/** + * Transaction ID. + */ +transactionId?: string +/** + * Merchant name. + */ +merchantName?: string +/** + * Information on each payment. + */ +payments?: { +/** + * Account ID. + */ +accountId?: string +/** + * Bin. + */ +bin?: string +/** + * Number of installments. + */ +installments?: number +/** + * Payment system. + */ +paymentSystem?: string +/** + * Reference value for calculating interest rates, in case it applies. Displayed in cents. + */ +referenceValue?: number +/** + * Value including interest, in case it applies. Displayed in cents. + */ +value?: number +}[] +/** + * Indicates whather transaction is shared. + */ +sharedTransaction?: boolean +}[] +} +/** + * Item metadata. + */ +itemMetadata?: { +/** + * List of objects containing metadata on each item in the order. + */ +items?: { +/** + * Item ID. + */ +id?: string +/** + * Seller. + */ +seller?: string +/** + * Product name. + */ +name?: string +/** + * SKU name. + */ +skuName?: string +/** + * Product ID. + */ +productId?: string +/** + * Ref ID. + */ +refId?: string +/** + * European Article Number. + */ +ean?: (null | string) +/** + * Image URL. + */ +imageUrl?: string +/** + * Detail URL. + */ +detailUrl?: string +}[] +} +/** + * Sales channel. + */ +salesChannel?: string +/** + * Follow up email address. + */ +followUpEmail?: string +/** + * Creation date. + */ +creationDate?: string +/** + * Last change. + */ +lastChange?: string +/** + * Time zone creation date. + */ +timeZoneCreationDate?: string +/** + * Time zone last change. + */ +timeZoneLastChange?: string +/** + * Indicates whether order is completed. + */ +isCompleted?: boolean +/** + * Host name. + */ +hostName?: string +/** + * Merchant name. + */ +merchantName?: (null | string) +/** + * User type. + */ +userType?: string +/** + * Rounding error. + */ +roundingError?: number +/** + * Indicates whether edition is allowed. + */ +allowEdition?: boolean +/** + * Indicates whether cancelation is allowed. + */ +allowCancelation?: boolean +/** + * Indicates whether seller changing is allowed. + */ +allowChangeSeller?: boolean +/** + * Indicates whether user data is visible. + */ +isUserDataVisible?: boolean +/** + * `orderForm` creation date. + */ +orderFormCreationDate?: string +/** + * Sales Associate (Seller) identification code. + */ +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. + */ +"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. + */ +"GET /api/checkout/pub/regions/:regionId": { +searchParams: { +/** + * Three letter country code refering to the `postalCode` field. + */ +country: string +/** + * Postal code corresponding to the shopper's location. + */ +postalCode?: string +/** + * Geocoordinates (first longitude, semicolon, then latitude) corresponding to the shopper's location. + */ +geoCoordinates?: number[] +} +response: { +/** + * Region ID. + */ +id?: string +/** + * Array with information on each seller retrieved for the given region. + */ +sellers?: { +/** + * Seller ID. + */ +id?: string +/** + * Seller name. + */ +name?: string +/** + * Seller logo. + */ +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). + * + * To learn more about machine authentication at VTEX, see [Authentication overview](https://developers.vtex.com/docs/guides/authentication). + */ +"GET /api/oms/user/orders": { +searchParams: { +/** + * Customer email. + */ +clientEmail: string +/** + * Page number for result pagination. + */ +page: string +/** + * Page quantity for result pagination. + */ +per_page: string +} +response: Userorderslist +} +/** + * Retrieves information from a previously created sesssion. + * + * +>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers to Session Manager API in order for it to work outside of a browser environment. + * + * ## Permissions + * + * This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + */ +"GET /api/sessions": { +searchParams: { +/** + * Items are the keys of the values you wish to get. They follow the format `namespace1.key1,namespace2.key2`. + * + * +If you wish to recover the data sent on [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it should be `public.{key}`, replacing `{key}` with the name of the custom property you created. Following the example request presented in [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it would be `public.variable1,public.variable2`. + * + * +If you want to retrieve all keys from Session Manager, you can use the wildcard operator (`*`) as a value for this query parameter. + */ +items: string +} +response: GetSessionResponse +} +/** + * Creates a new session and returns a session token and a segment token. Also stores `vtex_session` and `vtex_segment` cookies, with the same values returned in the response. + * + * +All parameters in the body that are not within the public namespace will be ignored. Query string items will automatically be added to the public namespace. + * + * +>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers in other requests to Session Manager API in order for it to work outside of a browser environment. + * + * ## Permissions + * + * This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + */ +"POST /api/sessions": { +body: CreateEditSessionRequest +response: CreateEditSessionResponse +} +/** + * Edits information from a previously created sesssion. + * + * +This endpoint works the same way as the [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions) endpoint, but when the request is sent with a `vtex_session` and the `vtex_segment` cookies in the header, it retrieves the session first and then applies the changes instead of generating a new one. + * + * +Only keys inside the `public` namespace in the request body are considered, and query parameters are automatically added to the public namespace. + * + * +>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers to Session Manager API in order for it to work outside of a browser environment. + * + * ## Permissions + * + * This endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3). + */ +"PATCH /api/sessions": { +body: CreateEditSessionRequest +response: CreateEditSessionResponse +} +/** + * 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 +} +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 +} +} +/** + * 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 +} +} +/** + * Pickup point information. + */ +export interface PickupPoint { +/** + * [Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID. + */ +id?: string +/** + * Pickup point name displayed to customers at checkout. + */ +name?: string +/** + * Pickup point description displayed to customers at checkout. + */ +description?: string +/** + * Instructions for customers when collecting their package. + */ +instructions?: string +/** + * Formatted address. + */ +formatted_address?: string +/** + * Pickup point address information. + */ +address?: { +/** + * Pickup point address postal code. + */ +postalCode?: string +/** + * Information about the pickup point address country. + */ +country?: { +/** + * Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format. + */ +acronym?: string +/** + * Country name of the pickup point address. + */ +name?: string +} +/** + * Pickup point address city. + */ +city?: string +/** + * Pickup point address state. + */ +state?: string +/** + * Pickup point address neighborhood. + */ +neighborhood?: string +/** + * Pickup point address street. + */ +street?: string +/** + * Pickup point address number. + */ +number?: string +/** + * Pickup point address complement. + */ +complement?: string +/** + * Reference point to help the customer find the pickup point. + */ +reference?: string +/** + * Pickup point address geolocation coordinates. + */ +location?: { +/** + * Latitude coordinate. + */ +latitude?: number +/** + * Longitude coordinate. + */ +longitude?: number +} +} +/** + * Defines if the pickup point is active (`true`) or inactive (`false`). + */ +isActive?: boolean +/** + * Pickup point configured distance. + */ +distance?: number +/** + * Seller that corresponds to the pickup point. + */ +seller?: string +/** + * Sort array. + */ +_sort?: number[] +/** + * Pickup point business hours configurations. + */ +businessHours?: { +/** + * Day of the week identification, as in `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, and `5` = Friday. + */ +dayOfWeek?: number +/** + * Opening time in `HH:MM:SS` format. + */ +openingTime?: string +/** + * Closing time in `HH:MM:SS` format. + */ +closingTime?: string +}[] +/** + * Tags that identify a group of pickup points. + */ +tagsLabel?: string[] +/** + * [Holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured for the pickup point. + */ +pickupHolidays?: { +/** + * Holiday date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`. + */ +date?: string +/** + * Holiday beginning time in `HH:MM` format. + */ +hourBegin?: string +/** + * Holiday ending time in `HH:MM` format. + */ +hourEnd?: string +}[] +/** + * Defines if the pickup point is third-party (`true`) or not (`false`). + */ +isThirdPartyPickup?: boolean +/** + * Account owner name. + */ +accountOwnerName?: string +/** + * Account owner ID. + */ +accountOwnerId?: string +/** + * Parent account name. + */ +parentAccountName?: string +/** + * Original ID. + */ +originalId?: string +} +/** + * Document information. + */ +export interface IdHrefDocumentID { +/** + * ID of the document that was created, with data entity prefix. + */ +Id?: string +/** + * Document reference URL. + */ +Href?: string +/** + * Unique identifier of the document. + */ +DocumentId?: string +} +/** + * 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 +} +export interface GetorUpdateProductSpecification { +/** + * Array with Specification values. + */ +Value: string[] +/** + * Specification field ID, which is the same as `FieldId` in other specification endpoints. + */ +Id?: number +/** + * Name of the Specification. + */ +Name?: string +} +export interface GetSKUandContext { +/** + * SKU ID. + */ +Id: number +/** + * ID of the related Product. + */ +ProductId: number +/** + * Product Name and SKU Name concatenated. + */ +NameComplete: string +/** + * Product Complement Name. + */ +ComplementName?: string +/** + * Product Name. + */ +ProductName: string +/** + * Product Description. HTML is allowed. + */ +ProductDescription: string +/** + * Reference ID of the related Product. + */ +ProductRefId?: string +/** + * SKU Tax Code. + */ +TaxCode?: string +/** + * SKU Name. + */ +SkuName: string +/** + * Defines if the SKU is active or not. + */ +IsActive: boolean +/** + * @deprecated + */ +IsTransported: boolean +/** + * @deprecated + */ +IsInventoried: boolean +/** + * Defines if the purchase will generate a reward. + */ +IsGiftCardRecharge: boolean +/** + * SKU image URL. + */ +ImageUrl: string +/** + * Product URL. + */ +DetailUrl: string +/** + * SKU Seller identification. + */ +CSCIdentification: string +/** + * Product Brand ID. + */ +BrandId: string +/** + * Product Brand Name. + */ +BrandName: string +Dimension: Dimension +RealDimension: RealDimension +/** + * Product Supplier ID. + */ +ManufacturerCode: string +/** + * Defines if the SKU is part of a bundle. + */ +IsKit: boolean +/** + * Array with SKU IDs of bundle components. + */ +KitItems: string[] +/** + * Array with Service IDs that are related to the SKU. + */ +Services: string[] +/** + * Array with Categories from the related Product. + */ +Categories: string[] +/** + * Array with Attachments ID that are related to the SKU. + */ +Attachments: Attachment[] +/** + * Array with Collections ID that are related to the Product. + */ +Collections: string[] +/** + * Array with SKU Sellers data. + */ +SkuSellers: SkuSeller[] +/** + * Array with the ID of all the Sales Channels that are related to the product. + */ +SalesChannels: number[] +/** + * Array with SKU images. + */ +Images: Image[] +/** + * Array with related SKU Specifications. + */ +SkuSpecifications: SkuSpecification[] +/** + * Array with related Product Specifications. + */ +ProductSpecifications: ProductSpecification[] +ProductClusterNames?: { +/** + * Collection ID + */ +[k: string]: string +} +/** + * Product Clusters IDs. + */ +ProductClustersIds: string +/** + * Category Hierarchy with Category IDs. + */ +ProductCategoryIds: string +/** + * Global Category ID. + */ +ProductGlobalCategoryId: number +/** + * Object containing product categories. Structure: "{CategoryID}": "{CategoryName}". + */ +ProductCategories: { +/** + * Category ID. + */ +[k: string]: string +} +/** + * SKU Commercial Condition ID. + */ +CommercialConditionId: number +/** + * Reward value related to the SKU. + */ +RewardValue: number +AlternateIds: AlternateIds +/** + * Array with values of alternative SKU IDs. + */ +AlternateIdValues: string[] +/** + * To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival: string +/** + * SKU Measurement Unit. + */ +MeasurementUnit: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier: number +/** + * Information Source. + */ +InformationSource: string +/** + * Modal Type. + */ +ModalType: string +/** + * Keywords related to the product. + */ +KeyWords?: string +/** + * Release date of the product. + */ +ReleaseDate?: string +/** + * Defines if the product is visible or not. + */ +ProductIsVisible?: boolean +/** + * Defines if the product will be shown if it is not available. + */ +ShowIfNotAvailable?: boolean +/** + * Defines if the product is active or not. + */ +IsProductActive?: boolean +/** + * Product Final Score. + */ +ProductFinalScore?: number +} +/** + * Object containing the SKU dimensions to be used on the shipping calculation. + */ +export interface Dimension { +/** + * SKU Cubic Weight. + */ +cubicweight: number +/** + * SKU Height. + */ +height: number +/** + * SKU Length. + */ +length: number +/** + * SKU Weight. + */ +weight: number +/** + * SKU Width. + */ +width: number +} +/** + * Object containing the real SKU dimensions, which appear in the product page. + */ +export interface RealDimension { +/** + * Real SKU Cubic Weight. + */ +realCubicWeight: number +/** + * Real SKU Height. + */ +realHeight: number +/** + * Real SKU Length. + */ +realLength: number +/** + * Real SKU Weight. + */ +realWeight: number +/** + * Real SKU Width. + */ +realWidth: number +} +/** + * Object containing information about SKU attachments. + */ +export interface Attachment { +/** + * Attachment ID. + */ +Id: number +/** + * Attachment Name. + */ +Name: string +/** + * Attachment Keys. + */ +Keys: string[] +/** + * Array containing Attachment fields. + */ +Fields: Field[] +/** + * Defines if the Attachment is active or not. + */ +IsActive: boolean +/** + * Defines if the Attachment is required or not. + */ +IsRequired: boolean +} +export interface Field { +/** + * Attachment field name. + */ +FieldName: string +/** + * Maximum number of characters accepted in the attachment field. + */ +MaxCaracters: string +/** + * Allowed key values. + */ +DomainValues: string +} +/** + * Object containing related SKU Sellers data. + */ +export interface SkuSeller { +/** + * SKU Seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. + */ +SellerId: string +/** + * SKU ID. + */ +StockKeepingUnitId: number +/** + * SKU ID for the SKU Seller. + */ +SellerStockKeepingUnitId: string +/** + * Defines if the SKU is active. + */ +IsActive: boolean +/** + * Registered value for Seller Freight Commission. + */ +FreightCommissionPercentage: number +/** + * Registered value for Seller Product Commission. + */ +ProductCommissionPercentage: number +} +/** + * Object containing SKU images details. + */ +export interface Image { +/** + * Image URL. + */ +ImageUrl: string +/** + * Image label. + */ +ImageName: string +/** + * SKU image ID. + */ +FileId: number +} +/** + * Object containing related SKU Specifications. + */ +export interface SkuSpecification { +/** + * Specification field ID. + */ +FieldId: number +/** + * Specification field Name. + */ +FieldName: string +/** + * Array with related Specification Values IDs. + */ +FieldValueIds: number[] +/** + * Array with related Specification Values. + */ +FieldValues: string[] +} +export interface ProductSpecification { +/** + * Specification field ID. + */ +FieldId: number +/** + * Specification name. Limited to 100 characters. + */ +FieldName: string +/** + * Array with related Specification Values IDs. + */ +FieldValueIds: number[] +/** + * Array with related Specification Values. + */ +FieldValues: string[] +} +/** + * Array with alternate SKU IDs, such as EAN and RefId. + */ +export interface AlternateIds { +/** + * SKU EAN. + */ +Ean?: string +/** + * SKU Reference ID. + */ +RefId?: string +} +export interface GetSKUAltID { +/** + * SKU ID. + */ +Id: number +/** + * Product ID. + */ +ProductId: number +/** + * Product Name and SKU Name combined. + */ +NameComplete: string +/** + * Product Complement Name. + */ +ComplementName?: string +/** + * Product Name. + */ +ProductName: string +/** + * Product Description. HTML is allowed. + */ +ProductDescription: string +/** + * Product Reference ID. + */ +ProductRefId?: string +/** + * SKU Tax Code. + */ +TaxCode?: string +/** + * SKU Name. + */ +SkuName: string +/** + * Defines if the SKU is active or not. + */ +IsActive: boolean +/** + * @deprecated + */ +IsTransported: boolean +/** + * @deprecated + */ +IsInventoried: boolean +/** + * Defines if the purchase of the SKU will generate reward value for the customer. + */ +IsGiftCardRecharge: boolean +/** + * SKU image URL. + */ +ImageUrl: string +/** + * Product slug. + */ +DetailUrl: string +/** + * SKU Seller Identification. + */ +CSCIdentification: string +/** + * Brand ID. + */ +BrandId: string +/** + * Brand Name. + */ +BrandName: string +Dimension: Dimension +RealDimension: RealDimension +/** + * Product Supplier ID. + */ +ManufacturerCode: string +/** + * Defines if the SKU is part of a bundle. + */ +IsKit: boolean +/** + * Array with SKU IDs of bundle components. + */ +KitItems: string[] +/** + * Array with Service IDs that are related to the SKU. + */ +Services: string[] +/** + * Categories of the related product. + */ +Categories: string[] +/** + * Path of Categories of the related product. + */ +CategoriesFullPath?: string[] +/** + * Array with Attachments ID that are related to the SKU. + */ +Attachments: Attachment[] +/** + * Array with Collections IDs that are related to the Product. + */ +Collections: string[] +/** + * Array with related Sellers data. + */ +SkuSellers: SkuSeller[] +/** + * Array of trade policy IDs. + */ +SalesChannels: number[] +/** + * Array of objects with SKU image details. + */ +Images: Image[] +/** + * Array with related SKU Specifications. + */ +SkuSpecifications: SkuSpecification[] +/** + * Array with related Product Specifications. + */ +ProductSpecifications: ProductSpecification[] +/** + * Product Cluster IDs separated by comma (`,`). + */ +ProductClustersIds: string +/** + * Product Clusters position in each Cluster. Structure: "{Product Cluster ID}": {Position}. + * + * `{Product Cluster ID}` is a string, while `{Position}` is an integer. + */ +PositionsInClusters?: { +/** + * Product Cluster ID. + */ +[k: string]: number +} +/** + * Product Clusters Names. Structure: "{Product Cluster ID}": "{Product Cluster Name}". Both the key and the value are strings. + */ +ProductClusterNames?: { +/** + * Product Cluster ID. + */ +[k: string]: string +} +/** + * Product Clusters Highlights. Structure: "{Product Cluster ID}": "{Product Cluster Name}". Both the key and the value are strings. + */ +ProductClusterHighlights?: { +/** + * Product Cluster ID. + */ +[k: string]: string +} +/** + * Category path composed by category IDs separated by `/`. + */ +ProductCategoryIds: string +/** + * Indicates if the direct Product Category is active or not. + */ +IsDirectCategoryActive?: boolean +/** + * Product Global Category ID. + */ +ProductGlobalCategoryId: number +/** + * Object containing product categories. Structure: "{CategoryID}": "{CategoryName}". Both the key and the value are strings. + */ +ProductCategories: { +/** + * Category ID. + */ +[k: string]: string +} +/** + * SKU Commercial Condition ID. + */ +CommercialConditionId: number +/** + * Reward value related to the SKU. + */ +RewardValue: number +AlternateIds: AlternateIds +/** + * Array with values of alternative SKU IDs. + */ +AlternateIdValues: string[] +/** + * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival: string +/** + * Measurement unit. + */ +MeasurementUnit: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier: number +/** + * Information Source. + */ +InformationSource: string +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType: string +/** + * Keywords related to the product. + */ +KeyWords?: string +/** + * Release date of the product. + */ +ReleaseDate?: string +/** + * Defines if the product is visible or not. + */ +ProductIsVisible?: boolean +/** + * Defines if the product will be shown if it is not available. + */ +ShowIfNotAvailable?: boolean +/** + * Defines if the product is active or not. + */ +IsProductActive?: boolean +/** + * Product Final Score. + */ +ProductFinalScore?: number +} +export interface SkulistbyProductId { +/** + * Defines if the SKU is persisted. + */ +IsPersisted?: boolean +/** + * @deprecated + * Defines if the SKU is removed. + */ +IsRemoved?: boolean +/** + * SKU ID. + */ +Id?: number +/** + * Product ID. + */ +ProductId?: number +/** + * Defines if the SKU is active or not. + */ +IsActive?: boolean +/** + * SKU Name. + */ +Name?: string +/** + * SKU Height. + */ +Height?: number +/** + * Real SKU Height. + */ +RealHeight?: number +/** + * SKU Width. + */ +Width?: number +/** + * Real SKU Width. + */ +RealWidth?: number +/** + * SKU Length. + */ +Length?: number +/** + * Real SKU Length. + */ +RealLength?: number +/** + * Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +WeightKg?: number +/** + * Real Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams. + */ +RealWeightKg?: number +/** + * Delivery Method (Modal Type) ID. + */ +ModalId?: number +/** + * Product Reference ID. + */ +RefId?: string +/** + * [Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128). + */ +CubicWeight?: number +/** + * Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted. + */ +IsKit?: boolean +/** + * @deprecated + */ +IsDynamicKit?: string +/** + * Internal note. + */ +InternalNote?: string +/** + * Date when the product was updated for the most recent time. + */ +DateUpdated?: string +/** + * Reward value related to the SKU. + */ +RewardValue?: number +/** + * SKU Commercial Condition ID. + */ +CommercialConditionId?: number +/** + * SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date. + */ +EstimatedDateArrival?: string +/** + * Defines if the SKU bundle items can be sold separately. + */ +FlagKitItensSellApart?: boolean +/** + * Product Supplier ID. + */ +ManufacturerCode?: string +/** + * SKU Reference ID. + */ +ReferenceStockKeepingUnitId?: string +/** + * SKU Position. + */ +Position?: number +/** + * When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component. + */ +ActivateIfPossible?: boolean +/** + * Measurement unit. + */ +MeasurementUnit?: string +/** + * This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward. + */ +UnitMultiplier?: number +/** + * @deprecated + */ +IsInventoried?: boolean +/** + * @deprecated + */ +IsTransported?: boolean +/** + * Defines if the purchase of the SKU will generate reward value for the customer. + */ +IsGiftCardRecharge?: boolean +/** + * Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. "Chemicals" or "Refrigerated products"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy). + */ +ModalType?: string +/** + * Defines if the SKU is a Optimized bundle. + */ +isKitOptimized?: boolean +} +export interface SKUFileURL { +/** + * Defines if the Image is the main image of the SKU. + */ +IsMain?: boolean +/** + * SKU image label. + */ +Label?: string +/** + * SKU image name. + */ +Name: string +/** + * General text of the image. + */ +Text?: string +/** + * External Image's URL. The URL must start with the protocol identifier (`http://` or `https://`) and end with the file extension (`.jpg`, `.png` or `.gif`). + */ +Url: string +} +export interface SkuKit { +/** + * SKU Kit ID, same as `StockKeepingUnitParent`. + */ +Id?: number +/** + * Parent SKU ID. + */ +StockKeepingUnitParent?: number +/** + * SKU ID of the kit component. + */ +StockKeepingUnitId?: number +/** + * Component quantity. + */ +Quantity?: number +/** + * Component price per unit. + */ +UnitPrice?: number +} +export interface SKUService { +/** + * SKU Service ID. + */ +Id?: number +/** + * SKU Service Type ID. + */ +SkuServiceTypeId?: number +/** + * SKU Service Value ID. + */ +SkuServiceValueId?: number +/** + * SKU ID. + */ +SkuId?: number +/** + * SKU Service Name. Maximum of 50 characters. + */ +Name?: string +/** + * Internal description of the SKU Service. Maximum of 100 characters. + */ +Text?: string +/** + * Defines if the SKU Service is active or not. + */ +IsActive?: boolean +} +export interface SKUServiceTypeRequest { +/** + * SKU Service Type Name. Maximum of 100 characters. + */ +Name: string +/** + * Defines if the SKU Service Type is active or not. + */ +IsActive: boolean +/** + * @deprecated + * Deprecated + */ +ShowOnProductFront: boolean +/** + * Defines if the SKU Service Type is displayed on the cart screen. + */ +ShowOnCartFront: boolean +/** + * Defines if the SKU Service Type has an attachment. + */ +ShowOnAttachmentFront: boolean +/** + * Defines if the SKU Service Type can be associated with an attachment or not. + */ +ShowOnFileUpload: boolean +/** + * Defines if the SKU Service Type is displayed as a Gift Card. + */ +IsGiftCard: boolean +/** + * Defines if the SKU Service type is mandatory. + */ +IsRequired: boolean +} +export interface SKUServiceTypeResponse { +/** + * SKU Service Type ID. + */ +Id?: number +/** + * SKU Service Type Name. Maximum of 100 characters. + */ +Name?: string +/** + * Defines if the SKU Service Type is active or not. + */ +IsActive?: boolean +/** + * @deprecated + * Deprecated. + */ +ShowOnProductFront?: boolean +/** + * Defines if the SKU Service Type is displayed on the cart screen. + */ +ShowOnCartFront?: boolean +/** + * Defines if the SKU Service Type has an attachment. + */ +ShowOnAttachmentFront?: boolean +/** + * Defines if the SKU Service Type can be associated with an attachment or not. + */ +ShowOnFileUpload?: boolean +/** + * Defines if the SKU Service Type is displayed as a Gift Card. + */ +IsGiftCard?: boolean +/** + * Defines if the SKU Service type is mandatory. + */ +IsRequired?: boolean +} +export interface SKUServiceValueRequest { +/** + * SKU Service Type ID. + */ +SkuServiceTypeId: number +/** + * SKU Service Value name. Maximum of 100 characters. + */ +Name: string +/** + * SKU Service Value value. + */ +Value: number +/** + * SKU Service Value cost. + */ +Cost: number +} +export interface SKUServiceValueResponse { +/** + * SKU Service Value ID. + */ +Id?: number +/** + * SKU Service Type ID. + */ +SkuServiceTypeId: number +/** + * SKU Service Value name. Maximum of 100 characters. + */ +Name: string +/** + * SKU Service Value value. + */ +Value: number +/** + * SKU Service Value cost. + */ +Cost: number +} +export interface SKUSpecificationResponse { +/** + * ID of the association of the specification and the SKU. This ID is used to update or delete the specification. + */ +Id?: number +/** + * SKU ID. + */ +SkuId?: number +/** + * Specification field ID. + */ +FieldId?: number +/** + * Specification Value ID. Required only for `FieldTypeId` as `5`, `6` and `7`. + */ +FieldValueId?: number +/** + * Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`. + */ +Text?: string +} +export interface GetCategoryTree { +/** + * Category ID. + */ +id: number +/** + * Category name. + */ +name: string +/** + * If the category has a category child (`true`) or not (`false`). + */ +hasChildren: boolean +/** + * Category URL. + */ +url: string +/** + * Array with information about the category's children. + */ +children: GetCategoryTreeChild[] +/** + * Category page title. + */ +Title: string +/** + * Category page Meta tag description. + */ +MetaTagDescription: string +} +export interface GetCategoryTreeChild { +/** + * Category ID. + */ +id: number +/** + * Category name. + */ +name: string +/** + * If the category has a category child (`true`) or not (`false`). + */ +hasChildren: boolean +/** + * Category URL. + */ +url: string +/** + * Array with information about the category's children. + */ +children: any[] +/** + * Category page title. + */ +Title: string +/** + * Category page Meta tag description. + */ +MetaTagDescription: string +} +export interface Category { +/** + * Category ID. + */ +Id: number +/** + * Category name. + */ +Name: string +/** + * ID of the father category, apply in case of category and subcategory. + */ +FatherCategoryId: number +/** + * Category page title. + */ +Title: string +/** + * Describes details about the category. + */ +Description: string +/** + * Substitutes words for the category. + */ +Keywords: string +/** + * Shows if the category is active (`true`) or not (`false`). + */ +IsActive: boolean +/** + * @deprecated + * This is a legacy field. Do not take this information into consideration. + */ +LomadeeCampaignCode: string +/** + * @deprecated + * This is a legacy field. Do not take this information into consideration. + */ +AdWordsRemarketingCode: string +/** + * Defines if the category is shown on side and upper menu (`true`) or not (`false`). + */ +ShowInStoreFront: boolean +/** + * Defines if the category has brand filter (`true`) or not (`false`). + */ +ShowBrandFilter: boolean +/** + * Defines if the Category has an active link on the website (`true`) or not (`false`). + */ +ActiveStoreFrontLink: boolean +/** + * Google Global Category ID. + */ +GlobalCategoryId: number +/** + * Defines how the SKU will be exhibited. + */ +StockKeepingUnitSelectionMode: string +/** + * Score for search ordination. + */ +Score: number +/** + * Text Link. + */ +LinkId: string +/** + * Defines if the category has child categories (`true`) or not (`false`). + */ +HasChildren: boolean +} +export interface CreateCategoryRequest { +/** + * Category unique identifier. If not informed, it will be automatically generated by VTEX. + */ +Id?: number +/** + * Category name. + */ +Name: string +/** + * Substitute words for the Category. + */ +Keywords: string +/** + * Text used in title tag for Category page. + */ +Title: string +/** + * Text used in meta description tag for Category page. + */ +Description: string +/** + * @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 +/** + * ID of the parent category, apply in case of category and subcategory. + */ +FatherCategoryId: number +/** + * Google Global Category ID. + */ +GlobalCategoryId: number +/** + * If true, the Category is shown in the top and side menu. + */ +ShowInStoreFront: boolean +/** + * If true, the Category page becomes available in store. + */ +IsActive: boolean +/** + * If true, the Category link becomes active in store. + */ +ActiveStoreFrontLink: boolean +/** + * If true, the Category page displays a Brand filter. + */ +ShowBrandFilter: boolean +/** + * Score for search sorting order. + */ +Score: number +/** + * Defines how the SKU will be exhibited + */ +StockKeepingUnitSelectionMode: string +} +/** + * Object containing Brand information. + */ +export interface BrandGet { +/** + * Brand's unique numerical identifier. + */ +id: number +/** + * Brand name. + */ +name: string +/** + * Defines if the brand is active (`true`) or not (`false`). + */ +isActive: boolean +/** + * Meta Title for the Brand page. + */ +title: string +/** + * Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description. + */ +metaTagDescription: string +/** + * URL of the brand's image. + */ +imageUrl: string +} +/** + * Object containing Brand information. + */ +export interface BrandCreateUpdate { +/** + * Brand's unique numerical identifier. + */ +Id: number +/** + * Brand name. + */ +Name: string +/** + * Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description. + */ +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. + * + */ +Keywords?: string +/** + * Meta Title for the Brand page. + */ +SiteTitle?: string +/** + * @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 +/** + * 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 (``). + * + */ +MenuHome?: boolean +/** + * Defines if the brand is active (`true`) or not (`false`). + */ +Active?: boolean +/** + * Brand page slug. Only lowercase letters and hyphens (`-`) are allowed. + */ +LinkId?: string +} +export interface AttachmentResponse { +/** + * Attachment ID. + */ +Id: number +/** + * Attachment Name. + */ +Name: string +/** + * Defines if the attachment is required or not. + */ +IsRequired: boolean +/** + * Defines if the attachment is active or not. + */ +IsActive: boolean +/** + * List of characteristics related to the attachment. + */ +Domains: { +/** + * Attachment key name. + */ +FieldName?: string +/** + * Maximum number of characters in the attachment key. + */ +MaxCaracters?: string +/** + * Allowed key values. + */ +DomainValues?: string +}[] +} +export interface AttachmentRequest { +/** + * Attachment Name. + */ +Name: string +/** + * Defines if the attachment is required or not. + */ +IsRequired: boolean +/** + * Defines if the attachment is active or not. + */ +IsActive: boolean +/** + * List of characteristics related to the attachment. + */ +Domains: { +/** + * Attachment key name. + */ +FieldName?: string +/** + * Maximum number of characters in the attachment key. + */ +MaxCaracters?: string +/** + * Allowed key values. + */ +DomainValues?: string +}[] +} +export interface SpecificationsInsertFieldRequest { +/** + * Specification Field name. Limited to 100 characters. + */ +Name: string +/** + * Category ID. + */ +CategoryId: number +/** + * Specification Field ID. + */ +FieldId: number +/** + * Defines if the Specification Field is active. The default value is `true`. + */ +IsActive: boolean +/** + * Makes the Specification Field mandatory (`true`) or optional (`false`). + */ +IsRequired: boolean +/** + * Specification Field Type ID. + */ +FieldTypeId: number +/** + * Specification Field Value ID. + */ +FieldValueId: number +/** + * Specification Field Description. + */ +Description: string +/** + * If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field. + */ +IsStockKeepingUnit: boolean +/** + * 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. + * + */ +IsOnProductDetails: boolean +/** + * Specification Field Position. + */ +Position: number +/** + * @deprecated + * Deprecated field. + */ +IsWizard: boolean +/** + * 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. + * + */ +IsSideMenuLinkActive: boolean +/** + * Specification Field default Value. + */ +DefaultValue: string +/** + * Specification Field Group ID. + */ +FieldGroupId: number +/** + * Specification Field Group Name. + */ +FieldGroupName: string +} +export interface SpecificationsInsertFieldUpdateRequest { +/** + * Specification Field ID. + */ +Name: string +/** + * Category ID. + */ +CategoryId: number +/** + * Specification Field ID. + */ +FieldId: number +/** + * Enables(`true`) or disables (`false`) the Specification Field. + */ +IsActive: boolean +/** + * Makes the Specification Field mandatory (`true`) or optional (`false`). + */ +IsRequired: boolean +/** + * Specification Field Type ID. + */ +FieldTypeId: number +/** + * Specification Field Value ID. + */ +FieldValueId?: number +/** + * Specification Field Description. + */ +Description: string +/** + * If `true`, it will be added as a SKU specification field. If `false`, it will be added as a product specification field. + */ +IsStockKeepingUnit: boolean +/** + * 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. + * + */ +IsOnProductDetails: boolean +/** + * Specification Field Position. + */ +Position: number +/** + * @deprecated + * Deprecated field. + */ +IsWizard: boolean +/** + * 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. + * + */ +IsSideMenuLinkActive: boolean +/** + * Specification Field default Value. + */ +DefaultValue: string +/** + * Specification Field Group ID. + */ +FieldGroupId: number +/** + * Specification Field Group Name. + */ +FieldGroupName: string +} +export interface GetSpecFieldValue { +/** + * Specification Field Value ID. + */ +FieldValueId: number +/** + * Specification Field Value. + */ +Value: string +/** + * Defines if the Specification Field is active (`true`) or inactive (`false`). + */ +IsActive: boolean +/** + * Specification Field Value Position. + */ +Position: number +} +export interface SpecificationsInsertFieldValueRequest { +/** + * Specification Field ID. + */ +FieldId: number +/** + * Specification Field Value Name. + */ +Name: string +/** + * Specification Field Value Description. + */ +Text: string +/** + * Defines if the Specification Field Value is active (`true`) or inactive (`false`). + */ +IsActive: boolean +/** + * Specification Field Value Position. + */ +Position: number +} +export interface SpecificationsUpdateFieldValueRequest { +/** + * Specification Field ID. + */ +FieldId: number +/** + * Specification Field Value Name. + */ +Name: string +/** + * Specification Field Value Description. + */ +Text: string +/** + * Defines if the Specification Field Value is active (`true`) or inactive (`false`). + */ +IsActive: boolean +/** + * Specification Field Position. + */ +Position: number +} +export interface SpecificationsGroup { +/** + * Category ID. + */ +CategoryId: number +/** + * Specification Group ID. + */ +Id: number +/** + * Specification Group Name. + */ +Name: string +/** + * Specification Group Position. + */ +Position: number +} +export interface SpecificationGroupInsertRequest { +/** + * Category ID. + */ +CategoryId: number +/** + * Specification Group Name. + */ +Name: string +} +export interface CreateSellerRequest { +/** + * Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name. + */ +SellerId: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name: string +/** + * Email of the admin responsible for the seller. + */ +Email: string +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions: boolean +/** + * Seller username. + */ +UserName: string +/** + * Seller password. + */ +Password: string +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy: string +/** + * Company registration number. + */ +CNPJ: string +/** + * CSC identification. + */ +CSCIdentification: string +/** + * Seller archive ID. + */ +ArchiveId: number +/** + * Seller URL logo. + */ +UrlLogo: string +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint: string +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId: number +/** + * Seller type. + */ +SellerType: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +TrustPolicy?: string +} +export interface UpdateSellerRequest { +/** + * ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID. + */ +SellerId: string +/** + * Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method. + */ +Name: string +/** + * Email of the admin responsible for the seller. + */ +Email: string +/** + * Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563). + */ +Description: string +/** + * Text describing the exchange and return policy previously agreed between the marketplace and the seller. + */ +ExchangeReturnPolicy: string +/** + * Text describing the delivery policy previously agreed between the marketplace and the seller. + */ +DeliveryPolicy: string +/** + * Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller. + */ +UseHybridPaymentOptions: boolean +/** + * Seller username. + */ +UserName: string +/** + * Seller password. + */ +Password: string +/** + * Text describing the security policy previously agreed between the marketplace and the seller. + */ +SecutityPrivacyPolicy: string +/** + * Company registration number. + */ +CNPJ: string +/** + * CSC identification. + */ +CSCIdentification: string +/** + * Seller archive ID. + */ +ArchiveId: number +/** + * Seller URL logo. + */ +UrlLogo: string +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +ProductCommissionPercentage: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +FreightCommissionPercentage: number +/** + * The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`. + */ +CategoryCommissionPercentage?: string +/** + * URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added. + */ +FulfillmentEndpoint: string +/** + * URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`. + */ +CatalogSystemEndpoint: string +/** + * If the selle is active (`true`) or not (`false`). + */ +IsActive: boolean +/** + * Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more. + */ +MerchantName?: string +/** + * Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank. + */ +FulfillmentSellerId: number +/** + * Seller type. + */ +SellerType: number +/** + * Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI). + */ +IsBetterScope: boolean +/** + * Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`. + */ +TrustPolicy?: string +} +export interface SupplierRequest { +/** + * Supplier Name. + */ +Name: string +/** + * Supplier Corporate Name. + */ +CorporateName: string +/** + * State Inscription. + */ +StateInscription: string +/** + * Corporate legal ID. + */ +Cnpj: string +/** + * Supplier Phone. + */ +Phone: string +/** + * Supplier Cellphone. + */ +CellPhone: string +/** + * Supplier Corporate Phone. + */ +CorportePhone: string +/** + * Supplier email. + */ +Email: string +/** + * Defines if the Supplier is active (`true`) or not (`false`). + */ +IsActive: boolean +} +export interface SupplierResponse { +/** + * Supplier unique identifier code. + */ +Id?: number +/** + * Supplier Name. + */ +Name?: string +/** + * Supplier Corporate Name. + */ +CorporateName?: string +/** + * State Inscription. + */ +StateInscription?: string +/** + * Corporate legal ID. + */ +Cnpj?: string +/** + * Supplier Phone. + */ +Phone?: string +/** + * Supplier Cellphone. + */ +CellPhone?: string +/** + * Supplier Corporate Phone. + */ +CorportePhone?: string +/** + * Supplier email. + */ +Email?: string +/** + * Defines if the Supplier is active (`true`) or not (`false`). + */ +IsActive?: boolean +} +export interface PriceChangeRequest { +/** + * The new price of the item. + */ +price: number +} +export interface SetsinglecustomfieldvalueRequest { +/** + * The value you want to set to the specified field. + */ +value: string +} +export interface UpdateorderFormconfigurationRequest { +paymentConfiguration: PaymentConfiguration +/** + * External tax service configuration. + */ +taxConfiguration: { +/** + * Endpoint URL. + */ +url?: string +/** + * Authorization header. + */ +authorizationHeader?: string +/** + * Custom data ID sent to the tax system. + */ +appId?: string +} +/** + * Minimum SKU quantity by cart. + */ +minimumQuantityAccumulatedForItems: number +/** + * Number of price digits. + */ +decimalDigitsPrecision: number +/** + * Minimum cart value. + */ +minimumValueAccumulated: number +/** + * Array of objects containing Apps configuration information. + */ +apps: { +/** + * App ID. + */ +id?: string +/** + * Array of fields available to the app. + */ +fields?: string[] +/** + * App major version. + */ +major?: number +}[] +/** + * On the same purchase, allows the selection of items from multiple delivery channels. + */ +allowMultipleDeliveries: boolean +/** + * Allows the editing of SKU prices right in the cart. + */ +allowManualPrice: boolean +/** + * Allows the input of a limit of white label sellers involved on the cart. + */ +maxNumberOfWhiteLabelSellers?: number +/** + * Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client doesn't want to share its data. + */ +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. + */ +recaptchaValidation?: string +/** + * Indicates whether authentication is required for completing purchases. + */ +requiresLoginToPlaceOrder?: boolean +/** + * Minimum interval (in seconds) between successive purchases. + */ +minimumPurchaseDowntimeSeconds?: number +/** + * Minimum cart existence period (in seconds) before allowing the use of a new credit card. + */ +cartAgeToUseNewCardSeconds?: number +/** + * If you want to apply a first installment discount to a particular payment system, set this field to that payment system's ID. Learn more: [Configuring a discount for orders prepaid in full](https://help.vtex.com/en/tutorial/configurar-desconto-de-preco-a-vista--7Lfcj9Wb5dpYfA2gKkACIt). + */ +paymentSystemToCheckFirstInstallment?: string +} +/** + * Payment Configuration object + */ +export interface PaymentConfiguration { +/** + * Determines whether pre-authorized payments require authentication + */ +requiresAuthenticationForPreAuthorizedPaymentOption: boolean +/** + * By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installments options configured by every seller will be available. When `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those don't match. Installment values may not be equal in this case. + */ +allowInstallmentsMerge?: boolean +} +export interface WaitingTime { +/** + * Number of days after order cancelation by a seller, during which another seller may be assigned to fulfill the order. + */ +waitingTime: number +} +/** + * Order list object. + */ +export interface Userorderslist { +/** + * List with user's orders details. + */ +list: List1[] +/** + * Array containing facets information. + */ +facets: string[] +paging: Paging +stats: Stats2 +} +export interface List1 { +/** + * Order ID is a unique code that identifies an order. + */ +orderId: string +/** + * Order's creation date. + */ +creationDate: string +/** + * Order's customer name. + */ +clientName: string +/** + * @deprecated + * Information about order's items. + */ +items: Item2[] +/** + * Total value amount. + */ +totalValue: number +/** + * Payment system name. + */ +paymentNames: string +/** + * Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196). + */ +status: string +/** + * @deprecated + * Status description which is displayed on the Admin panel. This field is deprecated and may not return any value. + */ +statusDescription: string +/** + * Marketplace order ID. + */ +marketPlaceOrderId: string +/** + * Six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`. + */ +sequence: string +/** + * Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order. + */ +salesChannel: string +/** + * Corresponds to the three-digits [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order. + */ +affiliateId: 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 +/** + * If there is a work flow error (`true`) or not (`false`). + */ +workflowInErrorState: boolean +/** + * If the order is in a work flow retry (`true`) or not (`false`). + */ +workflowInRetry: boolean +/** + * Last sent transactional message. + */ +lastMessageUnread: string +/** + * Estimate shipping date. + */ +ShippingEstimatedDate: string +/** + * The most extended shipping estimation possible. + */ +ShippingEstimatedDateMax: string +/** + * The least extended shipping estimation possible. + */ +ShippingEstimatedDateMin: string +/** + * If it is a completed order (`true`) or not (`false`). For more information, see [Order flow and status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196). + */ +orderIsComplete: boolean +/** + * Related Gift List ID. + */ +listId: string +/** + * Related Gift list type. + */ +listType: string +/** + * Authorized order date. + */ +authorizedDate: string +/** + * Call center operator responsible for the order. + */ +callCenterOperatorName: string +/** + * Order's total amount of items. + */ +totalItems: number +/** + * Currency code in ISO 4217. For example, `BRL`. + */ +currencyCode: string +minItems?: 0 +} +export interface Item2 { +/** + * Seller related to the order. + */ +seller: string +/** + * Quantity of SKUs. + */ +quantity: number +/** + * Description of items. + */ +description: string +/** + * EAN of the SKU. + */ +ean: string +/** + * Item's reference ID. + */ +refId: string +/** + * Item's SKU ID, which is a unique numerical identifier. + */ +id: string +/** + * ID of the Product associated with the item. + */ +productId: string +/** + * Details on item's selling price. + */ +sellingPrice: number +/** + * Item's price. + */ +price: number +} +/** + * Pagination information. + */ +export interface Paging { +/** + * Total number of orders. + */ +total: number +/** + * Total number of pages. + */ +pages: number +/** + * Number of the current page. + */ +currentPage: number +/** + * Number of orders per page. + */ +perPage: number +} +export interface Stats2 { +stats: Stats3 +} +export interface Stats3 { +totalValue: TotalValue1 +totalItems: TotalItems1 +} +export interface TotalValue1 { +Count: number +Max: number +Mean: number +Min: number +Missing: number +StdDev: number +Sum: number +SumOfSquares: number +Facets: { + +} +} +export interface TotalItems1 { +Count: number +Max: number +Mean: number +Min: number +Missing: number +StdDev: number +Sum: number +SumOfSquares: number +Facets: { + +} +} +/** + * Session information. + */ +export interface GetSessionResponse { +/** + * Session ID. + */ +id?: string +/** + * Object with namespaces, each containing a set of information about the session. + */ +namespaces?: { +/** + * Account information related to the session. + */ +account?: { +/** + * VTEX account ID. + */ +id?: { +/** + * Value of the VTEX account ID. + */ +value?: string +/** + * Determines whether or not the connection should be kept alive. + */ +keepAlive?: boolean +} +/** + * VTEX account name. + */ +accountName?: { +/** + * Value of the VTEX account name. + */ +value?: string +} +} +/** + * Store information related to the session. + */ +store?: { +/** + * [Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID. + */ +channel?: { +/** + * Value of the [Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID. + */ +value?: string +} +/** + * Country code. + */ +countryCode?: { +/** + * Value of the country code. + */ +value?: string +} +/** + * Locale that provides culture-specific information, such as the language, sublanguage, country/region, calendar, and conventions associated with a particular culture. Read [this documentation](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=net-7.0#culture-names-and-identifiers) for more details. + */ +cultureInfo?: { +/** + * Value of the `cultureInfo` property. + */ +value?: string +} +/** + * Currency code. + */ +currencyCode?: { +/** + * Value of the currency code. + */ +value?: string +} +/** + * Currency symbol. + */ +currencySymbol?: { +/** + * Value of the currency symbol. + */ +value?: string +} +/** + * Defines whether or not the channel is private. + */ +channelPrivacy?: { +/** + * Value containing the channel's privacy option. + */ +value?: string +} +} +/** + * Public and editable information related to the session. + */ +public?: { +/** + * Custom property. + */ +[k: string]: { +/** + * Value of the custom property. + */ +value?: string +} +} +/** + * Checkout information related to the session. + */ +checkout?: { +/** + * ID of the session's region. + */ +regionId?: { +/** + * Value of the Region ID. + */ +value?: string +} +} +} +} +/** + * Session information. + */ +export interface CreateEditSessionRequest { +public: Public +} +/** + * Public information. + */ +export interface Public { +/** + * Custom property. + */ +additionalProperties?: { +/** + * Value of the custom property. + */ +value?: string +} +[k: string]: any +} +/** + * Object containing session token and segment token. + */ +export interface CreateEditSessionResponse { +/** + * Token that identifies the user's individual session. + */ +sessionToken?: string +/** + * Token that identifies the user's segment, shared with other users with similar navigation parameters. + */ +segmentToken?: string +} +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 +/** + * @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: Item[] +/** + * 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 which 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's code information. + */ +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 +/** + * Metadata information about the order's items. + */ +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](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) 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 +/** + * If this field is set as `true`, when the customer purchases the item sending the attachment is required, and when set as `false`, sending the attachment is optional. + */ +Required: boolean +/** + * Displays the attachment's content. + */ +InputValues: { + +} +/** + * Displays the attachment's composition. + */ +Composition: { + +} +}[] +}[] +} +/** + * Information about [subscriptions](https://help.vtex.com/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453). + */ +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. The first order will have the value `0`, the second will have the value `1`, and so on. + */ +ExecutionCount: number +/** + * @deprecated + * Price of the order when the customer signed up for subscriptions. Subscriptions created from Admin UI or APIs do not have an original order, so the field returns `0.0`. This field was valid only for Subscriptions v2 and is deprecated in Subscriptions v3. + */ +PriceAtSubscriptionDate: number +/** + * Each item in the subscriptions' order is identified by an index. The position starts in`0`, followed by `1`, `2`, and so on. + */ +ItemIndex: number +/** + * Information about the subscription's validility and frequency. + */ +Plan: { +/** + * Type of plan. + */ +type: string +/** + * Information about subscriptions' recurrence. + */ +frequency: { +/** + * Defines the subscriptions recurrence period. The possible values are `DAILY`,`WEEKLY`, `MONTHLY` and `YEARLY`. + */ +periodicity: string +/** + * Number of the time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the field's value will correspond to days, for `MONTHLY` to months, and so on. + */ +interval: number +} +/** + * Information about the period during which the subscription will be valid. + */ +validity: { +/** + * Subscriptions' beginning date with the format `yyyy-mm-ddThh:mm:ss`. + */ +begin: string +/** + * Subscriptions' ending date with the format `yyyy-mm-ddThh:mm:ss`. + */ +end: string +} +} +}[] +} +/** + * Order's tax information. + */ +taxData: { +/** + * If the taxes were designated by the marketplace (`true`) or not (`false`). + */ +areTaxesDesignatedByMarketplace: boolean +/** + * Array with taxes' details. + */ +taxInfoCollection: { +/** + * Item's indexing number. + */ +itemIndex: number +/** + * Alphanumeric sequence that identifies an SKU. + */ +sku: string +/** + * Price tag information. + */ +priceTags: { +/** + * If the tax is a percentage (`true`) or note (`false`). + */ +isPercentual: boolean +/** + * Name that identifies the tax. + */ +name: string +/** + * The amount that corresponds to the tax. + */ +rawValue: string +}[] +}[] +} +/** + * 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 +/** + * Information about order cancellation, when it applies. + */ +cancellationData: { +/** + * If the order cancellation was requested by the costumer (`true`) or not (`false`). + */ +RequestedByUser: boolean +/** + * If the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example. + */ +RequestedBySystem: boolean +/** + * If the order cancellation was requested by the seller (`true`) or not (`false`). + */ +RequestedBySellerNotification: boolean +/** + * If the order cancellation was requested by the payment gateway (`true`) or not (`false`). + */ +RequestedByPaymentNotification: boolean +/** + * The reason why the order was cancelled. + */ +Reason: string +/** + * The date when the order was cancelled. + */ +CancellationDate: string +} +/** + * Information about customer's preferences. + */ +clientPreferencesData: { +/** + * Customer's prefered language while accessing the store. + */ +locale: string +/** + * When set as `true`, this field indicates customers opted to receive the newsletters, and when set as `false`, it means they did not. + */ +optinNewsLetter: boolean +} +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 +} +export interface Item { +/** + * The SKU ID. + */ +id: string +/** + * The quantity of items of this specific SKU in the cart to be simulated. + */ +quantity: number +/** + * The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin. + */ +seller: string +} +/** + * 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 { +/** + * Packages details. + */ +packages: string[] +} +/** + * 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 modified 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 } diff --git a/vtex/utils/openapi/vcs.openapi.json b/vtex/utils/openapi/vcs.openapi.json index f358b370c..d9b6269ba 100644 --- a/vtex/utils/openapi/vcs.openapi.json +++ b/vtex/utils/openapi/vcs.openapi.json @@ -7,196 +7,19 @@ "version": "1.0" }, "paths": { - "/api/catalog_system/pvt/products/GetProductAndSkuIds": { - "get": { - "tags": [ - "Product" - ], - "summary": "Get Product and SKU IDs", - "description": "Retrieves the IDs of products and SKUs. \r\n> 📘 Onboarding guide \r\n>\r\n> 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.", - "operationId": "ProductAndSkuIds", - "parameters": [ - { - "name": "categoryId", - "in": "query", - "description": "ID of the category from which you need to retrieve Products and SKUs.", - "required": false, - "style": "form", - "explode": true, - "schema": { - "type": "integer", - "format": "int32", - "example": 1 - } - }, - { - "name": "_from", - "in": "query", - "description": "Insert the ID that will start the request result.", - "required": false, - "style": "form", - "explode": true, - "schema": { - "type": "integer", - "format": "int32", - "example": 1 - } - }, - { - "name": "_to", - "in": "query", - "description": "Insert the ID that will end the request result.", - "required": false, - "style": "form", - "explode": true, - "schema": { - "type": "integer", - "format": "int32", - "example": 10 - } - }, - { - "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": "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" - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "example": { - "data": { - "3": [ - 5 - ], - "8": [ - 310118453, - 310118459, - 310118463 - ], - "2": [ - 3, - 310118450, - 310118451, - 4, - 8 - ], - "9": [ - 310118454, - 310118455, - 310118456, - 310118457, - 310118458, - 310118460, - 310118461, - 310118462, - 310118464 - ], - "12": [ - 310118490 - ], - "6": [], - "7": [ - 310118452 - ], - "1": [ - 1, - 123456, - 310118449, - 310118489, - 7, - 2 - ], - "5": [ - 310118465 - ], - "4": [ - 310118448 - ], - "10": [], - "11": [] - }, - "range": { - "total": 12, - "from": 1, - "to": 20 - } - }, - "schema": { - "type": "object", - "properties": { - "data": { - "type": "object", - "description": "Object composed by Product IDs and SKU IDs, where the parent ID is from Products and the SKU IDs are the Child IDs.", - "properties": { - "Product ID": { - "type": "array", - "description": "Array with SKU IDs of a certain product.", - "items": { - "type": "integer", - "description": "Product SKU ID." - } - } - } - }, - "range": { - "type": "object", - "description": "Object with information about the product and SKUs list.", - "properties": { - "total": { - "type": "integer", - "description": "Total quantity of SKUs." - }, - "from": { - "type": "integer", - "description": "Initial product ID." - }, - "to": { - "type": "integer", - "description": "Final product ID." - } - } - } - } - } - } - } - } - } - } - }, - "/api/catalog/pvt/product/{productId}": { + "/api/rnb/pvt/calculatorconfiguration/{idCalculatorConfiguration}": { "get": { "tags": [ - "Product" + "Promotions and taxes" ], - "summary": "Get Product by ID", - "description": "Retrieves a specific Product by its ID. This information is exactly what is needed to create a new Product. \r\n> 📘 Onboarding guide \r\n>\r\n> 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.", - "operationId": "GetProductbyid", + "summary": "Get promotion or tax by ID", + "description": "Retrieves a specific promotion by its Promotion ID or a specific tax by its tax ID.\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| Rates and Benefits | Manage benefits and rates | **GerenciarPromocoesETarifas** |\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": "GetCalculatorConfigurationById", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Describes the type of the content being sent.", + "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -207,7 +30,7 @@ { "name": "Accept", "in": "header", - "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", + "description": "HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.", "required": true, "style": "simple", "schema": { @@ -216,13 +39,14 @@ } }, { - "name": "productId", + "name": "idCalculatorConfiguration", "in": "path", - "description": "Product’s unique numerical identifier.", + "description": "Promotion ID or tax ID.", "required": true, "style": "simple", "schema": { - "type": "string" + "type": "string", + "example": "d8a1cd2e-b667-4054-b3ae-b79124c7218e" } } ], @@ -231,424 +55,874 @@ "description": "OK", "content": { "application/json": { + "example": { + "idCalculatorConfiguration": "d8a1cd2e-b667-4054-b3ae-b79124c7218e", + "name": "Social Seller Promotion", + "beginDateUtc": "2020-05-01T18:47:15.89Z", + "lastModified": "2021-02-23T20:58:38.7963862Z", + "daysAgoOfPurchases": 0, + "isActive": true, + "isArchived": false, + "isFeatured": false, + "disableDeal": false, + "activeDaysOfWeek": [], + "offset": -3, + "activateGiftsMultiplier": false, + "newOffset": -3.0, + "maxPricesPerItems": [], + "cumulative": false, + "discountType": "percentual", + "nominalShippingDiscountValue": 0.0, + "absoluteShippingDiscountValue": 0.0, + "nominalDiscountValue": 0.0, + "nominalDiscountType": "item", + "maximumUnitPriceDiscount": 0.0, + "percentualDiscountValue": 10.0, + "rebatePercentualDiscountValue": 0.0, + "percentualShippingDiscountValue": 0.0, + "percentualTax": 0.0, + "shippingPercentualTax": 0.0, + "percentualDiscountValueList1": 0.0, + "percentualDiscountValueList2": 0.0, + "skusGift": { + "quantitySelectable": 0 + }, + "nominalRewardValue": 0.0, + "percentualRewardValue": 0.0, + "orderStatusRewardValue": "invoiced", + "maxNumberOfAffectedItems": 0, + "maxNumberOfAffectedItemsGroupKey": "perCart", + "applyToAllShippings": false, + "nominalTax": 0.0, + "origin": "marketplace", + "idSellerIsInclusive": false, + "idsSalesChannel": [], + "areSalesChannelIdsExclusive": false, + "marketingTags": [], + "marketingTagsAreNotInclusive": false, + "paymentsMethods": [ + { + "id": "202", + "name": "Dinheiro (202)" + }, + { + "id": "2", + "name": "Visa (2)" + } + ], + "stores": [], + "campaigns": [], + "conditionsIds": [ + "372e1868-2c0e-4437-be45-1ef8c9cab735" + ], + "storesAreInclusive": false, + "categories": [], + "categoriesAreInclusive": false, + "brands": [], + "brandsAreInclusive": false, + "products": [], + "productsAreInclusive": false, + "skus": [], + "skusAreInclusive": true, + "utmSource": "georgeSource", + "utmCampaign": "georgeTest", + "collections1BuyTogether": [], + "collections2BuyTogether": [], + "minimumQuantityBuyTogether": 0, + "quantityToAffectBuyTogether": 0, + "enableBuyTogetherPerSku": false, + "listSku1BuyTogether": [ + { + "id": "2", + "name": "gustaBT" + }, + { + "id": "5", + "name": "exampleSKU" + } + ], + "listSku2BuyTogether": [ + { + "id": "3", + "name": "anotherSKU" + }, + { + "id": "6", + "name": "exampleProduct" + } + ], + "coupon": [], + "totalValueFloor": 0, + "totalValueCeling": 0, + "totalValueIncludeAllItems": false, + "totalValueMode": "IncludeMatchedItems", + "collections": [], + "collectionsIsInclusive": false, + "restrictionsBins": [], + "cardIssuers": [], + "totalValuePurchase": 0, + "slasIds": [], + "isSlaSelected": false, + "isFirstBuy": false, + "firstBuyIsProfileOptimistic": false, + "compareListPriceAndPrice": false, + "isDifferentListPriceAndPrice": false, + "zipCodeRanges": [ + { + "zipCodeFrom": "20000-000", + "zipCodeTo": "20000-100", + "inclusive": true + } + ], + "countries": [ + "BRA" + ], + "itemMaxPrice": 0.0, + "itemMinPrice": 0.0, + "installment": 0, + "isMinMaxInstallments": false, + "minInstallment": 0, + "maxInstallment": 0, + "merchants": [], + "clusterExpressions": [], + "paymentsRules": [], + "giftListTypes": [], + "productsSpecifications": [], + "affiliates": [], + "maxUsage": 0, + "maxUsagePerClient": 0, + "shouldDistributeDiscountAmongMatchedItems": false, + "multipleUsePerClient": false, + "accumulateWithManualPrice": false, + "type": "regular", + "useNewProgressiveAlgorithm": false, + "percentualDiscountValueList": [] + }, "schema": { - "example": { - "Id": 42, - "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", - "DepartmentId": 2000089, - "CategoryId": 2000090, - "BrandId": 12121219, - "LinkId": "stefan-janoski-canvas-varsity-red", - "RefId": "sr_1_90", - "IsVisible": true, - "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", - "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", - "ReleaseDate": "2020-01-01T00:00:00", - "KeyWords": "Zoom,Stefan,Janoski", - "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Re", - "IsActive": true, - "TaxCode": "", - "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", - "SupplierId": 1, - "ShowWithoutStock": true, - "AdWordsRemarketingCode": "", - "LomadeeCampaignCode": "", - "Score": 1 - }, "type": "object", "properties": { - "Id": { - "type": "integer", - "description": "Product’s unique numerical identifier." - }, - "Name": { + "idCalculatorConfiguration": { "type": "string", - "description": "Product's name. Limited to 150 characters." - }, - "DepartmentId": { - "type": "integer", - "description": "Department ID according to the product's category." - }, - "CategoryId": { - "type": "integer", - "description": "Category ID associated with this product." - }, - "BrandId": { - "type": "integer", - "description": "Brand ID associated with this product." + "description": "Promotion ID." }, - "LinkId": { + "name": { "type": "string", - "description": "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 (`-`)." + "description": "Promotion Name." }, - "RefId": { + "description": { "type": "string", - "description": "Product Reference Code." - }, - "IsVisible": { - "type": "boolean", - "description": "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." + "description": "Promotion internal description." }, - "Description": { + "beginDateUtc": { "type": "string", - "description": "Product description." + "description": "Promotion Begin Date (UTC)." }, - "DescriptionShort": { + "endDateUtc": { "type": "string", - "description": "Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``.\r\n" + "description": "Promotion End Date (UTC)." }, - "ReleaseDate": { + "lastModified": { "type": "string", - "description": "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." + "description": "When the Promotion was last modified." }, - "KeyWords": { - "type": "string", - "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n" + "daysAgoOfPurchases": { + "type": "integer", + "description": "Number of days that are considered to add the purchase history." }, - "Title": { - "type": "string", - "description": "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." + "isActive": { + "type": "boolean", + "description": "If set as `true` the Promotion is activated. If set as `false` the Promotion is deactivated." }, - "IsActive": { + "isArchived": { "type": "boolean", - "description": "Activate (`true`) or inactivate (`false`) product." + "description": "If set as `true` the Promotion is archived. If set as `false` the Promotion is not archived." }, - "TaxCode": { - "type": "string", - "description": "Product tax code, used for tax calculation." + "isFeatured": { + "type": "boolean", + "description": "Insert a flag with the promotion name used in the product's window display and page." }, - "MetaTagDescription": { - "type": "string", - "description": "Brief description of the product for SEO. It is recommended not to exceed 150 characters." + "disableDeal": { + "type": "boolean", + "deprecated": true, + "description": "Indicates whether a deal is disabled (`true`) or not (`false`)." }, - "SupplierId": { + "activeDaysOfWeek": { + "type": "array", + "description": "Defines which days of the week the promotion will applied.", + "items": { + "type": "string", + "description": "Day of the week that the promotion will be valid." + } + }, + "offset": { "type": "integer", + "description": "Time offset from UTC in seconds." + }, + "activateGiftsMultiplier": { + "type": "boolean", + "description": "If set as `true`, it activates gifts Multiplier." + }, + "newOffset": { + "type": "number", + "description": "New time offset from UTC in seconds." + }, + "maxPricesPerItems": { + "type": "array", "deprecated": true, - "nullable": true + "description": "List of max price per items.", + "items": { + "type": "string", + "description": "Max price." + } }, - "ShowWithoutStock": { + "cumulative": { "type": "boolean", - "description": "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." + "description": "Defines if a promotion can accumulate with another one. (`true`) or not (`false`)." }, - "AdWordsRemarketingCode": { + "discountType": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "description": "The type of discount that will apply to the promotion." }, - "LomadeeCampaignCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "nominalShippingDiscountValue": { + "type": "number", + "description": "Exact discount to be applied for the shipping value." }, - "Score": { - "type": "integer", - "description": "Value used to set the priority on the search result page.", - "example": 1 - } - } - } - } - } - } - }, - "deprecated": false - }, - "put": { - "tags": [ - "Product" - ], - "summary": "Update Product", - "description": "Updates an existing Product.", - "parameters": [ - { - "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": "productId", - "in": "path", - "required": true, - "description": "Product’s unique numerical identifier.", - "schema": { - "type": "integer", - "example": 1 - } - } - ], - "responses": { - "200": { - "description": "OK", - "content": { - "application/json": { - "schema": { - "example": { - "Id": 42, - "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", - "DepartmentId": 2000089, - "CategoryId": 2000090, - "BrandId": 12121219, - "LinkId": "stefan-janoski-canvas-varsity-red", - "RefId": "sr_1_90", - "IsVisible": true, - "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", - "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", - "ReleaseDate": "2020-01-01T00:00:00", - "KeyWords": "Zoom,Stefan,Janoski", - "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Re", - "IsActive": true, - "TaxCode": "", - "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", - "SupplierId": 1, - "ShowWithoutStock": true, - "AdWordsRemarketingCode": "", - "LomadeeCampaignCode": "", - "Score": 1 - }, - "type": "object", - "properties": { - "Id": { - "type": "integer", - "description": "Product’s unique numerical identifier." + "absoluteShippingDiscountValue": { + "type": "number", + "description": "Maximum value for the shipping." }, - "Name": { + "nominalDiscountValue": { + "type": "number", + "description": "Exact discount to be applied for the total purchase value." + }, + "nominalDiscountType": { "type": "string", - "description": "Product's name. Limited to 150 characters." + "description": "Controls the behavior of the `NominalDiscount` effect. This field only accepts two string values:\n\n -`item`: applies the intended nominal discount on every item present on the cart. \n\n -`cart`: keeps the behavior as it currently is: the whole order/cart receives a nominal discount that is distributed among the items." }, - "DepartmentId": { - "type": "integer", - "description": "Department ID according to the product's category." + "maximumUnitPriceDiscount": { + "type": "number", + "description": "The maximum price for each item of the purchase will be the price set up." }, - "CategoryId": { - "type": "integer", - "description": "Category ID associated with this product." + "percentualDiscountValue": { + "type": "number", + "description": "Percentage discount to be applied for total purchase value." }, - "BrandId": { - "type": "integer", - "description": "Brand ID associated with this product." + "rebatePercentualDiscountValue": { + "type": "number", + "description": "Percentual Shipping Discount Value." }, - "LinkId": { - "type": "string", - "description": "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 (`-`)." + "percentualShippingDiscountValue": { + "type": "number", + "description": "Percentage discount to be applied for shipping value." }, - "RefId": { - "type": "string", - "description": "Product Reference Code." + "percentualTax": { + "type": "number", + "description": "Percentual tax over purchase total value." }, - "IsVisible": { - "type": "boolean", - "description": "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." + "shippingPercentualTax": { + "type": "number", + "description": "Shipping Percentual tax over purchase total value." }, - "Description": { - "type": "string", - "description": "Product description." + "percentualDiscountValueList1": { + "type": "number", + "description": "Valid discounts for the SKUs in `listSku1BuyTogether`, discount list used for Buy Together Promotions." }, - "DescriptionShort": { - "type": "string", - "description": "Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``.\r\n" + "percentualDiscountValueList2": { + "type": "number", + "description": "Equivalent to `percentualDiscountValueList1`." }, - "ReleaseDate": { - "type": "string", - "description": "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." + "skusGift": { + "type": "object", + "description": "SKU Gift Object. Total discount on the product value set as a gift.", + "properties": { + "quantitySelectable": { + "type": "integer", + "description": "Quantity of SKU Gifts." + }, + "gifts": { + "type": "integer", + "description": "Array with SKU Gifts IDs." + } + } }, - "KeyWords": { + "nominalRewardValue": { + "type": "number", + "description": "Nominal value for rewards program." + }, + "percentualRewardValue": { + "type": "number", + "description": "Percentage value for rewards program." + }, + "orderStatusRewardValue": { "type": "string", - "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n" + "description": "Order status reward value." }, - "Title": { + "maxNumberOfAffectedItems": { + "type": "integer", + "description": "The maximum number of affected items for a promotion." + }, + "maxNumberOfAffectedItemsGroupKey": { "type": "string", - "description": "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." + "description": "The maximum number of affected items by group key for a promotion." }, - "IsActive": { + "applyToAllShippings": { "type": "boolean", - "description": "Activate (`true`) or inactivate (`false`) product." + "description": "Promotion will be applied to all kind of shipping." }, - "TaxCode": { + "nominalTax": { + "type": "number", + "description": "Nominal tax." + }, + "origin": { "type": "string", - "description": "Product tax code, used for tax calculation." + "description": "Origin of the promotion, `marketplace` or `Fulfillment`. Read [Difference between orders with marketplace and fulfillment sources](https://help.vtex.com/en/tutorial/what-are-orders-with-marketplace-source-and-orders-with-fulfillment-source--6eVYrmUAwMOeKICU2KuG06) for more information." }, - "MetaTagDescription": { + "idSeller": { "type": "string", - "description": "Brief description of the product for SEO. It's recommended that you don't exceed 150 characters." + "description": "Seller Name." }, - "SupplierId": { - "type": "integer", - "deprecated": true, - "nullable": true + "idSellerIsInclusive": { + "type": "boolean", + "description": "If set to `true`, this promotion will be applied to any seller present on the idSeller field. If set to `false`, sellers present on that field will make this promotion not to be applied." }, - "ShowWithoutStock": { + "idsSalesChannel": { + "type": "array", + "description": "List of Trade Policies that activate this promotion.", + "items": { + "type": "string", + "description": "Trade policy ID." + } + }, + "areSalesChannelIdsExclusive": { "type": "boolean", - "description": "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." + "description": "If set to `false`, this promotion will be applied to any trade policies present on the `idsSalesChannel` field. If set to `true`, trade policies present on that field will make this promotion not to be applied." }, - "AdWordsRemarketingCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "marketingTags": { + "type": "array", + "description": "Promotion Marketing tags.", + "items": { + "type": "string", + "description": "Promotion Marketing tag." + } }, - "LomadeeCampaignCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "marketingTagsAreNotInclusive": { + "type": "boolean", + "description": "If set to `false`, this promotion will be applied to any marketing tag present on the `marketingTags` field. If set to `true`, marketing tags present on that field will make this promotion not to be applied." }, - "Score": { - "type": "integer", - "description": "Value used to set the priority on the search result page." - } - } - } - } - } - } - }, - "requestBody": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "Name", - "CategoryId", - "BrandId" - ], - "properties": { - "Name": { - "type": "string", - "description": "Product's name. Limited to 150 characters.", - "example": "Zoom Stefan Janoski Canvas RM SB Varsity Red" - }, - "DepartmentId": { - "type": "integer", - "description": "Department ID according to the product's category.", - "example": 2000089 - }, - "CategoryId": { - "type": "integer", - "description": "Category ID associated with this product.", - "example": 2000090 - }, - "BrandId": { - "type": "integer", - "description": "Brand ID associated with this product.", - "example": 12121219 - }, - "LinkId": { - "type": "string", - "description": "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 (`-`).", - "example": "stefan-janoski-canvas-varsity-red" - }, - "RefId": { - "type": "string", - "description": "Product Reference Code.", - "example": "sr_1_90" - }, - "IsVisible": { - "type": "boolean", - "description": "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.", - "example": true - }, - "Description": { - "type": "string", - "description": "Product description.", - "example": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction." - }, - "DescriptionShort": { - "type": "string", - "description": "Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``.\r\n", - "example": "The Nike Zoom Stefan Janoski is made with a premium leather." - }, - "ReleaseDate": { - "type": "string", - "description": "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.", - "example": "2019-01-01T00:00:00" - }, - "KeyWords": { - "type": "string", - "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n", - "example": "Zoom,Stefan,Janoski" - }, - "Title": { - "type": "string", - "description": "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.", - "example": "Zoom Stefan Janoski Canvas RM SB Varsity Red" - }, - "IsActive": { - "type": "boolean", - "description": "Activate (`true`) or inactivate (`false`) product.", - "example": true - }, - "TaxCode": { - "type": "string", - "description": "Product tax code, used for tax calculation.", - "example": "12345" - }, - "MetaTagDescription": { - "type": "string", - "description": "Brief description of the product for SEO. It is recommended not to exceed 150 characters.", - "example": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction." - }, - "SupplierId": { - "type": "integer", - "deprecated": true, - "nullable": true - }, - "ShowWithoutStock": { - "type": "boolean", - "description": "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.", - "example": true - }, - "AdWordsRemarketingCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true - }, - "LomadeeCampaignCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true - }, - "Score": { - "type": "integer", - "description": "Value used to set the priority on the search result page.", - "example": 1 + "paymentsMethods": { + "type": "array", + "description": "Array composed by all the Payments Methods.", + "items": { + "type": "object", + "description": "Object with information of the Payment Method.", + "properties": { + "id": { + "type": "string", + "description": "Payment Method ID." + }, + "name": { + "type": "string", + "description": "Payment Method Name." + } + } + } + }, + "stores": { + "type": "array", + "deprecated": true, + "description": "List of stores.", + "items": { + "type": "string", + "description": "Store." + } + }, + "campaigns": { + "type": "array", + "description": "Campaign Audiences that activate this promotion.", + "items": { + "type": "string", + "description": "Campaign audience." + } + }, + "conditionsIds": { + "type": "array", + "description": "Array with conditions IDs.", + "items": { + "type": "string", + "description": "Condition ID." + } + }, + "storesAreInclusive": { + "type": "boolean", + "deprecated": true, + "description": "If set to `true`, this promotion will be applied to any store present on the `stores` field. If set to `false`, stores present on that field will make this promotion not to be applied." + }, + "categories": { + "type": "array", + "description": "Object composed by the categories that will activate or deactivate the promotion.", + "items": { + "type": "object", + "description": "Object with information of the category.", + "properties": { + "id": { + "type": "string", + "description": "Category ID." + }, + "name": { + "type": "string", + "description": "Category Name." + } + } + } + }, + "categoriesAreInclusive": { + "type": "boolean", + "description": "If set to `true`, this promotion will be applied to any category present on the `categories` field. If set to `false`, categories present on that field will make this promotion not to be applied." + }, + "brands": { + "type": "array", + "description": "Object composed by the brands that will activate or deactivate the promotion.", + "items": { + "type": "object", + "description": "Object with information of the brand.", + "properties": { + "id": { + "type": "string", + "description": "Brand ID." + }, + "name": { + "type": "string", + "description": "Brand Name." + } + } + } + }, + "brandsAreInclusive": { + "type": "boolean", + "description": "If set to `true`, this promotion will be applied to any brand present on the `brands` field. If set to `false`, brands present on that field will make this promotion not to be applied." + }, + "products": { + "type": "array", + "description": "Object composed by the products that will activate or deactivate the promotion.", + "items": { + "type": "object", + "description": "Object with information of the product.", + "properties": { + "id": { + "type": "string", + "description": "Product ID." + }, + "name": { + "type": "string", + "description": "Product Name." + } + } + } + }, + "productsAreInclusive": { + "type": "boolean", + "description": "If set to `true`, this promotion will be applied to any product present on the `products` field. If set to `false`, products present on that field will make this promotion not to be applied." + }, + "skus": { + "type": "array", + "description": "Object composed by the SKUs that will activate or deactivate the promotion.", + "items": { + "type": "object", + "required": [ + "id", + "name" + ], + "description": "Object with information of the SKU.", + "properties": { + "id": { + "type": "string", + "description": "SKU ID.", + "nullable": false + }, + "name": { + "type": "string", + "description": "SKU Name.", + "nullable": false + } + } + } + }, + "skusAreInclusive": { + "type": "boolean", + "description": "If set to `true`, this promotion will be applied to any SKU present on the `skus` field. If set to `false`, SKUs present on that field will make this promotion not to be applied." + }, + "utmSource": { + "type": "string", + "description": "Coupon utmSource code." + }, + "utmCampaign": { + "type": "string", + "description": "Coupon utmCampaign code." + }, + "collections1BuyTogether": { + "type": "array", + "description": "Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount**, **Buy One Get One**.", + "items": { + "type": "object", + "description": "Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.", + "properties": { + "id": { + "type": "string", + "description": "ID of the collection to be added to the first list of the **Buy Together** promotion." + }, + "name": { + "type": "string", + "description": "Name of the collection to be added to the first list of the **Buy Together** promotion." + } + } + } + }, + "collections2BuyTogether": { + "type": "array", + "deprecated": true, + "description": "Collections that will generate the promotion, type **Buy Together**, **More for less**, **Progressive Discount** or **Buy One Get One**.", + "items": { + "type": "object", + "description": "Object containing the ID and Name of the collection to be added to the first list of the **Buy Together** promotion.", + "properties": { + "id": { + "type": "string", + "description": "ID of the collection to be added to the first list of the **Buy Together** promotion." + }, + "name": { + "type": "string", + "description": "Name of the collection to be added to the first list of the **Buy Together** promotion." + } + } + } + }, + "minimumQuantityBuyTogether": { + "type": "integer", + "description": "Minimum quantity for **Buy Together** promotion." + }, + "quantityToAffectBuyTogether": { + "type": "integer", + "description": "Quantity to affect **Buy Together** promotion." + }, + "enableBuyTogetherPerSku": { + "type": "boolean", + "description": "Enable **Buy Together** per SKU." + }, + "listSku1BuyTogether": { + "type": "array", + "description": "Array of objects, each containing ID and Name of an SKU to be added in the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.", + "items": { + "type": "object", + "description": "Object containing the ID and Name of the SKU to be added to the first list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.", + "properties": { + "id": { + "type": "string", + "description": "ID of the SKU to be added to the first list of the **Buy Together** promotion." + }, + "name": { + "type": "string", + "description": "Name of the SKU to be added to the first list of the **Buy Together** promotion." + } + } + } + }, + "listSku2BuyTogether": { + "type": "array", + "description": "Array of objects, each containing ID and Name of an SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.", + "items": { + "type": "object", + "description": "Object containing the ID and Name of the SKU to be added to the second list of the **Buy Together** promotion. Learn more about this type of promotion in the [Creating a Buy Together promotion](https://help.vtex.com/en/tutorial/buy-together--tutorials_323) documentation.", + "properties": { + "id": { + "type": "string", + "description": "ID of the SKU to be added to the second list of the **Buy Together** promotion." + }, + "name": { + "type": "string", + "description": "Name of the SKU to be added to the second list of the **Buy Together** promotion." + } + } + } + }, + "coupon": { + "type": "array", + "deprecated": true, + "description": "List of coupons.", + "items": { + "type": "string", + "description": "Coupon code." + } + }, + "totalValueFloor": { + "type": "number", + "description": "Minimum chart value to activate the promotion." + }, + "totalValueCeling": { + "type": "number", + "description": "Maximum chart value to activate the promotion." + }, + "totalValueIncludeAllItems": { + "type": "boolean", + "deprecated": true, + "description": "Total value including all items." + }, + "totalValueMode": { + "type": "string", + "description": "If products that already are receiving a promotion, will be considered on the chart total value. There are three options available: `IncludeMatchedItems`, `ExcludeMatchedItems`, `AllItems`." + }, + "collections": { + "type": "array", + "description": "Array composed by the collections that will be activated or deactivated the promotion.", + "items": { + "type": "object", + "description": "Object with information of the collection.", + "properties": { + "id": { + "type": "string", + "description": "Collection ID." + }, + "name": { + "type": "string", + "description": "Collection Name." + } + } + } + }, + "collectionsIsInclusive": { + "type": "boolean", + "description": "If set to `true`, this promotion will be applied to any collection present on the `collections` field. If set to `false`, collections present on that field will make this promotion not to be applied." + }, + "restrictionsBins": { + "type": "array", + "description": "The discount will be granted if the card's BIN is given.", + "items": { + "type": "string", + "description": "Card's BIN." + } + }, + "cardIssuers": { + "type": "array", + "deprecated": true, + "description": "List of card issuers.", + "items": { + "type": "string", + "description": "Card issuer." + } + }, + "totalValuePurchase": { + "type": "number", + "description": "Total value a client must have in past orders to active the promotion." + }, + "slasIds": { + "type": "array", + "description": "The discount will be granted if the shipping method is the same as the one given.", + "items": { + "type": "string", + "description": "Shipping method." + } + }, + "isSlaSelected": { + "type": "boolean", + "description": "Applies selected discount only when one of the defined shipping method is selected by the customer." + }, + "isFirstBuy": { + "type": "boolean", + "description": "Applies the discount only if it's a first buy." + }, + "firstBuyIsProfileOptimistic": { + "type": "boolean", + "description": "Applies the discount even if the user is not logged." + }, + "compareListPriceAndPrice": { + "type": "boolean", + "description": "If the **List Price** and **Price** are the same." + }, + "isDifferentListPriceAndPrice": { + "type": "boolean", + "description": "Applies the promotion only if the list price and price is different." + }, + "zipCodeRanges": { + "type": "array", + "description": "Range of the zip code that applies the promotion.", + "items": { + "type": "object", + "description": "Object with information of the Zip Code.", + "properties": { + "zipCodeFrom": { + "type": "string", + "description": "Initial Zip Code." + }, + "zipCodeTo": { + "type": "string", + "description": "Final Zip Code." + }, + "inclusive": { + "type": "boolean", + "description": "Defines if the zip code range is included in the promotion." + } + } + } + }, + "countries": { + "type": "array", + "description": "List of countries that are activated for this promotion.", + "items": { + "type": "string", + "description": "Three-digit country code." + } + }, + "itemMaxPrice": { + "type": "number", + "description": "Maximum price of the item." + }, + "itemMinPrice": { + "type": "number", + "description": "Minimum price of the item." + }, + "installment": { + "type": "integer", + "deprecated": true, + "description": "Installment." + }, + "isMinMaxInstallments": { + "type": "boolean", + "description": "Set if the promotion will be applied considering a minimum and maximum values for installments." + }, + "minInstallment": { + "type": "integer", + "description": "Minimum value for installment." + }, + "maxInstallment": { + "type": "integer", + "description": "Maximum value for installment." + }, + "merchants": { + "type": "array", + "deprecated": true, + "description": "List of merchants.", + "items": { + "type": "string", + "description": "Merchant." + } + }, + "clusterExpressions": { + "type": "array", + "description": "Criteria to select a customer cluster. Each item in this array should follow the format of an equality function (`{propertyname}={value}`) or the format of a contains function (`{propertyname} contains {value}`). In both options, `{propertyname}` must be replaced with the name of the field in the data entity, and `{value}` must be replaced with the value determined in Master Data. Find more information about these criteria in [Filling in the Customer cluster field](https://help.vtex.com/tutorial/creating-promotion-for-a-customer-cluster--tutorials_342#filling-in-the-customer-cluster-field).", + "items": { + "type": "string", + "description": "Cluster expression." + } + }, + "multipleSkusCause": { + "type": "object", + "description": "Object composed by a list of SKUs on a Multiple Effects promotion. Structure: `\"{SkuId}\": {PercentageDiscount}`. There is a limit of 400 SKUs for this type of promotion.", + "additionalProperties": { + "type": "string", + "description": "SKU ID." + } + }, + "paymentsRules": { + "type": "array", + "deprecated": true, + "description": "List of payment rules.", + "items": { + "type": "string", + "description": "Payment rule." + } + }, + "giftListTypes": { + "type": "array", + "description": "Gifts List Type.", + "items": { + "type": "string", + "description": "Gift List Type." + } + }, + "productsSpecifications": { + "type": "array", + "deprecated": true, + "description": "List of product specifications.", + "items": { + "type": "string", + "description": "Product specification." + } + }, + "affiliates": { + "type": "array", + "description": "Marketplace order identifier. The discount will apply to selected affiliates.", + "items": { + "type": "object", + "description": "Object with information of the affiliate.", + "properties": { + "id": { + "type": "string", + "description": "Affiliate ID." + }, + "name": { + "type": "string", + "description": "Affiliate Name." + } + } + } + }, + "maxUsage": { + "type": "integer", + "description": "Defines how many times the promotion can be used." + }, + "maxUsagePerClient": { + "type": "integer", + "description": "Defines if the promotion can be used multiple times per client." + }, + "shouldDistributeDiscountAmongMatchedItems": { + "type": "boolean", + "description": "Should distribute discount among matched items." + }, + "multipleUsePerClient": { + "type": "boolean", + "description": "Defines if the promotion can be used multiple times per client." + }, + "accumulateWithManualPrice": { + "type": "boolean", + "description": "Allows the promotion to apply to products whose prices have been manually added by a call center operator." + }, + "type": { + "type": "string", + "description": "Defines what is the type of the promotion or indicates if it is a tax. Possible values: `regular` ([Regular Promotion](https://help.vtex.com/tutorial/regular-promotion--tutorials_327)), `combo` ([Buy Together](https://help.vtex.com/en/tutorial/buy-together--tutorials_323)), `forThePriceOf` ([More for Less](https://help.vtex.com/en/tutorial/creating-a-more-for-less-promotion--tutorials_325)), `progressive` ([Progressive Discount](https://help.vtex.com/en/tutorial/progressive-discount--tutorials_324)), `buyAndWin` ([Buy One Get One](https://help.vtex.com/en/tutorial/buy-one-get-one--tutorials_322)), `maxPricePerItem` (Deprecated), `campaign` ([Campaign Promotion](https://help.vtex.com/en/tutorial/campaign-promotion--1ChYXhK2AQGuS6wAqS8Ume)), `tax` (Tax), `multipleEffects` (Multiple Effects)." + }, + "useNewProgressiveAlgorithm": { + "type": "boolean", + "description": "Use new progressive algorithm." + }, + "percentualDiscountValueList": { + "type": "array", + "description": "Percentual discount value list.", + "items": { + "type": "number", + "description": "Percentual discount value." + } + } } } } } } - } + }, + "deprecated": false } }, - "/api/catalog_system/pvt/products/productget/{productId}": { + "/api/dataentities/{acronym}/search": { "get": { "tags": [ - "Product" + "Search" ], - "summary": "Get Product and its general context", - "description": "Retrieves a specific product's general information as name, description and the trade policies that it is included.", - "operationId": "ProductandTradePolicy", + "summary": "Search documents", + "description": "Searches Master Data v1 documents with highly customizable filters.\r\n\r\n> Learn more about [Master Data v1 search queries](https://developers.vtex.com/vtex-rest-api/docs/how-the-queries-in-master-data-v1-work).\r\n\r\n## Query Examples\r\n\r\n\r\n### Simple filter\r\n\r\n```\r\n/dataentities/CL/search?email=my@email.com\r\n```\r\n\r\n### Complex filter\r\n\r\n```\r\n/dataentities/CL/search?_where=(firstName=Jon OR lastName=Smith) OR (createdIn between 2001-01-01 AND 2016-01-01)\r\n```\r\n\r\n### Filter by range\r\n\r\n#### Date Range\r\n\r\n```\r\n/dataentities/CL/search?_where=createdIn between 2001-01-01 AND 2016-01-01\r\n```\r\n\r\n#### Range numeric fields\r\n\r\n```\r\n/dataentities/CL/search?_where=age between 18 AND 25\r\n```\r\n\r\n### Partial filter\r\n\r\n```\r\n/dataentities/CL/search?firstName=*Maria*\r\n```\r\n\r\n### Filter for null values\r\n\r\n```\r\n/dataentities/CL/search?_where=firstName is null\r\n```\r\n\r\n### Filter for non-null values\r\n\r\n```\r\n/dataentities/CL/search?_where=firstName is not null\r\n```\r\n\r\n### Filter for difference\r\n```\r\n/dataentities/CL/search?_where=firstName<>maria\r\n```\r\n\r\n### Filter greater than or less than\r\n```\r\n/dataentities/CL/search?_where=number>5\r\n/dataentities/CL/search?_where=date<2001-01-01\r\n```\n\r\n\r> 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`. \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": "Searchdocuments", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Describes the type of the content being sent.", + "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -668,14 +942,55 @@ } }, { - "name": "productId", - "in": "path", - "description": "Product’s unique numerical identifier.", + "name": "REST-Range", + "in": "header", + "description": "Defines the collection of documents to be returned. A range within the collection limited by 100 documents per query.", "required": true, "style": "simple", "schema": { - "type": "integer", - "example": 1 + "type": "string", + "example": "resources=0-10" + } + }, + { + "name": "acronym", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + }, + { + "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" + } + }, + { + "name": "_where", + "in": "query", + "description": "Specification of filters.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "firstName is not null" + } + }, + { + "name": "_sort", + "in": "query", + "description": "Inform a field name plus `ASC` to sort results by this field value in ascending order or `DESC` to sort by descending order.", + "required": false, + "style": "form", + "schema": { + "type": "string", + "example": "firstName ASC" } } ], @@ -684,169 +999,66 @@ "description": "OK", "content": { "application/json": { - "example": { - "Id": 1, - "Name": "Ração Royal Canin Feline Urinary", - "DepartmentId": 1, - "CategoryId": 10, - "BrandId": 2000000, - "LinkId": "racao-royal-canin-feline-urinary", - "RefId": "", - "IsVisible": true, - "Description": "Descrição.", - "DescriptionShort": "", - "ReleaseDate": "2020-01-06T00:00:00", - "KeyWords": "bbbbbbbbbbbb*, a@", - "Title": "Ração Royal Canin Feline Urinary", - "IsActive": true, - "TaxCode": "", - "MetaTagDescription": "Descrição.", - "SupplierId": 1, - "ShowWithoutStock": true, - "ListStoreId": [ - 1, - 2, - 3 - ], - "AdWordsRemarketingCode": "", - "LomadeeCampaignCode": "" - }, "schema": { - "type": "object", - "properties": { - "Id": { - "type": "integer", - "description": "Product ID.", - "example": 1 - }, - "Name": { - "type": "string", - "description": "Product's name. Limited to 150 characters.", - "example": "Ração Royal Canin Feline Urinary" - }, - "DepartmentId": { - "type": "integer", - "description": "Product department ID.", - "example": 1 - }, - "CategoryId": { - "type": "integer", - "description": "Product category ID.", - "example": 10 - }, - "BrandId": { - "type": "integer", - "description": "Product brand ID.", - "example": 2000000 - }, - "LinkId": { - "type": "string", - "description": "Product text link.", - "example": "racao-royal-canin-feline-urinary" - }, - "RefId": { - "type": "string", - "description": "Product referecial code.", - "example": "" - }, - "IsVisible": { - "type": "boolean", - "description": "If the Product is visible on the store.", - "example": true - }, - "Description": { - "type": "string", - "description": "Product description.", - "example": "Description" - }, - "DescriptionShort": { - "type": "string", - "description": "Product complement name.", - "example": "" - }, - "ReleaseDate": { - "type": "string", - "description": "Product release date.", - "example": "2020-01-06T00:00:00" - }, - "KeyWords": { - "type": "string", - "description": "Substitutes words for the product.", - "example": "ração, racao, animal" - }, - "Title": { - "type": "string", - "description": "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.", - "example": "Ração Royal Canin Feline Urinary" - }, - "IsActive": { - "type": "boolean", - "description": "If the product is active (`true`) or not (`false`) at the store.", - "example": true - }, - "TaxCode": { - "type": "string", - "description": "Product fiscal code.", - "example": "" - }, - "MetaTagDescription": { - "type": "string", - "description": "Product meta tag description.", - "example": "Description" - }, - "SupplierId": { - "type": "integer", - "description": "Product supplier ID.", - "example": 1 - }, - "ShowWithoutStock": { - "type": "boolean", - "description": "Defines if the Product will remain being shown in the store even if it’s out of stock.", - "example": true - }, - "ListStoreId": { - "type": "array", - "description": "List with the Trade Policies IDs that the product is included.", - "items": { - "type": "integer", - "description": "Trade Policy ID." + "type": "array", + "description": "List of documents.", + "items": { + "type": "object", + "description": "Object representing each document.", + "properties": { + "additionalProperties": { + "type": "string", + "description": "Custom properties." }, - "example": [ - 1, - 2 - ] - }, - "AdWordsRemarketingCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true - }, - "LomadeeCampaignCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "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." + } } } - } + }, + "example": [ + { + "id": "2f5dde81-1613-11ea-82ee-12f868feb457", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + }, + { + "id": "3b3a3fc9-164b-11ea-82ee-121449f60ecb", + "accountId": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "accountName": "apiexamples", + "dataEntityId": "AS" + } + ] } } + }, + "503": { + "description": "Service Unavailable. Wildcard queries temporarily blocked due to excessive usage. Consider adjusting your code to remove them or reduce the rate of search requests with wildcards (*). This temporary block may also be due to excessive use of requests with the parameter `keyword`." } } } }, - "/api/catalog_system/pvt/products/productgetbyrefid/{refId}": { + "/api/logistics/pvt/inventory/skus/{skuId}": { "get": { - "tags": [ - "Product" - ], - "summary": "Get Product by RefId", - "description": "Retrieves a specific product by its Reference ID.", - "operationId": "ProductbyRefId", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Describes the type of the content being sent.", + "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -866,11 +1078,9 @@ } }, { - "name": "refId", + "name": "skuId", "in": "path", - "description": "Product Referecial Code", "required": true, - "style": "simple", "schema": { "type": "string" } @@ -881,146 +1091,92 @@ "description": "OK", "content": { "application/json": { - "example": { - "Id": 17, - "Name": "BLACK+DECKER 20V MAX Cordless Drill / Driver with 30-Piece Accessories (LD120VA)", - "DepartmentId": 9287, - "CategoryId": 9287, - "BrandId": 9280, - "LinkId": "black-decker-20v-max-cordless-drill-driver-with-30-piece-acessories-ld120va", - "RefId": "880010", - "IsVisible": true, - "Description": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", - "DescriptionShort": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", - "ReleaseDate": "2020-01-01T00:00:00", - "KeyWords": "product,sample", - "Title": "BLACK+DECKER 20V MAX Cordless Drill / Driver with 30-Piece Accessories (LD120VA)", - "IsActive": true, - "TaxCode": "", - "MetaTagDescription": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", - "SupplierId": 1, - "ShowWithoutStock": true, - "ListStoreId": [ - 1 - ], - "AdWordsRemarketingCode": "", - "LomadeeCampaignCode": "" - }, "schema": { "type": "object", "properties": { - "Id": { - "type": "integer", - "description": "ID of the Product." - }, - "Name": { - "type": "string", - "description": "Name of the Product." - }, - "DepartmentId": { - "type": "integer", - "description": "ID of product department." - }, - "CategoryId": { - "type": "integer", - "description": "ID of product Category." - }, - "BrandId": { - "type": "integer", - "description": "ID of the product Brand." - }, - "LinkId": { - "type": "string", - "description": "Category URL." - }, - "RefId": { - "type": "string", - "description": "Product Reference ID." - }, - "IsVisible": { - "type": "boolean", - "description": "If the product are visible in search and list pages." - }, - "Description": { - "type": "string", - "description": "Product Description, HTML is allowed." - }, - "DescriptionShort": { - "type": "string", - "description": "Product Short Description." - }, - "ReleaseDate": { - "type": "string", - "description": "Product Release Date, for list ordering and product cluster highlight." - }, - "KeyWords": { - "type": "string", - "description": "Alternatives Keywords to improve the product findability." - }, - "Title": { - "type": "string", - "description": "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." - }, - "IsActive": { - "type": "boolean", - "description": "If the product is Active." - }, - "TaxCode": { - "type": "string", - "description": "SKU Tax Code." - }, - "MetaTagDescription": { + "skuId": { "type": "string", - "description": "Meta Description for the Product page." - }, - "SupplierId": { - "type": "integer", - "description": "Product Supplier ID." - }, - "ShowWithoutStock": { - "type": "boolean", - "description": "If the product can be visible without stock." + "description": "Unique identifier of the SKU." }, - "ListStoreId": { + "balance": { "type": "array", - "description": "Array with the ID of all the trade policies that are related to the product.", + "description": "List of warehouses.", "items": { - "type": "integer", - "description": "Trade policy ID." + "type": "object", + "description": "Object representing each document.", + "properties": { + "hasUnlimitedQuantity": { + "type": "boolean" + }, + "leadTime": { + "type": "string" + }, + "reservedQuantity": { + "type": "integer" + }, + "totalQuantity": { + "type": "integer" + }, + "warehouseId": { + "type": "string", + "description": "Warehouse ID." + }, + "warehouseName": { + "type": "string", + "description": "Warehouse name." + } + } } - }, - "AdWordsRemarketingCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true - }, - "LomadeeCampaignCode": { - "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true } } + }, + "example": { + "skuId": "44", + "balance": [ + { + "warehouseId": "1_1", + "warehouseName": "Inventário principal", + "totalQuantity": 1000000, + "reservedQuantity": 0, + "hasUnlimitedQuantity": true, + "timeToRefill": null, + "dateOfSupplyUtc": null, + "leadTime": "00:00:00" + }, + { + "warehouseId": "11c479c", + "warehouseName": "Estoque Virtual 11 dias uteis", + "totalQuantity": 0, + "reservedQuantity": 0, + "hasUnlimitedQuantity": false, + "timeToRefill": null, + "dateOfSupplyUtc": null, + "leadTime": "00:00:00" + } + ] } } } + }, + "503": { + "description": "Service Unavailable. Wildcard queries temporarily blocked due to excessive usage. Consider adjusting your code to remove them or reduce the rate of search requests with wildcards (*). This temporary block may also be due to excessive use of requests with the parameter `keyword`." } - }, - "deprecated": false + } } }, - "/api/catalog_system/pub/products/variations/{productId}": { + "/api/logistics/pvt/configuration/pickuppoints": { "get": { "tags": [ - "Product" + "Pickup points" ], - "summary": "Get Product's SKUs by Product ID", - "description": "Retrieves data about the product and all SKUs related to it by the product's ID.\r\n## Response body example\r\n\r\n```json\r\n{\r\n \"productId\": 9,\r\n \"name\": \"Camisa Masculina\",\r\n \"salesChannel\": \"2\",\r\n \"available\": true,\r\n \"displayMode\": \"lista\",\r\n \"dimensions\": [\r\n \"Cores\",\r\n \"Tamanho\",\r\n \"Pa\u00EDs de origem\",\r\n \"G\u00EAnero\"\r\n ],\r\n \"dimensionsInputType\": {\r\n \"Cores\": \"Combo\",\r\n \"Tamanho\": \"Combo\",\r\n \"Pa\u00EDs de origem\": \"Combo\",\r\n \"G\u00EAnero\": \"Combo\"\r\n },\r\n \"dimensionsMap\": {\r\n \"Cores\": [\r\n \"Amarelo\",\r\n \"Azul\",\r\n \"Vermelho\"\r\n ],\r\n \"Tamanho\": [\r\n \"P\",\r\n \"M\",\r\n \"G\"\r\n ],\r\n \"Pa\u00EDs de origem\": [\r\n \"Brasil\"\r\n ],\r\n \"G\u00EAnero\": [\r\n \"Masculino\"\r\n ]\r\n },\r\n \"skus\": [\r\n {\r\n \"sku\": 310118454,\r\n \"skuname\": \"Amarela - G\",\r\n \"dimensions\": {\r\n \"Cores\": \"Amarelo\",\r\n \"Tamanho\": \"G\",\r\n \"Pa\u00EDs de origem\": \"Brasil\",\r\n \"G\u00EAnero\": \"Masculino\"\r\n },\r\n \"available\": false,\r\n \"availablequantity\": 0,\r\n \"cacheVersionUsedToCallCheckout\": null,\r\n \"listPriceFormated\": \"R$ 0,00\",\r\n \"listPrice\": 0,\r\n \"taxFormated\": \"R$ 0,00\",\r\n \"taxAsInt\": 0,\r\n \"bestPriceFormated\": \"R$ 9.999.876,00\",\r\n \"bestPrice\": 999987600,\r\n \"spotPrice\": 999987600,\r\n \"installments\": 0,\r\n \"installmentsValue\": 0,\r\n \"installmentsInsterestRate\": null,\r\n \"image\": \"https:\/\/lojadobreno.vteximg.com.br\/arquivos\/ids\/155467-292-292\/image-5d7ad76ad1954c53adecab4138319034.jpg?v=637321899584500000\",\r\n \"sellerId\": \"1\",\r\n \"seller\": \"lojadobreno\",\r\n \"measures\": {\r\n \"cubicweight\": 1.0000,\r\n \"height\": 5.0000,\r\n \"length\": 20.0000,\r\n \"weight\": 200.0000,\r\n \"width\": 20.0000\r\n },\r\n \"unitMultiplier\": 1.0000,\r\n \"rewardValue\": 0\r\n },\r\n {\r\n \"sku\": 310118455,\r\n \"skuname\": \"Vermelha - M\",\r\n \"dimensions\": {\r\n \"Cores\": \"Vermelho\",\r\n \"Tamanho\": \"M\",\r\n \"Pa\u00EDs de origem\": \"Brasil\",\r\n \"G\u00EAnero\": \"Masculino\"\r\n },\r\n \"available\": true,\r\n \"availablequantity\": 99999,\r\n \"cacheVersionUsedToCallCheckout\": \"38395F1AEF59DF5CEAEDE472328145CD_\",\r\n \"listPriceFormated\": \"R$ 0,00\",\r\n \"listPrice\": 0,\r\n \"taxFormated\": \"R$ 0,00\",\r\n \"taxAsInt\": 0,\r\n \"bestPriceFormated\": \"R$ 20,00\",\r\n \"bestPrice\": 2000,\r\n \"spotPrice\": 2000,\r\n \"installments\": 1,\r\n \"installmentsValue\": 2000,\r\n \"installmentsInsterestRate\": 0,\r\n \"image\": \"https:\/\/lojadobreno.vteximg.com.br\/arquivos\/ids\/155468-292-292\/image-601a6099aace48b89d26fc9f22e8e611.jpg?v=637321906602470000\",\r\n \"sellerId\": \"pedrostore\",\r\n \"seller\": \"pedrostore\",\r\n \"measures\": {\r\n \"cubicweight\": 0.4167,\r\n \"height\": 5.0000,\r\n \"length\": 20.0000,\r\n \"weight\": 200.0000,\r\n \"width\": 20.0000\r\n },\r\n \"unitMultiplier\": 1.0000,\r\n \"rewardValue\": 0\r\n }\r\n ]\r\n}\r\n```", - "operationId": "ProductVariations", + "summary": "List pickup points", + "description": "Retrieves information about [pickup points](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) of your store.\r\n\r\n>⚠️ 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.", + "operationId": "ListAllPickupPpoints", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Describes the type of the content being sent.", + "description": "Type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -1031,24 +1187,13 @@ { "name": "Accept", "in": "header", - "description": "HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.", + "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": "productId", - "in": "path", - "description": "Product’s unique numerical identifier.", - "required": true, - "style": "simple", - "schema": { - "type": "integer", - "example": 1 - } } ], "responses": { @@ -1057,300 +1202,221 @@ "content": { "application/json": { "schema": { - "example": { - "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" - ] + "type": "array", + "description": "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.", + "items": { + "$ref": "#/components/schemas/PickupPoint" + } + }, + "example": [ + { + "id": "b8e7ca56", + "name": "Pickup Shopping Center", + "description": "Shopping Center from Barra", + "instructions": "You have to present a document to collect your package", + "formatted_address": "undefined", + "address": { + "postalCode": "22250040", + "country": { + "acronym": "BRA", + "name": "Brazil" + }, + "city": "Rio de Janeiro", + "state": "RJ", + "neighborhood": "Botafogo", + "street": "Botafogo beach", + "number": "300", + "complement": "Shopping Center", + "reference": "Third floor", + "location": { + "latitude": -22.906847, + "longitude": -43.172897 + } }, - "skus": [ + "isActive": true, + "distance": 0, + "seller": "Fashion Skirts", + "_sort": [ + 1574240390000 + ], + "businessHours": [ { - "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 + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" }, { - "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 + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "18:00:00" } - ] + ], + "tagsLabel": [ + "w67", + "p34" + ], + "pickupHolidays": [ + { + "date": "2024-12-28T03:00:00Z", + "hourBegin": "09:00", + "hourEnd": "13:00" + }, + { + "date": "2024-11-17T03:00:00Z", + "hourBegin": "00:00", + "hourEnd": "00:00" + } + ], + "isThirdPartyPickup": false, + "accountOwnerName": "Fashion Store", + "accountOwnerId": "1b4018ec-48bf-4a59-9eae-547403e11afc", + "parentAccountName": "Fashion Store", + "originalId": null }, - "type": "object", - "description": "Response body.", - "properties": { - "productId": { - "type": "integer", - "description": "Product’s unique numerical identifier." - }, - "name": { - "type": "string", - "description": "Product name." - }, - "salesChannel": { - "type": "string", - "description": "Trade policy ID." - }, - "available": { - "type": "boolean", - "description": "Defines if the product is available (`true`) or not (`false`)." - }, - "displayMode": { - "type": "string", - "description": "Defines the mannner SKUs are displayed." - }, - "dimensions": { - "type": "array", - "description": "Lists SKU specifications.", - "items": { - "type": "string", - "description": "Name of the SKU specification." + { + "id": "792893547449051", + "name": "Bleu PUP", + "description": "Bleu Store", + "instructions": "You must present a document to collect your order", + "formatted_address": "undefined", + "address": { + "postalCode": "18550-000", + "country": { + "acronym": "BRA", + "name": "Brasil" + }, + "city": "Boituva", + "state": "SP", + "neighborhood": "Tancredo Neves", + "street": "BTV-250", + "number": "01", + "complement": "Second floor", + "reference": "Next to the city hall", + "location": { + "latitude": -23.2863329, + "longitude": -47.6783742 } }, - "dimensionsInputType": { - "type": "object", - "description": "Lists SKU specifications and their field type, in the following format: `\"{specificationName}\":\"{fieldType}\"`.", - "additionalProperties": { - "type": "string" + "isActive": true, + "distance": 1574240387072, + "seller": "Recurrency", + "_sort": [ + 1574240390000 + ], + "businessHours": [ + { + "dayOfWeek": 1, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 2, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 3, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 4, + "openingTime": "09:00:00", + "closingTime": "18:00:00" + }, + { + "dayOfWeek": 5, + "openingTime": "09:00:00", + "closingTime": "18:00:00" } - }, - "dimensionsMap": { - "type": "object", - "description": "Lists SKU specifications and their possible values inside arrays.", - "additionalProperties": { - "type": "array", - "items": {} + ], + "tagsLabel": [ + "kr47", + "yk15" + ], + "pickupHolidays": [ + { + "date": "2024-12-28T03:00:00Z", + "hourBegin": "09:00", + "hourEnd": "13:00" } - }, - "skus": { - "type": "array", - "description": "Array containing information about the product's SKUs.", - "items": { - "type": "object", - "description": "Object containing information about a specific SKU.", - "properties": { - "sku": { - "type": "integer", - "description": "SKU ID." - }, - "skuname": { - "type": "string", - "description": "SKU Name." - }, - "dimensions": { - "type": "object", - "description": "Lists SKU specifications and their respective values.", - "additionalProperties": { - "type": "string" - } - }, - "available": { - "type": "boolean", - "description": "Defines if the SKU is available (`true`) or not (`false`)." - }, - "availablequantity": { - "type": "integer", - "description": "Available quantity of the SKU in stock." - }, - "cacheVersionUsedToCallCheckout": { - "type": "string", - "description": "Cache version used to call Checkout.", - "nullable": true - }, - "listPriceFormated": { - "type": "string", - "description": "List price formatted according to the valid currency." - }, - "listPrice": { - "type": "integer", - "description": "List price." - }, - "taxFormated": { - "type": "string", - "description": "Tax value formatted according to the valid currency." - }, - "taxAsInt": { - "type": "integer", - "description": "Tax value." - }, - "bestPriceFormated": { - "type": "string", - "description": "Best price formatted according to the valid currency." - }, - "bestPrice": { - "type": "integer", - "description": "Best price." - }, - "spotPrice": { - "type": "integer", - "description": "Spot price." - }, - "installments": { - "type": "integer", - "description": "Number of installments." - }, - "installmentsValue": { - "type": "integer", - "description": "Value of installments." - }, - "installmentsInsterestRate": { - "type": "integer", - "description": "Interest rate of installments.", - "nullable": true - }, - "image": { - "type": "string", - "description": "SKU image URL." - }, - "sellerId": { - "type": "string", - "description": "Seller ID." - }, - "measures": { - "type": "object", - "description": "SKU measures.", - "properties": { - "cubicweight": { - "type": "number", - "description": "Cubic weight." - }, - "height": { - "type": "number", - "description": "Height." - }, - "length": { - "type": "number", - "description": "Length." - }, - "weight": { - "type": "number", - "description": "Weight." - }, - "width": { - "type": "number", - "description": "Width." - } - } - }, - "unitMultiplier": { - "type": "number", - "description": "SKU Unit Multiplier." - }, - "rewardValue": { - "type": "integer", - "description": "SKU reward value for rewards program." - } - } - } - } + ], + "isThirdPartyPickup": false, + "accountOwnerName": "sportsstore", + "accountOwnerId": "9ddcfba5-3855-49ec-b61e-b2847b9314cc", + "parentAccountName": "sportsstore", + "originalId": "b8e7ca56" } - } + ] } } } - }, - "deprecated": false + } } }, - "/api/addon/pvt/review/GetProductRate/{productId}": { + "/api/catalog_system/pvt/products/GetProductAndSkuIds": { "get": { "tags": [ "Product" ], - "summary": "Get Product Review Rate by Product ID", - "description": "Retrieves the review rate of a product by this product's ID.", - "operationId": "ReviewRateProduct", + "summary": "Get Product and SKU IDs", + "description": "Retrieves the IDs of products and SKUs. \r\n> 📘 Onboarding guide \r\n>\r\n> 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.", + "operationId": "ProductAndSkuIds", "parameters": [ + { + "name": "categoryId", + "in": "query", + "description": "ID of the category from which you need to retrieve Products and SKUs.", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "integer", + "format": "int32", + "example": 1 + } + }, + { + "name": "_from", + "in": "query", + "description": "Insert the ID that will start the request result.", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "integer", + "format": "int32", + "example": 1 + } + }, + { + "name": "_to", + "in": "query", + "description": "Insert the ID that will end the request result.", + "required": false, + "style": "form", + "explode": true, + "schema": { + "type": "integer", + "format": "int32", + "example": 10 + } + }, { "name": "Content-Type", "in": "header", @@ -1372,18 +1438,254 @@ "type": "string", "default": "application/json" } - }, + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "example": { + "data": { + "3": [ + 5 + ], + "8": [ + 310118453, + 310118459, + 310118463 + ], + "2": [ + 3, + 310118450, + 310118451, + 4, + 8 + ], + "9": [ + 310118454, + 310118455, + 310118456, + 310118457, + 310118458, + 310118460, + 310118461, + 310118462, + 310118464 + ], + "12": [ + 310118490 + ], + "6": [], + "7": [ + 310118452 + ], + "1": [ + 1, + 123456, + 310118449, + 310118489, + 7, + 2 + ], + "5": [ + 310118465 + ], + "4": [ + 310118448 + ], + "10": [], + "11": [] + }, + "range": { + "total": 12, + "from": 1, + "to": 20 + } + }, + "schema": { + "type": "object", + "properties": { + "data": { + "type": "object", + "description": "Object composed by Product IDs and SKU IDs, where the parent ID is from Products and the SKU IDs are the Child IDs.", + "properties": { + "Product ID": { + "type": "array", + "description": "Array with SKU IDs of a certain product.", + "items": { + "type": "integer", + "description": "Product SKU ID." + } + } + } + }, + "range": { + "type": "object", + "description": "Object with information about the product and SKUs list.", + "properties": { + "total": { + "type": "integer", + "description": "Total quantity of SKUs." + }, + "from": { + "type": "integer", + "description": "Initial product ID." + }, + "to": { + "type": "integer", + "description": "Final product ID." + } + } + } + } + } + } + } + } + } + } + }, + "/api/dataentities/{acronym}/documents": { + "post": { + "summary": "Create a new document", + "parameters": [ { - "name": "productId", "in": "path", - "description": "Product’s unique numerical identifier.", + "name": "acronym", "required": true, - "style": "simple", "schema": { - "type": "integer", - "example": 1 + "type": "string" + } + } + ], + "requestBody": { + "required": true, + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "anyProperty": { + "type": "string" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "Document created successfully", + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "Id": { + "type": "string" + }, + "Href": { + "type": "string" + }, + "DocumentId": { + "type": "string" + } + } + } + } + } + } + } + }, + "patch": { + "tags": [ + "Documents" + ], + "summary": "Create partial document", + "description": "Creates a partial document, sending only some of the fields.\r\n\r\n> 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. \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": "Createorupdatepartialdocument", + "parameters": [ + { + "$ref": "#/components/parameters/Content-Type" + }, + { + "$ref": "#/components/parameters/Accept" + }, + { + "$ref": "#/components/parameters/acronym" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "additionalProperties": true, + "properties": { + "id": { + "type": "string", + "description": "Unique identifier of the document to be created.", + "example": "4e4c55ac-e491-11e6-94f4-0ac138d2d42e" + }, + "{fieldName}": { + "type": "string", + "description": "Field(s) to be filled in and its respective value(s).", + "example": "{fieldValue}" + } + } + }, + "example": { + "id": "4e4c55ac-e491-11e6-94f4-0ac138d2d42e", + "addressName": "4726026151251" + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/IdHrefDocumentID" + }, + "example": { + "Id": "CL-be30ed0b-78ec-11ee-83ab-0eca8d1868e1", + "Href": "http://apiexamples.vtexcommercestable.com.br/api/dataentities/CL/documents/be30ed0b-78ec-11ee-83ab-0eca8d1868e1", + "DocumentId": "be30ed0b-78ec-11ee-83ab-0eca8d1868e1" + } + } } } + } + } + }, + "/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": { @@ -1391,29 +1693,186 @@ "content": { "application/json": { "schema": { - "example": 3.0, - "type": "number", - "description": "Review rate numeber." + "$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 }, - "deprecated": false + "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/catalog/pvt/product": { - "post": { + "/api/catalog/pvt/product/{productId}": { + "get": { "tags": [ "Product" ], - "summary": "Create Product with Category and Brand", - "description": "This endpoint allows two types of request:\r\n\r\n**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.\r\n\r\n**Type 2:** Creating a new Product given an existing `BrandId` and an existing `CategoryId`.\r\n\r\nWhen 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.\r\n\r\n ## Request body examples\r\n\r\n ### Type 1\r\n\r\n Request to create a product, associating it to a new Category and a new Brand by using `CategoryPath` and `BrandName`:\r\n\r\n```json\r\n{\r\n \"Name\": \"Black T-Shirt\",\r\n \"CategoryPath\": \"Mens/Clothing/T-Shirts\",\r\n \"BrandName\": \"Nike\",\r\n \"RefId\": \"31011706925\",\r\n \"Title\": \"Black T-Shirt\",\r\n \"LinkId\": \"tshirt-black\",\r\n \"Description\": \"This is a cool Tshirt\",\r\n \"ReleaseDate\": \"2022-01-01T00:00:00\",\r\n \"IsVisible\": true,\r\n \"IsActive\": true,\r\n \"TaxCode\": \"\",\r\n \"MetaTagDescription\": \"tshirt black\",\r\n \"ShowWithoutStock\": true,\r\n \"Score\": 1\r\n}\r\n```\r\n\r\n ### Type 2\r\n\r\nRequest to create a product, associating it to an existing `CategoryId` and `BrandId`:\r\n\r\n```json\r\n{\r\n \"Name\": \"insert product test\",\r\n \"DepartmentId\": 1,\r\n \"CategoryId\": 2,\r\n \"BrandId\": 2000000,\r\n \"LinkId\": \"insert-product-test\",\r\n \"RefId\": \"310117869\",\r\n \"IsVisible\": true,\r\n \"Description\": \"texto de descrição\",\r\n \"DescriptionShort\": \"Utilize o CEP 04548-005 para frete grátis\",\r\n \"ReleaseDate\": \"2019-01-01T00:00:00\",\r\n \"KeyWords\": \"teste,teste2\",\r\n \"Title\": \"product de teste\",\r\n \"IsActive\": true,\r\n \"TaxCode\": \"\",\r\n \"MetaTagDescription\": \"tag test\",\r\n \"SupplierId\": 1,\r\n \"ShowWithoutStock\": true,\r\n \"AdWordsRemarketingCode\": null,\r\n \"LomadeeCampaignCode\": null,\r\n \"Score\": 1\r\n}\r\n```\r\n\r\n ## Response body example\r\n\r\n```json\r\n{\r\n \"Id\": 52,\r\n \"Name\": \"insert product test\",\r\n \"DepartmentId\": 1,\r\n \"CategoryId\": 2,\r\n \"BrandId\": 2000000,\r\n \"LinkId\": \"insert-product-test\",\r\n \"RefId\": \"310117869\",\r\n \"IsVisible\": true,\r\n \"Description\": \"texto de descrição\",\r\n \"DescriptionShort\": \"Utilize o CEP 04548-005 para frete grátis\",\r\n \"ReleaseDate\": \"2019-01-01T00:00:00\",\r\n \"KeyWords\": \"teste,teste2\",\r\n \"Title\": \"product de teste\",\r\n \"IsActive\": true,\r\n \"TaxCode\": \"\",\r\n \"MetaTagDescription\": \"tag test\",\r\n \"SupplierId\": 1,\r\n \"ShowWithoutStock\": true,\r\n \"AdWordsRemarketingCode\": null,\r\n \"LomadeeCampaignCode\": null,\r\n \"Score\": 1\r\n}\r\n```\r\n \r\n> 📘 Onboarding guide \r\n>\r\n> 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.", + "summary": "Get Product by ID", + "description": "Retrieves a specific Product by its ID. This information is exactly what is needed to create a new Product. \r\n> 📘 Onboarding guide \r\n>\r\n> 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.", + "operationId": "GetProductbyid", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Type of the content being sent.", + "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -1431,6 +1890,16 @@ "type": "string", "default": "application/json" } + }, + { + "name": "productId", + "in": "path", + "description": "Product’s unique numerical identifier.", + "required": true, + "style": "simple", + "schema": { + "type": "string" + } } ], "responses": { @@ -1510,7 +1979,7 @@ }, "KeyWords": { "type": "string", - "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n" + "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n" }, "Title": { "type": "string", @@ -1522,11 +1991,11 @@ }, "TaxCode": { "type": "string", - "description": "Product tax code, used for tax calculation." + "description": "Product tax code, used for tax calculation." }, "MetaTagDescription": { "type": "string", - "description": "Brief description of the product for SEO. It's recommended that you don't exceed 150 characters." + "description": "Brief description of the product for SEO. It is recommended not to exceed 150 characters." }, "SupplierId": { "type": "integer", @@ -1549,7 +2018,8 @@ }, "Score": { "type": "integer", - "description": "Value used to set the priority on the search result page." + "description": "Value used to set the priority on the search result page.", + "example": 1 } } } @@ -1557,44 +2027,202 @@ } } }, - "requestBody": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "Name" - ], - "properties": { - "Id": { - "type": "integer", - "description": "Product’s unique numerical identifier. If not informed, it will be automatically generated by VTEX.", - "example": 42 - }, - "Name": { - "type": "string", - "description": "Product's name. Limited to 150 characters.", - "example": "Zoom Stefan Janoski Canvas RM SB Varsity Red" - }, - "CategoryPath": { - "type": "string", - "description": "Path of categories associated with this product, from the highest level of category to the lowest level, separated by `/`. It is mandatory to use either this field or the `CategoryId` field.", - "example": "Mens/Clothing/T-Shirts" - }, - "CategoryId": { - "type": "integer", - "description": "ID of an existing Category that will be associated with this product. It is mandatory to use either this field or the `CategoryPath` field.", - "example": 2000090 - }, - "BrandName": { - "type": "string", - "description": "Name of the brand that will be associated with this product. It is mandatory to use either this field or the `BrandId` field. If you wish to create a new brand, that is, in case the brand does not exist yet, use this field instead of `BrandId`.", - "example": "Sample Brand" - }, - "BrandId": { - "type": "integer", - "description": "ID of an existing Brand that will be associated with this product. It is mandatory to use either this field or the `BrandName` field.", + "deprecated": false + }, + "put": { + "tags": [ + "Product" + ], + "summary": "Update Product", + "description": "Updates an existing Product.", + "parameters": [ + { + "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": "productId", + "in": "path", + "required": true, + "description": "Product’s unique numerical identifier.", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "example": { + "Id": 42, + "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", + "DepartmentId": 2000089, + "CategoryId": 2000090, + "BrandId": 12121219, + "LinkId": "stefan-janoski-canvas-varsity-red", + "RefId": "sr_1_90", + "IsVisible": true, + "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", + "ReleaseDate": "2020-01-01T00:00:00", + "KeyWords": "Zoom,Stefan,Janoski", + "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Re", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "SupplierId": 1, + "ShowWithoutStock": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": 1 + }, + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Product’s unique numerical identifier." + }, + "Name": { + "type": "string", + "description": "Product's name. Limited to 150 characters." + }, + "DepartmentId": { + "type": "integer", + "description": "Department ID according to the product's category." + }, + "CategoryId": { + "type": "integer", + "description": "Category ID associated with this product." + }, + "BrandId": { + "type": "integer", + "description": "Brand ID associated with this product." + }, + "LinkId": { + "type": "string", + "description": "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 (`-`)." + }, + "RefId": { + "type": "string", + "description": "Product Reference Code." + }, + "IsVisible": { + "type": "boolean", + "description": "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." + }, + "Description": { + "type": "string", + "description": "Product description." + }, + "DescriptionShort": { + "type": "string", + "description": "Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``.\r\n" + }, + "ReleaseDate": { + "type": "string", + "description": "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." + }, + "KeyWords": { + "type": "string", + "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n" + }, + "Title": { + "type": "string", + "description": "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." + }, + "IsActive": { + "type": "boolean", + "description": "Activate (`true`) or inactivate (`false`) product." + }, + "TaxCode": { + "type": "string", + "description": "Product tax code, used for tax calculation." + }, + "MetaTagDescription": { + "type": "string", + "description": "Brief description of the product for SEO. It's recommended that you don't exceed 150 characters." + }, + "SupplierId": { + "type": "integer", + "deprecated": true, + "nullable": true + }, + "ShowWithoutStock": { + "type": "boolean", + "description": "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." + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "Score": { + "type": "integer", + "description": "Value used to set the priority on the search result page." + } + } + } + } + } + } + }, + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "Name", + "CategoryId", + "BrandId" + ], + "properties": { + "Name": { + "type": "string", + "description": "Product's name. Limited to 150 characters.", + "example": "Zoom Stefan Janoski Canvas RM SB Varsity Red" + }, + "DepartmentId": { + "type": "integer", + "description": "Department ID according to the product's category.", + "example": 2000089 + }, + "CategoryId": { + "type": "integer", + "description": "Category ID associated with this product.", + "example": 2000090 + }, + "BrandId": { + "type": "integer", + "description": "Brand ID associated with this product.", "example": 12121219 }, "LinkId": { @@ -1684,14 +2312,14 @@ } } }, - "/api/catalog_system/pvt/products/{productId}/specification": { + "/api/catalog_system/pvt/products/productget/{productId}": { "get": { "tags": [ - "Product Specification" + "Product" ], - "summary": "Get Product Specification by Product ID", - "description": "Retrieves all specifications of a product by the product's ID.\r\n> 📘 Onboarding guide \r\n>\r\n> 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.\r\n\r\n### Response body example\r\n\r\n```json\r\n[\r\n {\r\n \"Value\": [\r\n \"Iron\",\r\n \"Plastic\"\r\n ],\r\n \"Id\": 30,\r\n \"Name\": \"Material\"\r\n }\r\n]\r\n```", - "operationId": "GetProductSpecification", + "summary": "Get Product and its general context", + "description": "Retrieves a specific product's general information as name, description and the trade policies that it is included.", + "operationId": "ProductandTradePolicy", "parameters": [ { "name": "Content-Type", @@ -1730,159 +2358,166 @@ "responses": { "200": { "description": "OK", - "headers": { - "Cache-Control": { - "content": { - "text/plain": { - "schema": { + "content": { + "application/json": { + "example": { + "Id": 1, + "Name": "Ração Royal Canin Feline Urinary", + "DepartmentId": 1, + "CategoryId": 10, + "BrandId": 2000000, + "LinkId": "racao-royal-canin-feline-urinary", + "RefId": "", + "IsVisible": true, + "Description": "Descrição.", + "DescriptionShort": "", + "ReleaseDate": "2020-01-06T00:00:00", + "KeyWords": "bbbbbbbbbbbb*, a@", + "Title": "Ração Royal Canin Feline Urinary", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "Descrição.", + "SupplierId": 1, + "ShowWithoutStock": true, + "ListStoreId": [ + 1, + 2, + 3 + ], + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "" + }, + "schema": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Product ID.", + "example": 1 + }, + "Name": { "type": "string", - "example": "no-cache" - } - } - } - }, - "Content-Length": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "description": "Product's name. Limited to 150 characters.", + "example": "Ração Royal Canin Feline Urinary" }, - "example": "102" - } - } - }, - "Date": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "DepartmentId": { + "type": "integer", + "description": "Product department ID.", + "example": 1 }, - "example": "Mon, 22 Jan 2018 23:18:18 GMT" - } - } - }, - "Expires": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "CategoryId": { + "type": "integer", + "description": "Product category ID.", + "example": 10 }, - "example": "-1" - } - } - }, - "Pragma": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "BrandId": { + "type": "integer", + "description": "Product brand ID.", + "example": 2000000 }, - "example": "no-cache" - } - } - }, - "Server": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "LinkId": { + "type": "string", + "description": "Product text link.", + "example": "racao-royal-canin-feline-urinary" }, - "example": "Microsoft-IIS/10.0" - } - } - }, - "X-AspNet-Version": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "RefId": { + "type": "string", + "description": "Product referecial code.", + "example": "" }, - "example": "4.0.30319" - } - } - }, - "X-Powered-By": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "IsVisible": { + "type": "boolean", + "description": "If the Product is visible on the store.", + "example": true }, - "example": "ASP.NET" - } - } - }, - "no": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "Description": { + "type": "string", + "description": "Product description.", + "example": "Description" }, - "example": "CELOCOUTO" - } - } - }, - "p3p": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "DescriptionShort": { + "type": "string", + "description": "Product complement name.", + "example": "" }, - "example": "policyref=\"/w3c/p3p.xml\",CP=\"ADMa OUR NOR CNT NID DSP NOI COR\"" - } - } - }, - "powered": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "ReleaseDate": { + "type": "string", + "description": "Product release date.", + "example": "2020-01-06T00:00:00" }, - "example": "vtex" - } - } - }, - "x-vtex-operation-id": { - "content": { - "text/plain": { - "schema": { - "type": "string" + "KeyWords": { + "type": "string", + "description": "Substitutes words for the product.", + "example": "ração, racao, animal" }, - "example": "7ec24c86-1dc8-4ec7-a4b7-79b06b53a742" - } - } - } - }, - "content": { - "application/json": { - "schema": { - "example": [ - { - "Value": [ - "Iron", - "Plastic" - ], - "Id": 30, - "Name": "Material" + "Title": { + "type": "string", + "description": "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.", + "example": "Ração Royal Canin Feline Urinary" + }, + "IsActive": { + "type": "boolean", + "description": "If the product is active (`true`) or not (`false`) at the store.", + "example": true + }, + "TaxCode": { + "type": "string", + "description": "Product fiscal code.", + "example": "" + }, + "MetaTagDescription": { + "type": "string", + "description": "Product meta tag description.", + "example": "Description" + }, + "SupplierId": { + "type": "integer", + "description": "Product supplier ID.", + "example": 1 + }, + "ShowWithoutStock": { + "type": "boolean", + "description": "Defines if the Product will remain being shown in the store even if it’s out of stock.", + "example": true + }, + "ListStoreId": { + "type": "array", + "description": "List with the Trade Policies IDs that the product is included.", + "items": { + "type": "integer", + "description": "Trade Policy ID." + }, + "example": [ + 1, + 2 + ] + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true } - ], - "type": "array", - "items": { - "$ref": "#/components/schemas/GetorUpdateProductSpecification" } } } } } - }, - "deprecated": false - }, - "post": { + } + } + }, + "/api/catalog_system/pvt/products/productgetbyrefid/{refId}": { + "get": { "tags": [ - "Product Specification" + "Product" ], - "summary": "Update Product Specification by Product ID", - "description": "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.\r\n\r\n### Request body example\r\n\r\n```json\r\n[\r\n {\r\n \"Value\": [\r\n \"Iron\",\r\n \"Plastic\"\r\n ],\r\n \"Id\": 30,\r\n \"Name\": \"Material\"\r\n }\r\n]\r\n```", - "operationId": "UpdateProductSpecification", + "summary": "Get Product by RefId", + "description": "Retrieves a specific product by its Reference ID.", + "operationId": "ProductbyRefId", "parameters": [ { "name": "Content-Type", @@ -1907,47 +2542,156 @@ } }, { - "name": "productId", + "name": "refId", "in": "path", - "description": "Product’s unique identifier.", + "description": "Product Referecial Code", "required": true, "style": "simple", "schema": { - "type": "integer", - "example": 1 + "type": "string" } } ], - "requestBody": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetorUpdateProductSpecification" - } - } - } - }, - "required": true - }, "responses": { "200": { - "description": "OK" - } - }, - "deprecated": false - } - }, - "/api/catalog/pvt/product/{productId}/specification": { - "get": { - "tags": [ - "Product Specification" - ], - "summary": "Get Product Specification and its information by Product ID", - "description": "Retrieves information of all specifications of a product by the product's ID.\r\n\r\n ### Response body example\r\n\r\n```json\r\n[\r\n {\r\n \"Id\": 227,\r\n \"ProductId\": 1,\r\n \"FieldId\": 33,\r\n \"FieldValueId\": 135,\r\n \"Text\": \"ValueA\"\r\n },\r\n {\r\n \"Id\": 228,\r\n \"ProductId\": 1,\r\n \"FieldId\": 34,\r\n \"FieldValueId\": 1,\r\n \"Text\": \"Giant\"\r\n }\r\n]\r\n```", - "operationId": "GetProductSpecificationbyProductID", + "description": "OK", + "content": { + "application/json": { + "example": { + "Id": 17, + "Name": "BLACK+DECKER 20V MAX Cordless Drill / Driver with 30-Piece Accessories (LD120VA)", + "DepartmentId": 9287, + "CategoryId": 9287, + "BrandId": 9280, + "LinkId": "black-decker-20v-max-cordless-drill-driver-with-30-piece-acessories-ld120va", + "RefId": "880010", + "IsVisible": true, + "Description": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", + "DescriptionShort": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", + "ReleaseDate": "2020-01-01T00:00:00", + "KeyWords": "product,sample", + "Title": "BLACK+DECKER 20V MAX Cordless Drill / Driver with 30-Piece Accessories (LD120VA)", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "The Black and Decker LD120-VoltA 20-Volt Max Lithium Drill/Driver with 30 Accessories come with the Black and Decker 20-volt max Lithium Ion Battery. These batteries are always ready, holding a charge up to 18 months. This drill provides an extra level of control with a 24 position clutch that helps to prevent stripping and overdriving screws. It has a soft grip handle that provides added comfort during use and a light weight to prevent user fatigue. This drill is ideal for drilling and screwdriving through wood, metal, and plastic. The LD120-VoltA set includes: LD120 20-Volt MAX Lithium Drill/Driver, (1) LB20 20-Volt MAX Lithium Ion Battery, (1) LCS20 Charger, (6) Brad Point Drill Bits, (10) 1-Inch Screwdriving Bits, (9) 2-Inch Screwdriving Bits, (4) Nut Drivers, (1) Magnetic Bit Tip Holder and is backed by Black and Decker's 2 year limited warranty.", + "SupplierId": 1, + "ShowWithoutStock": true, + "ListStoreId": [ + 1 + ], + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "" + }, + "schema": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "ID of the Product." + }, + "Name": { + "type": "string", + "description": "Name of the Product." + }, + "DepartmentId": { + "type": "integer", + "description": "ID of product department." + }, + "CategoryId": { + "type": "integer", + "description": "ID of product Category." + }, + "BrandId": { + "type": "integer", + "description": "ID of the product Brand." + }, + "LinkId": { + "type": "string", + "description": "Category URL." + }, + "RefId": { + "type": "string", + "description": "Product Reference ID." + }, + "IsVisible": { + "type": "boolean", + "description": "If the product are visible in search and list pages." + }, + "Description": { + "type": "string", + "description": "Product Description, HTML is allowed." + }, + "DescriptionShort": { + "type": "string", + "description": "Product Short Description." + }, + "ReleaseDate": { + "type": "string", + "description": "Product Release Date, for list ordering and product cluster highlight." + }, + "KeyWords": { + "type": "string", + "description": "Alternatives Keywords to improve the product findability." + }, + "Title": { + "type": "string", + "description": "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." + }, + "IsActive": { + "type": "boolean", + "description": "If the product is Active." + }, + "TaxCode": { + "type": "string", + "description": "SKU Tax Code." + }, + "MetaTagDescription": { + "type": "string", + "description": "Meta Description for the Product page." + }, + "SupplierId": { + "type": "integer", + "description": "Product Supplier ID." + }, + "ShowWithoutStock": { + "type": "boolean", + "description": "If the product can be visible without stock." + }, + "ListStoreId": { + "type": "array", + "description": "Array with the ID of all the trade policies that are related to the product.", + "items": { + "type": "integer", + "description": "Trade policy ID." + } + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + } + } + } + } + } + } + }, + "deprecated": false + } + }, + "/api/catalog_system/pub/products/variations/{productId}": { + "get": { + "tags": [ + "Product" + ], + "summary": "Get Product's SKUs by Product ID", + "description": "Retrieves data about the product and all SKUs related to it by the product's ID.\r\n## Response body example\r\n\r\n```json\r\n{\r\n \"productId\": 9,\r\n \"name\": \"Camisa Masculina\",\r\n \"salesChannel\": \"2\",\r\n \"available\": true,\r\n \"displayMode\": \"lista\",\r\n \"dimensions\": [\r\n \"Cores\",\r\n \"Tamanho\",\r\n \"Pa\u00EDs de origem\",\r\n \"G\u00EAnero\"\r\n ],\r\n \"dimensionsInputType\": {\r\n \"Cores\": \"Combo\",\r\n \"Tamanho\": \"Combo\",\r\n \"Pa\u00EDs de origem\": \"Combo\",\r\n \"G\u00EAnero\": \"Combo\"\r\n },\r\n \"dimensionsMap\": {\r\n \"Cores\": [\r\n \"Amarelo\",\r\n \"Azul\",\r\n \"Vermelho\"\r\n ],\r\n \"Tamanho\": [\r\n \"P\",\r\n \"M\",\r\n \"G\"\r\n ],\r\n \"Pa\u00EDs de origem\": [\r\n \"Brasil\"\r\n ],\r\n \"G\u00EAnero\": [\r\n \"Masculino\"\r\n ]\r\n },\r\n \"skus\": [\r\n {\r\n \"sku\": 310118454,\r\n \"skuname\": \"Amarela - G\",\r\n \"dimensions\": {\r\n \"Cores\": \"Amarelo\",\r\n \"Tamanho\": \"G\",\r\n \"Pa\u00EDs de origem\": \"Brasil\",\r\n \"G\u00EAnero\": \"Masculino\"\r\n },\r\n \"available\": false,\r\n \"availablequantity\": 0,\r\n \"cacheVersionUsedToCallCheckout\": null,\r\n \"listPriceFormated\": \"R$ 0,00\",\r\n \"listPrice\": 0,\r\n \"taxFormated\": \"R$ 0,00\",\r\n \"taxAsInt\": 0,\r\n \"bestPriceFormated\": \"R$ 9.999.876,00\",\r\n \"bestPrice\": 999987600,\r\n \"spotPrice\": 999987600,\r\n \"installments\": 0,\r\n \"installmentsValue\": 0,\r\n \"installmentsInsterestRate\": null,\r\n \"image\": \"https:\/\/lojadobreno.vteximg.com.br\/arquivos\/ids\/155467-292-292\/image-5d7ad76ad1954c53adecab4138319034.jpg?v=637321899584500000\",\r\n \"sellerId\": \"1\",\r\n \"seller\": \"lojadobreno\",\r\n \"measures\": {\r\n \"cubicweight\": 1.0000,\r\n \"height\": 5.0000,\r\n \"length\": 20.0000,\r\n \"weight\": 200.0000,\r\n \"width\": 20.0000\r\n },\r\n \"unitMultiplier\": 1.0000,\r\n \"rewardValue\": 0\r\n },\r\n {\r\n \"sku\": 310118455,\r\n \"skuname\": \"Vermelha - M\",\r\n \"dimensions\": {\r\n \"Cores\": \"Vermelho\",\r\n \"Tamanho\": \"M\",\r\n \"Pa\u00EDs de origem\": \"Brasil\",\r\n \"G\u00EAnero\": \"Masculino\"\r\n },\r\n \"available\": true,\r\n \"availablequantity\": 99999,\r\n \"cacheVersionUsedToCallCheckout\": \"38395F1AEF59DF5CEAEDE472328145CD_\",\r\n \"listPriceFormated\": \"R$ 0,00\",\r\n \"listPrice\": 0,\r\n \"taxFormated\": \"R$ 0,00\",\r\n \"taxAsInt\": 0,\r\n \"bestPriceFormated\": \"R$ 20,00\",\r\n \"bestPrice\": 2000,\r\n \"spotPrice\": 2000,\r\n \"installments\": 1,\r\n \"installmentsValue\": 2000,\r\n \"installmentsInsterestRate\": 0,\r\n \"image\": \"https:\/\/lojadobreno.vteximg.com.br\/arquivos\/ids\/155468-292-292\/image-601a6099aace48b89d26fc9f22e8e611.jpg?v=637321906602470000\",\r\n \"sellerId\": \"pedrostore\",\r\n \"seller\": \"pedrostore\",\r\n \"measures\": {\r\n \"cubicweight\": 0.4167,\r\n \"height\": 5.0000,\r\n \"length\": 20.0000,\r\n \"weight\": 200.0000,\r\n \"width\": 20.0000\r\n },\r\n \"unitMultiplier\": 1.0000,\r\n \"rewardValue\": 0\r\n }\r\n ]\r\n}\r\n```", + "operationId": "ProductVariations", "parameters": [ { "name": "Content-Type", @@ -1989,46 +2733,280 @@ "content": { "application/json": { "schema": { - "type": "array", - "example": [ - { - "Id": 227, - "ProductId": 1, - "FieldId": 33, - "FieldValueId": 135, - "Text": "ValueA" + "example": { + "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" }, - { - "Id": 228, - "ProductId": 1, - "FieldId": 34, - "FieldValueId": 1, - "Text": "Giant" - } - ], - "items": { - "type": "object", - "description": "Object with the product specification information.", - "properties": { - "Id": { - "type": "integer", - "description": "ID of the association of the specification and the product. This ID is used to update or delete the specification." - }, - "ProductId": { - "type": "integer", - "description": "Product ID." - }, - "FieldId": { - "type": "integer", - "description": "Specification field ID." - }, - "FieldValueId": { - "type": "integer", - "description": "Current specification value ID." + "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 }, - "Text": { + { + "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 + } + ] + }, + "type": "object", + "description": "Response body.", + "properties": { + "productId": { + "type": "integer", + "description": "Product’s unique numerical identifier." + }, + "name": { + "type": "string", + "description": "Product name." + }, + "salesChannel": { + "type": "string", + "description": "Trade policy ID." + }, + "available": { + "type": "boolean", + "description": "Defines if the product is available (`true`) or not (`false`)." + }, + "displayMode": { + "type": "string", + "description": "Defines the mannner SKUs are displayed." + }, + "dimensions": { + "type": "array", + "description": "Lists SKU specifications.", + "items": { "type": "string", - "description": "Current specification value text." + "description": "Name of the SKU specification." + } + }, + "dimensionsInputType": { + "type": "object", + "description": "Lists SKU specifications and their field type, in the following format: `\"{specificationName}\":\"{fieldType}\"`.", + "additionalProperties": { + "type": "string" + } + }, + "dimensionsMap": { + "type": "object", + "description": "Lists SKU specifications and their possible values inside arrays.", + "additionalProperties": { + "type": "array", + "items": {} + } + }, + "skus": { + "type": "array", + "description": "Array containing information about the product's SKUs.", + "items": { + "type": "object", + "description": "Object containing information about a specific SKU.", + "properties": { + "sku": { + "type": "integer", + "description": "SKU ID." + }, + "skuname": { + "type": "string", + "description": "SKU Name." + }, + "dimensions": { + "type": "object", + "description": "Lists SKU specifications and their respective values.", + "additionalProperties": { + "type": "string" + } + }, + "available": { + "type": "boolean", + "description": "Defines if the SKU is available (`true`) or not (`false`)." + }, + "availablequantity": { + "type": "integer", + "description": "Available quantity of the SKU in stock." + }, + "cacheVersionUsedToCallCheckout": { + "type": "string", + "description": "Cache version used to call Checkout.", + "nullable": true + }, + "listPriceFormated": { + "type": "string", + "description": "List price formatted according to the valid currency." + }, + "listPrice": { + "type": "integer", + "description": "List price." + }, + "taxFormated": { + "type": "string", + "description": "Tax value formatted according to the valid currency." + }, + "taxAsInt": { + "type": "integer", + "description": "Tax value." + }, + "bestPriceFormated": { + "type": "string", + "description": "Best price formatted according to the valid currency." + }, + "bestPrice": { + "type": "integer", + "description": "Best price." + }, + "spotPrice": { + "type": "integer", + "description": "Spot price." + }, + "installments": { + "type": "integer", + "description": "Number of installments." + }, + "installmentsValue": { + "type": "integer", + "description": "Value of installments." + }, + "installmentsInsterestRate": { + "type": "integer", + "description": "Interest rate of installments.", + "nullable": true + }, + "image": { + "type": "string", + "description": "SKU image URL." + }, + "sellerId": { + "type": "string", + "description": "Seller ID." + }, + "measures": { + "type": "object", + "description": "SKU measures.", + "properties": { + "cubicweight": { + "type": "number", + "description": "Cubic weight." + }, + "height": { + "type": "number", + "description": "Height." + }, + "length": { + "type": "number", + "description": "Length." + }, + "weight": { + "type": "number", + "description": "Weight." + }, + "width": { + "type": "number", + "description": "Width." + } + } + }, + "unitMultiplier": { + "type": "number", + "description": "SKU Unit Multiplier." + }, + "rewardValue": { + "type": "integer", + "description": "SKU reward value for rewards program." + } + } } } } @@ -2038,18 +3016,21 @@ } }, "deprecated": false - }, - "post": { + } + }, + "/api/addon/pvt/review/GetProductRate/{productId}": { + "get": { "tags": [ - "Product Specification" + "Product" ], - "summary": "Associate Product Specification", - "description": "Associates a previously defined Specification to a Product.\r\n\r\n### Request body example\r\n\r\n```json\r\n{\r\n \"FieldId\": 19,\r\n \"FieldValueId\": 1,\r\n \"Text\": \"test\"\r\n}\r\n```\r\n\r\n### Response body example\r\n\r\n```json\r\n{\r\n \"Id\": 41,\r\n \"FieldId\": 19,\r\n \"FieldValueId\": 1,\r\n \"Text\": \"test\"\r\n}\r\n```", + "summary": "Get Product Review Rate by Product ID", + "description": "Retrieves the review rate of a product by this product's ID.", + "operationId": "ReviewRateProduct", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Type of the content being sent.", + "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -2071,8 +3052,9 @@ { "name": "productId", "in": "path", - "required": true, "description": "Product’s unique numerical identifier.", + "required": true, + "style": "simple", "schema": { "type": "integer", "example": 1 @@ -2085,78 +3067,307 @@ "content": { "application/json": { "schema": { - "example": { - "Id": 41, - "FieldId": 19, - "FieldValueId": 1, - "Text": "test" - }, - "type": "object", - "properties": { - "Id": { - "type": "integer", - "description": "ID of the association of the specification and the product. This ID is used to update or delete the specification." - }, - "ProductId": { - "type": "integer", - "description": "Product ID." - }, - "FieldId": { - "type": "integer", - "description": "Specification field ID." - }, - "FieldValueId": { - "type": "integer", - "description": "Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types" - }, - "Text": { - "type": "string", - "description": "Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`." - } - } + "example": 3.0, + "type": "number", + "description": "Review rate numeber." } } } } }, - "requestBody": { - "description": "", - "content": { - "application/json": { - "schema": { - "type": "object", - "required": [ - "FieldId" - ], - "properties": { - "FieldId": { - "type": "integer", - "description": "Specification field ID.", - "example": 19 + "deprecated": false + } + }, + "/api/catalog/pvt/product": { + "post": { + "tags": [ + "Product" + ], + "summary": "Create Product with Category and Brand", + "description": "This endpoint allows two types of request:\r\n\r\n**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.\r\n\r\n**Type 2:** Creating a new Product given an existing `BrandId` and an existing `CategoryId`.\r\n\r\nWhen 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.\r\n\r\n ## Request body examples\r\n\r\n ### Type 1\r\n\r\n Request to create a product, associating it to a new Category and a new Brand by using `CategoryPath` and `BrandName`:\r\n\r\n```json\r\n{\r\n \"Name\": \"Black T-Shirt\",\r\n \"CategoryPath\": \"Mens/Clothing/T-Shirts\",\r\n \"BrandName\": \"Nike\",\r\n \"RefId\": \"31011706925\",\r\n \"Title\": \"Black T-Shirt\",\r\n \"LinkId\": \"tshirt-black\",\r\n \"Description\": \"This is a cool Tshirt\",\r\n \"ReleaseDate\": \"2022-01-01T00:00:00\",\r\n \"IsVisible\": true,\r\n \"IsActive\": true,\r\n \"TaxCode\": \"\",\r\n \"MetaTagDescription\": \"tshirt black\",\r\n \"ShowWithoutStock\": true,\r\n \"Score\": 1\r\n}\r\n```\r\n\r\n ### Type 2\r\n\r\nRequest to create a product, associating it to an existing `CategoryId` and `BrandId`:\r\n\r\n```json\r\n{\r\n \"Name\": \"insert product test\",\r\n \"DepartmentId\": 1,\r\n \"CategoryId\": 2,\r\n \"BrandId\": 2000000,\r\n \"LinkId\": \"insert-product-test\",\r\n \"RefId\": \"310117869\",\r\n \"IsVisible\": true,\r\n \"Description\": \"texto de descrição\",\r\n \"DescriptionShort\": \"Utilize o CEP 04548-005 para frete grátis\",\r\n \"ReleaseDate\": \"2019-01-01T00:00:00\",\r\n \"KeyWords\": \"teste,teste2\",\r\n \"Title\": \"product de teste\",\r\n \"IsActive\": true,\r\n \"TaxCode\": \"\",\r\n \"MetaTagDescription\": \"tag test\",\r\n \"SupplierId\": 1,\r\n \"ShowWithoutStock\": true,\r\n \"AdWordsRemarketingCode\": null,\r\n \"LomadeeCampaignCode\": null,\r\n \"Score\": 1\r\n}\r\n```\r\n\r\n ## Response body example\r\n\r\n```json\r\n{\r\n \"Id\": 52,\r\n \"Name\": \"insert product test\",\r\n \"DepartmentId\": 1,\r\n \"CategoryId\": 2,\r\n \"BrandId\": 2000000,\r\n \"LinkId\": \"insert-product-test\",\r\n \"RefId\": \"310117869\",\r\n \"IsVisible\": true,\r\n \"Description\": \"texto de descrição\",\r\n \"DescriptionShort\": \"Utilize o CEP 04548-005 para frete grátis\",\r\n \"ReleaseDate\": \"2019-01-01T00:00:00\",\r\n \"KeyWords\": \"teste,teste2\",\r\n \"Title\": \"product de teste\",\r\n \"IsActive\": true,\r\n \"TaxCode\": \"\",\r\n \"MetaTagDescription\": \"tag test\",\r\n \"SupplierId\": 1,\r\n \"ShowWithoutStock\": true,\r\n \"AdWordsRemarketingCode\": null,\r\n \"LomadeeCampaignCode\": null,\r\n \"Score\": 1\r\n}\r\n```\r\n \r\n> 📘 Onboarding guide \r\n>\r\n> 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.", + "parameters": [ + { + "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" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "example": { + "Id": 42, + "Name": "Zoom Stefan Janoski Canvas RM SB Varsity Red", + "DepartmentId": 2000089, + "CategoryId": 2000090, + "BrandId": 12121219, + "LinkId": "stefan-janoski-canvas-varsity-red", + "RefId": "sr_1_90", + "IsVisible": true, + "Description": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "DescriptionShort": "The Nike Zoom Stefan Janoski is made with a premium leather.", + "ReleaseDate": "2020-01-01T00:00:00", + "KeyWords": "Zoom,Stefan,Janoski", + "Title": "Zoom Stefan Janoski Canvas RM SB Varsity Re", + "IsActive": true, + "TaxCode": "", + "MetaTagDescription": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction.", + "SupplierId": 1, + "ShowWithoutStock": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": 1 }, - "FieldValueId": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Product’s unique numerical identifier." + }, + "Name": { + "type": "string", + "description": "Product's name. Limited to 150 characters." + }, + "DepartmentId": { + "type": "integer", + "description": "Department ID according to the product's category." + }, + "CategoryId": { + "type": "integer", + "description": "Category ID associated with this product." + }, + "BrandId": { + "type": "integer", + "description": "Brand ID associated with this product." + }, + "LinkId": { + "type": "string", + "description": "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 (`-`)." + }, + "RefId": { + "type": "string", + "description": "Product Reference Code." + }, + "IsVisible": { + "type": "boolean", + "description": "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." + }, + "Description": { + "type": "string", + "description": "Product description." + }, + "DescriptionShort": { + "type": "string", + "description": "Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``.\r\n" + }, + "ReleaseDate": { + "type": "string", + "description": "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." + }, + "KeyWords": { + "type": "string", + "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n" + }, + "Title": { + "type": "string", + "description": "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." + }, + "IsActive": { + "type": "boolean", + "description": "Activate (`true`) or inactivate (`false`) product." + }, + "TaxCode": { + "type": "string", + "description": "Product tax code, used for tax calculation." + }, + "MetaTagDescription": { + "type": "string", + "description": "Brief description of the product for SEO. It's recommended that you don't exceed 150 characters." + }, + "SupplierId": { + "type": "integer", + "deprecated": true, + "nullable": true + }, + "ShowWithoutStock": { + "type": "boolean", + "description": "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." + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "Score": { + "type": "integer", + "description": "Value used to set the priority on the search result page." + } + } + } + } + } + } + }, + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "Name" + ], + "properties": { + "Id": { "type": "integer", - "description": "Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types", - "example": 12 + "description": "Product’s unique numerical identifier. If not informed, it will be automatically generated by VTEX.", + "example": 42 }, - "Text": { + "Name": { "type": "string", - "description": "Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`.", - "example": "Metal" + "description": "Product's name. Limited to 150 characters.", + "example": "Zoom Stefan Janoski Canvas RM SB Varsity Red" + }, + "CategoryPath": { + "type": "string", + "description": "Path of categories associated with this product, from the highest level of category to the lowest level, separated by `/`. It is mandatory to use either this field or the `CategoryId` field.", + "example": "Mens/Clothing/T-Shirts" + }, + "CategoryId": { + "type": "integer", + "description": "ID of an existing Category that will be associated with this product. It is mandatory to use either this field or the `CategoryPath` field.", + "example": 2000090 + }, + "BrandName": { + "type": "string", + "description": "Name of the brand that will be associated with this product. It is mandatory to use either this field or the `BrandId` field. If you wish to create a new brand, that is, in case the brand does not exist yet, use this field instead of `BrandId`.", + "example": "Sample Brand" + }, + "BrandId": { + "type": "integer", + "description": "ID of an existing Brand that will be associated with this product. It is mandatory to use either this field or the `BrandName` field.", + "example": 12121219 + }, + "LinkId": { + "type": "string", + "description": "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 (`-`).", + "example": "stefan-janoski-canvas-varsity-red" + }, + "RefId": { + "type": "string", + "description": "Product Reference Code.", + "example": "sr_1_90" + }, + "IsVisible": { + "type": "boolean", + "description": "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.", + "example": true + }, + "Description": { + "type": "string", + "description": "Product description.", + "example": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction." + }, + "DescriptionShort": { + "type": "string", + "description": "Short product description. This information can be displayed on both the product page and the shelf, using the following controls:\r\n Store Framework: `$product.DescriptionShort`.\r\n Legacy CMS Portal: ``.\r\n", + "example": "The Nike Zoom Stefan Janoski is made with a premium leather." + }, + "ReleaseDate": { + "type": "string", + "description": "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.", + "example": "2019-01-01T00:00:00" + }, + "KeyWords": { + "type": "string", + "description": "Store Framework: Deprecated. \r\nLegacy 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.\r\n", + "example": "Zoom,Stefan,Janoski" + }, + "Title": { + "type": "string", + "description": "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.", + "example": "Zoom Stefan Janoski Canvas RM SB Varsity Red" + }, + "IsActive": { + "type": "boolean", + "description": "Activate (`true`) or inactivate (`false`) product.", + "example": true + }, + "TaxCode": { + "type": "string", + "description": "Product tax code, used for tax calculation.", + "example": "12345" + }, + "MetaTagDescription": { + "type": "string", + "description": "Brief description of the product for SEO. It is recommended not to exceed 150 characters.", + "example": "The Nike Zoom Stefan Janoski Men's Shoe is made with a premium leather upper for superior durability and a flexible midsole for all-day comfort. A tacky gum rubber outsole delivers outstanding traction." + }, + "SupplierId": { + "type": "integer", + "deprecated": true, + "nullable": true + }, + "ShowWithoutStock": { + "type": "boolean", + "description": "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.", + "example": true + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "Score": { + "type": "integer", + "description": "Value used to set the priority on the search result page.", + "example": 1 } } } } } } - }, - "delete": { + } + }, + "/api/catalog_system/pvt/products/{productId}/specification": { + "get": { "tags": [ "Product Specification" ], - "summary": "Delete all Product Specifications by Product ID", - "description": "Deletes all Product Specifications given a specific Product ID.", - "operationId": "DeleteAllProductSpecifications", + "summary": "Get Product Specification by Product ID", + "description": "Retrieves all specifications of a product by the product's ID.\r\n> 📘 Onboarding guide \r\n>\r\n> 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.\r\n\r\n### Response body example\r\n\r\n```json\r\n[\r\n {\r\n \"Value\": [\r\n \"Iron\",\r\n \"Plastic\"\r\n ],\r\n \"Id\": 30,\r\n \"Name\": \"Material\"\r\n }\r\n]\r\n```", + "operationId": "GetProductSpecification", "parameters": [ { "name": "Content-Type", @@ -2194,19 +3405,160 @@ ], "responses": { "200": { - "description": "OK" + "description": "OK", + "headers": { + "Cache-Control": { + "content": { + "text/plain": { + "schema": { + "type": "string", + "example": "no-cache" + } + } + } + }, + "Content-Length": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "102" + } + } + }, + "Date": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "Mon, 22 Jan 2018 23:18:18 GMT" + } + } + }, + "Expires": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "-1" + } + } + }, + "Pragma": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "no-cache" + } + } + }, + "Server": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "Microsoft-IIS/10.0" + } + } + }, + "X-AspNet-Version": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "4.0.30319" + } + } + }, + "X-Powered-By": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "ASP.NET" + } + } + }, + "no": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "CELOCOUTO" + } + } + }, + "p3p": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "policyref=\"/w3c/p3p.xml\",CP=\"ADMa OUR NOR CNT NID DSP NOI COR\"" + } + } + }, + "powered": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "vtex" + } + } + }, + "x-vtex-operation-id": { + "content": { + "text/plain": { + "schema": { + "type": "string" + }, + "example": "7ec24c86-1dc8-4ec7-a4b7-79b06b53a742" + } + } + } + }, + "content": { + "application/json": { + "schema": { + "example": [ + { + "Value": [ + "Iron", + "Plastic" + ], + "Id": 30, + "Name": "Material" + } + ], + "type": "array", + "items": { + "$ref": "#/components/schemas/GetorUpdateProductSpecification" + } + } + } + } } - } - } - }, - "/api/catalog/pvt/product/{productId}/specification/{specificationId}": { - "delete": { + }, + "deprecated": false + }, + "post": { "tags": [ "Product Specification" ], - "summary": "Delete a specific Product Specification", - "description": "Deletes a specific Product Specification given a Product ID and a Specification ID.", - "operationId": "DeleteaProductSpecification", + "summary": "Update Product Specification by Product ID", + "description": "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.\r\n\r\n### Request body example\r\n\r\n```json\r\n[\r\n {\r\n \"Value\": [\r\n \"Iron\",\r\n \"Plastic\"\r\n ],\r\n \"Id\": 30,\r\n \"Name\": \"Material\"\r\n }\r\n]\r\n```", + "operationId": "UpdateProductSpecification", "parameters": [ { "name": "Content-Type", @@ -2233,45 +3585,50 @@ { "name": "productId", "in": "path", - "description": "Product’s unique numerical identifier.", + "description": "Product’s unique identifier.", "required": true, "style": "simple", "schema": { "type": "integer", "example": 1 } - }, - { - "name": "specificationId", - "in": "path", - "description": "Product Specification’s unique numerical identifier.", - "required": true, - "style": "simple", - "schema": { - "type": "integer", - "example": 7 - } } ], + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetorUpdateProductSpecification" + } + } + } + }, + "required": true + }, "responses": { "200": { "description": "OK" } - } + }, + "deprecated": false } }, - "/api/catalog/pvt/product/{productId}/specificationvalue": { - "put": { + "/api/catalog/pvt/product/{productId}/specification": { + "get": { "tags": [ "Product Specification" ], - "summary": "Associate product specification using specification name and group name", - "description": "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.\r\n\r\n ## Request body example\r\n\r\n```json\r\n{\r\n \"FieldName\": \"Material\",\r\n \"GroupName\": \"Additional Information\",\r\n \"RootLevelSpecification\": false,\r\n \"FieldValues\": [\r\n \"Cotton\",\r\n \"Polyester\"\r\n ]\r\n}\r\n```\r\n \r\n \r\n## Response body example\r\n\r\n```json\r\n[\r\n {\r\n \"Id\": 53,\r\n \"ProductId\": 3,\r\n \"FieldId\": 21,\r\n \"FieldValueId\": 60,\r\n \"Text\": \"Cotton\"\r\n },\r\n {\r\n \"Id\": 54,\r\n \"ProductId\": 3,\r\n \"FieldId\": 21,\r\n \"FieldValueId\": 61,\r\n \"Text\": \"Polyester\"\r\n }\r\n]\r\n```\r\n", + "summary": "Get Product Specification and its information by Product ID", + "description": "Retrieves information of all specifications of a product by the product's ID.\r\n\r\n ### Response body example\r\n\r\n```json\r\n[\r\n {\r\n \"Id\": 227,\r\n \"ProductId\": 1,\r\n \"FieldId\": 33,\r\n \"FieldValueId\": 135,\r\n \"Text\": \"ValueA\"\r\n },\r\n {\r\n \"Id\": 228,\r\n \"ProductId\": 1,\r\n \"FieldId\": 34,\r\n \"FieldValueId\": 1,\r\n \"Text\": \"Giant\"\r\n }\r\n]\r\n```", + "operationId": "GetProductSpecificationbyProductID", "parameters": [ { "name": "Content-Type", "in": "header", - "description": "Type of the content being sent.", + "description": "Describes the type of the content being sent.", "required": true, "style": "simple", "schema": { @@ -2293,8 +3650,9 @@ { "name": "productId", "in": "path", - "required": true, "description": "Product’s unique numerical identifier.", + "required": true, + "style": "simple", "schema": { "type": "integer", "example": 1 @@ -2307,17 +3665,335 @@ "content": { "application/json": { "schema": { + "type": "array", "example": [ { - "Id": 239, + "Id": 227, "ProductId": 1, - "FieldId": 85, - "FieldValueId": 193, - "Text": "Value123" + "FieldId": 33, + "FieldValueId": 135, + "Text": "ValueA" + }, + { + "Id": 228, + "ProductId": 1, + "FieldId": 34, + "FieldValueId": 1, + "Text": "Giant" } ], - "type": "array", - "description": "Array with information of all product specifications.", + "items": { + "type": "object", + "description": "Object with the product specification information.", + "properties": { + "Id": { + "type": "integer", + "description": "ID of the association of the specification and the product. This ID is used to update or delete the specification." + }, + "ProductId": { + "type": "integer", + "description": "Product ID." + }, + "FieldId": { + "type": "integer", + "description": "Specification field ID." + }, + "FieldValueId": { + "type": "integer", + "description": "Current specification value ID." + }, + "Text": { + "type": "string", + "description": "Current specification value text." + } + } + } + } + } + } + } + }, + "deprecated": false + }, + "post": { + "tags": [ + "Product Specification" + ], + "summary": "Associate Product Specification", + "description": "Associates a previously defined Specification to a Product.\r\n\r\n### Request body example\r\n\r\n```json\r\n{\r\n \"FieldId\": 19,\r\n \"FieldValueId\": 1,\r\n \"Text\": \"test\"\r\n}\r\n```\r\n\r\n### Response body example\r\n\r\n```json\r\n{\r\n \"Id\": 41,\r\n \"FieldId\": 19,\r\n \"FieldValueId\": 1,\r\n \"Text\": \"test\"\r\n}\r\n```", + "parameters": [ + { + "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": "productId", + "in": "path", + "required": true, + "description": "Product’s unique numerical identifier.", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "example": { + "Id": 41, + "FieldId": 19, + "FieldValueId": 1, + "Text": "test" + }, + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "ID of the association of the specification and the product. This ID is used to update or delete the specification." + }, + "ProductId": { + "type": "integer", + "description": "Product ID." + }, + "FieldId": { + "type": "integer", + "description": "Specification field ID." + }, + "FieldValueId": { + "type": "integer", + "description": "Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types" + }, + "Text": { + "type": "string", + "description": "Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`." + } + } + } + } + } + } + }, + "requestBody": { + "description": "", + "content": { + "application/json": { + "schema": { + "type": "object", + "required": [ + "FieldId" + ], + "properties": { + "FieldId": { + "type": "integer", + "description": "Specification field ID.", + "example": 19 + }, + "FieldValueId": { + "type": "integer", + "description": "Specification Value ID. Mandatory for `FieldTypeId` `5`, `6` and `7`. Must not be used for any other field types", + "example": 12 + }, + "Text": { + "type": "string", + "description": "Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`.", + "example": "Metal" + } + } + } + } + } + } + }, + "delete": { + "tags": [ + "Product Specification" + ], + "summary": "Delete all Product Specifications by Product ID", + "description": "Deletes all Product Specifications given a specific Product ID.", + "operationId": "DeleteAllProductSpecifications", + "parameters": [ + { + "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": "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": "productId", + "in": "path", + "description": "Product’s unique numerical identifier.", + "required": true, + "style": "simple", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/catalog/pvt/product/{productId}/specification/{specificationId}": { + "delete": { + "tags": [ + "Product Specification" + ], + "summary": "Delete a specific Product Specification", + "description": "Deletes a specific Product Specification given a Product ID and a Specification ID.", + "operationId": "DeleteaProductSpecification", + "parameters": [ + { + "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": "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": "productId", + "in": "path", + "description": "Product’s unique numerical identifier.", + "required": true, + "style": "simple", + "schema": { + "type": "integer", + "example": 1 + } + }, + { + "name": "specificationId", + "in": "path", + "description": "Product Specification’s unique numerical identifier.", + "required": true, + "style": "simple", + "schema": { + "type": "integer", + "example": 7 + } + } + ], + "responses": { + "200": { + "description": "OK" + } + } + } + }, + "/api/catalog/pvt/product/{productId}/specificationvalue": { + "put": { + "tags": [ + "Product Specification" + ], + "summary": "Associate product specification using specification name and group name", + "description": "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.\r\n\r\n ## Request body example\r\n\r\n```json\r\n{\r\n \"FieldName\": \"Material\",\r\n \"GroupName\": \"Additional Information\",\r\n \"RootLevelSpecification\": false,\r\n \"FieldValues\": [\r\n \"Cotton\",\r\n \"Polyester\"\r\n ]\r\n}\r\n```\r\n \r\n \r\n## Response body example\r\n\r\n```json\r\n[\r\n {\r\n \"Id\": 53,\r\n \"ProductId\": 3,\r\n \"FieldId\": 21,\r\n \"FieldValueId\": 60,\r\n \"Text\": \"Cotton\"\r\n },\r\n {\r\n \"Id\": 54,\r\n \"ProductId\": 3,\r\n \"FieldId\": 21,\r\n \"FieldValueId\": 61,\r\n \"Text\": \"Polyester\"\r\n }\r\n]\r\n```\r\n", + "parameters": [ + { + "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": "productId", + "in": "path", + "required": true, + "description": "Product’s unique numerical identifier.", + "schema": { + "type": "integer", + "example": 1 + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "example": [ + { + "Id": 239, + "ProductId": 1, + "FieldId": 85, + "FieldValueId": 193, + "Text": "Value123" + } + ], + "type": "array", + "description": "Array with information of all product specifications.", "items": { "type": "object", "description": "Object with information of the specification.", @@ -19745,6 +21421,10 @@ "schema": { "type": "object", "properties": { + "noSplitItem": { + "type": "boolean", + "description": "Avoid split items on cart" + }, "orderItems": { "type": "array", "description": "Array containing the cart items. Each object inside this array corresponds to a different item.", @@ -33498,6 +35178,155 @@ } } ] + }, + "schema": { + "type": "object", + "properties": { + "paging": { + "description": "Paging.", + "type": "object", + "properties": { + "page": { + "description": "Page number.", + "type": "integer" + }, + "pageSize": { + "description": "Page size.", + "type": "integer" + }, + "total": { + "description": "Total pages.", + "type": "integer" + }, + "pages": { + "description": "Pages.", + "type": "integer" + } + } + }, + "items": { + "description": "Items.", + "type": "array", + "items": { + "description": "Item information.", + "type": "object", + "properties": { + "distance": { + "description": "Distance.", + "type": "integer" + }, + "pickupPoint": { + "description": "Pickup point.", + "type": "object", + "properties": { + "friendlyName": { + "description": "Friendly name.", + "type": "string" + }, + "address": { + "description": "Address.", + "type": "object", + "properties": { + "addressType": { + "description": "Address type.", + "type": "string" + }, + "receiverName": { + "description": "Receiver name.", + "type": "string" + }, + "addressId": { + "description": "Address ID.", + "type": "string", + "nullable": true + }, + "isDisposable": { + "description": "Is disposable.", + "type": "boolean" + }, + "postalCode": { + "description": "Postal code.", + "type": "string" + }, + "city": { + "description": "City.", + "type": "string" + }, + "state": { + "description": "State.", + "type": "string" + }, + "country": { + "description": "Country.", + "type": "string" + }, + "street": { + "description": "Street.", + "type": "string" + }, + "number": { + "description": "Number.", + "type": "string" + }, + "neighborhood": { + "description": "Neighborhood.", + "type": "string" + }, + "complement": { + "description": "Complement to the shipping address, in case it applies.", + "type": "string", + "nullable": true + }, + "reference": { + "description": "Racao.", + "type": "string" + }, + "geoCoordinates": { + "description": "Geo coordinates.", + "type": "array", + "items": { + "description": "Geo coordinate.", + "type": "integer" + } + } + } + }, + "additionalInfo": { + "description": "Additional info.", + "type": "string" + }, + "id": { + "description": "ID.", + "type": "string" + }, + "businessHours": { + "description": "Array with business hours.", + "type": "array", + "items": { + "description": "Business hours.", + "type": "object", + "properties": { + "DayOfWeek": { + "description": "Day of week.", + "type": "integer" + }, + "OpeningTime": { + "description": "Opening time.", + "type": "string" + }, + "ClosingTime": { + "description": "Closing time.", + "type": "string" + } + } + } + } + } + } + } + } + } + } } } } @@ -33576,6 +35405,57 @@ "complement": "", "reference": "", "geoCoordinates": [] + }, + "schema": { + "description": "Address.", + "type": "object", + "properties": { + "postalCode": { + "description": "Postal code.", + "type": "string" + }, + "city": { + "description": "City.", + "type": "string" + }, + "state": { + "description": "State.", + "type": "string" + }, + "country": { + "description": "Country.", + "type": "string" + }, + "street": { + "description": "Street.", + "type": "string" + }, + "number": { + "description": "Number.", + "type": "string" + }, + "neighborhood": { + "description": "Neighborhood.", + "type": "string" + }, + "complement": { + "description": "Complement to the shipping address, in case it applies.", + "type": "string", + "nullable": true + }, + "reference": { + "description": "Reference.", + "type": "string" + }, + "geoCoordinates": { + "description": "Geo coordinates.", + "type": "array", + "items": { + "description": "Geo coordinate.", + "type": "integer" + } + } + } } } } @@ -36700,3742 +38580,9194 @@ } } } - } - } - }, - "components": { - "schemas": { - "OrderFormSimulationRequest": { + } + }, + "/api/oms/user/orders": { + "get": { + "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", + "parameters": [ + { + "name": "clientEmail", + "in": "query", + "description": "Customer email.", + "required": true, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "example": "customer@mail.com" + } + }, + { + "name": "page", + "in": "query", + "description": "Page number for result pagination.", + "required": true, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "example": "15" + } + }, + { + "name": "per_page", + "in": "query", + "description": "Page quantity for result pagination.", + "required": true, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "example": "15" + } + }, + { + "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" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Userorderslist" + }, + "example": { + "list": [ + { + "orderId": "v502556llux-01", + "creationDate": "2019-01-28T20:09:43+00:00", + "clientName": "Cunha 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": "v502449llux-02", + "creationDate": "2018-08-28T17:42:40+00:00", + "clientName": "Cunha VTEX", + "items": null, + "totalValue": 118588, + "paymentNames": "Promissory", + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": null, + "sequence": "502452", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": " Lux Store 96 Seu pedido foi cancelado. Referente ao Pedido #v502449llux-02 Resumo Itens R$ 1.178,98 Entrega R$ 6,90 Total R$ 1.185,88", + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 12, + "currencyCode": "BRL" + }, + { + "orderId": "v502449llux-01", + "creationDate": "2018-08-28T17:42:28.9171556+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Mangueira Reservatório Ao Cavalete", + "ean": null, + "refId": "TE3121110", + "id": "195", + "productId": "134", + "sellingPrice": 7390, + "price": 7390 + }, + { + "seller": "1", + "quantity": 1, + "description": "Mangueira Filtro", + "ean": null, + "refId": "XC459N610CA", + "id": "238", + "productId": "162", + "sellingPrice": 5190, + "price": 5190 + } + ], + "totalValue": 21526180, + "paymentNames": null, + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "", + "sequence": "502449", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v502058llux-01", + "creationDate": "2017-07-25T23:17:36.7963248+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Aquecedor Britania 1500 Branco", + "ean": "1235567890143", + "refId": "branquinho", + "id": "1234568212", + "productId": "1000200", + "sellingPrice": 35599, + "price": 35599 + } + ], + "totalValue": 35599, + "paymentNames": null, + "status": "invoiced", + "statusDescription": "Faturado", + "marketPlaceOrderId": "", + "sequence": "502058", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2017-07-29T19:24:20.7444363+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v501538llux-01", + "creationDate": "2017-06-26T16:57:58.9986524+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Boneco do Mário", + "ean": "bonecomario", + "refId": "bonecomario", + "id": "1234568183", + "productId": "1000257", + "sellingPrice": 150363, + "price": 150363 + }, + { + "seller": "1", + "quantity": 1, + "description": "Camiseta GG", + "ean": null, + "refId": "abc1234", + "id": "1234567894", + "productId": "1000187", + "sellingPrice": 899, + "price": 899 + } + ], + "totalValue": 151262, + "paymentNames": null, + "status": "invoiced", + "statusDescription": "Faturado", + "marketPlaceOrderId": "", + "sequence": "501538", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2017-06-27T13:59:49.7705236+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v501020llux-01", + "creationDate": "2016-11-21T19:57:54.0415289+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 2, + "description": "Camiseta GG", + "ean": null, + "refId": "abc1234", + "id": "1234567894", + "productId": "1000187", + "sellingPrice": 899, + "price": 899 + } + ], + "totalValue": 3190, + "paymentNames": null, + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "", + "sequence": "501020", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2016-12-02T08:00:00+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v500973llux-01", + "creationDate": "2016-10-10T17:19:30.8562035+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "SMARTPHONE SAMSUNG GALAXY S7 FLAT SM-G930FZDLZTO 32GB DOURADO TELA 5.1\" 4G CÂMERA 12 MP", + "ean": null, + "refId": "testefnac", + "id": "1234568028", + "productId": "1000203", + "sellingPrice": 299000, + "price": 299000 + } + ], + "totalValue": 299900, + "paymentNames": null, + "status": "handling", + "statusDescription": "Preparando Entrega", + "marketPlaceOrderId": "", + "sequence": "500973", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2016-10-10T14:23:17.1897068+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v500970llux-01", + "creationDate": "2016-10-10T17:07:59.0889392+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Camiseta GG", + "ean": null, + "refId": "abc1234", + "id": "1234567894", + "productId": "1000187", + "sellingPrice": 899, + "price": 899 + } + ], + "totalValue": 1799, + "paymentNames": null, + "status": "invoiced", + "statusDescription": "Faturado", + "marketPlaceOrderId": "", + "sequence": "500970", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": "2016-10-10T14:13:34.4927265+00:00", + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v500890llux-01", + "creationDate": "2016-08-17T18:35:04.8659804+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Botin Futbol Adidas 11Questra Fg Cesped Hombre Absolut - M", + "ean": "absolutm", + "refId": null, + "id": "549", + "productId": "9", + "sellingPrice": 1000, + "price": 1000 + } + ], + "totalValue": 1000, + "paymentNames": null, + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "", + "sequence": "500890", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + }, + { + "orderId": "v500838llux-01", + "creationDate": "2016-07-29T00:20:47.7736718+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Rooibos Lavanda - Pouch - 50gr", + "ean": "198", + "refId": "10098", + "id": "98", + "productId": "1000025", + "sellingPrice": 5200, + "price": 5200 + } + ], + "totalValue": 6200, + "paymentNames": null, + "status": "canceled", + "statusDescription": "Cancelado", + "marketPlaceOrderId": "", + "sequence": "500838", + "salesChannel": "1", + "affiliateId": "", + "origin": "Marketplace", + "workflowInErrorState": false, + "workflowInRetry": false, + "lastMessageUnread": null, + "ShippingEstimatedDate": null, + "ShippingEstimatedDateMax": null, + "ShippingEstimatedDateMin": null, + "orderIsComplete": true, + "listId": null, + "listType": null, + "authorizedDate": null, + "callCenterOperatorName": null, + "totalItems": 0, + "currencyCode": null + } + ], + "facets": [], + "paging": { + "total": 19, + "pages": 10, + "currentPage": 1, + "perPage": 2 + }, + "stats": { + "stats": { + "totalValue": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + }, + "totalItems": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + } + } + } + } + } + } + } + } + } + }, + "/api/sessions": { + "post": { + "tags": [ + "Session" + ], + "summary": "Create new session", + "description": "Creates a new session and returns a session token and a segment token. Also stores `vtex_session` and `vtex_segment` cookies, with the same values returned in the response.\n\r\n\rAll parameters in the body that are not within the public namespace will be ignored. Query string items will automatically be added to the public namespace.\n\r\n\r>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers in other requests to Session Manager API in order for it to work outside of a browser environment.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", + "operationId": "Createnewsession", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEditSessionRequest" + }, + "example": { + "public": { + "variable1": { + "value": "value1" + }, + "variable2": { + "value": "value2" + } + } + } + } + }, + "required": true + }, + "responses": { + "201": { + "description": "Created", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEditSessionResponse" + }, + "example": { + "sessionToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjM5MEI4MTM1RDUzQ0MwMUY0RjA4N0YwMzA2RjhDODMzNzBDMjY4M0UiLCJ0eXAiOiJqd3QifQ.eyJhY2NvdW50LmlkIjoiYThiMjdmYjQtNjUxNi00Y2MwLTgyYjYtYTVmMmIwMTFlNmUyIiwiaWQiOiIyNmQyY2I2Yy0yMTNlLTQ5MzYtOWUyYS0xZDFlMjk5ZWMzM2IiLCJ2ZXJzaW9uIjoyLCJzdWIiOiJzZXNzaW9uIiwiYWNjb3VudCI6InNlc3Npb24iLCJleHAiOjE2OTM1Nzg5NzYsImlhdCI6MTY5Mjg4Nzc3NiwiaXNzIjoidG9rZW4tZW1pdHRlciIsImp0aSI6IjhiYWU2NzdmLWE0NTAtNGI0OC05YTBkLTViMzAwYjNiY2NkOCJ9.Ak1bn2xEA1A5dVN4qR6RI8vnZpSpLXyVxFCthMoVjmWn0HlP5BqMHEMYApDj8TPPhyxT0hGT0vkmvMQa2Mprrw", + "segmentToken": "eyJjYW1wYWlnbnMiOm51bGwsImNoYW5uZWwiOiIxIiwicHJpY2VUYWJsZXMiOm51bGwsInJlZ2lvbklkIjpudWxsLCJ1dG1fY2FtcGFpZ24iOm51bGwsInV0bV9zb3VyY2UiOm51bGwsInV0bWlfY2FtcGFpZ24iOm51bGwsImN1cnJlbmN5Q29kZSI6IkJSTCIsImN1cnJlbmN5U3ltYm9sIjoiUiQiLCJjb3VudHJ5Q29kZSI6IkJSQSIsImN1bHR1cmVJbmZvIjoiZW4tVVMiLCJjaGFubmVsUHJpdmFjeSI6InB1YmxpYyJ9" + } + } + } + } + }, + "deprecated": false + }, + "get": { + "tags": [ + "Session" + ], + "summary": "Get session", + "description": "Retrieves information from a previously created sesssion.\n\r\n\r>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers to Session Manager API in order for it to work outside of a browser environment.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", + "operationId": "GetSession", + "parameters": [ + { + "name": "items", + "in": "query", + "description": "Items are the keys of the values you wish to get. They follow the format `namespace1.key1,namespace2.key2`.\n\r\n\rIf you wish to recover the data sent on [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it should be `public.{key}`, replacing `{key}` with the name of the custom property you created. Following the example request presented in [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions), it would be `public.variable1,public.variable2`.\n\r\n\rIf you want to retrieve all keys from Session Manager, you can use the wildcard operator (`*`) as a value for this query parameter.", + "required": true, + "style": "form", + "explode": true, + "schema": { + "type": "string", + "example": "*" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/GetSessionResponse" + }, + "example": { + "id": "26d2cb6c-213e-4936-9e2a-1d1e299ec33b", + "namespaces": { + "account": { + "id": { + "value": "a8b27fb4-6516-4cc0-82b6-a5f2b011e6e2", + "keepAlive": true + }, + "accountName": { + "value": "apiexamples" + } + }, + "store": { + "channel": { + "value": "1" + }, + "countryCode": { + "value": "BRA" + }, + "cultureInfo": { + "value": "en-US" + }, + "currencyCode": { + "value": "BRL" + }, + "currencySymbol": { + "value": "R$" + }, + "channelPrivacy": { + "value": "public" + } + }, + "public": { + "variable1": { + "value": "value1" + }, + "variable2": { + "value": "value2" + } + }, + "checkout": { + "regionId": { + "value": "v2.1BB18CE648B5111D0933734ED83EC783" + } + } + } + } + } + } + } + }, + "security": [ + { + "vtex_session": [], + "vtex_segment": [] + } + ], + "deprecated": false + }, + "patch": { + "tags": [ + "Session" + ], + "summary": "Edit session", + "description": "Edits information from a previously created sesssion.\n\r\n\rThis endpoint works the same way as the [Create new session](https://developers.vtex.com/docs/api-reference/session-manager-api#post-/api/sessions) endpoint, but when the request is sent with a `vtex_session` and the `vtex_segment` cookies in the header, it retrieves the session first and then applies the changes instead of generating a new one.\n\r\n\rOnly keys inside the `public` namespace in the request body are considered, and query parameters are automatically added to the public namespace.\n\r\n\r>⚠️ The Session Manager API uses the `vtex_session` and `vtex_segment` cookies to store the data required to identify the user and the session. These cookies are stored in the user's browser when the session is created and sent automatically in every request to that domain. You will have to reproduce that by sending these cookies as headers to Session Manager API in order for it to work outside of a browser environment.\r\n\r\n## Permissions\r\n\r\nThis endpoint does not require [authentication](https://developers.vtex.com/docs/guides/authentication) or [permissions](https://help.vtex.com/en/tutorial/license-manager-resources--3q6ztrC8YynQf6rdc6euk3).", + "operationId": "Editsession", + "parameters": [], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEditSessionRequest" + }, + "example": { + "public": { + "variable2": { + "value": "value2_patched" + }, + "variable3": { + "value": "value3" + } + } + } + } + }, + "required": true + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/CreateEditSessionResponse" + }, + "example": { + "sessionToken": "eyJhbGciOiJFUzI1NiIsImtpZCI6IjM5MEI4MTM1RDUzQ0MwMUY0RjA4N0YwMzA2RjhDODMzNzBDMjY4M0UiLCJ0eXAiOiJqd3QifQ.eyJhY2NvdW50LmlkIjoiYThiMjdmYjQtNjUxNi00Y2MwLTgyYjYtYTVmMmIwMTFlNmUyIiwiaWQiOiIyNmQyY2I2Yy0yMTNlLTQ5MzYtOWUyYS0xZDFlMjk5ZWMzM2IiLCJ2ZXJzaW9uIjoyLCJzdWIiOiJzZXNzaW9uIiwiYWNjb3VudCI6InNlc3Npb24iLCJleHAiOjE2OTM1Nzg5NzYsImlhdCI6MTY5Mjg4Nzc3NiwiaXNzIjoidG9rZW4tZW1pdHRlciIsImp0aSI6IjhiYWU2NzdmLWE0NTAtNGI0OC05YTBkLTViMzAwYjNiY2NkOCJ9.Ak1bn2xEA1A5dVN4qR6RI8vnZpSpLXyVxFCthMoVjmWn0HlP5BqMHEMYApDj8TPPhyxT0hGT0vkmvMQa2Mprrw", + "segmentToken": "eyJjYW1wYWlnbnMiOm51bGwsImNoYW5uZWwiOiIxIiwicHJpY2VUYWJsZXMiOm51bGwsInJlZ2lvbklkIjpudWxsLCJ1dG1fY2FtcGFpZ24iOm51bGwsInV0bV9zb3VyY2UiOm51bGwsInV0bWlfY2FtcGFpZ24iOm51bGwsImN1cnJlbmN5Q29kZSI6IkJSTCIsImN1cnJlbmN5U3ltYm9sIjoiUiQiLCJjb3VudHJ5Q29kZSI6IkJSQSIsImN1bHR1cmVJbmZvIjoiZW4tVVMiLCJjaGFubmVsUHJpdmFjeSI6InB1YmxpYyJ9" + } + } + } + } + }, + "security": [ + { + "vtex_session": [], + "vtex_segment": [] + } + ], + "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" + } + } + } + } + } + }, + "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/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/", + "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": { + "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" + } + } + }, + "schemas": { + "CreateEditSessionRequest": { + "title": "CreateEditSessionRequest", + "required": [ + "public" + ], + "type": "object", + "description": "Session information.", + "properties": { + "public": { + "title": "Public", + "type": "object", + "description": "Public information.", + "additionalProperties": true, + "properties": { + "additionalProperties": { + "type": "object", + "description": "Custom property.", + "properties": { + "value": { + "type": "string", + "description": "Value of the custom property.", + "example": "value3" + } + } + } + }, + "example": { + "variable2": { + "value": "value2" + }, + "variable3": { + "value": "value3" + } + } + } + }, + "example": { + "public": { + "variable2": { + "value": "value2" + }, + "variable3": { + "value": "value3" + } + } + } + }, + "CreateEditSessionResponse": { + "type": "object", + "description": "Object containing session token and segment token.", + "properties": { + "sessionToken": { + "type": "string", + "description": "Token that identifies the user's individual session." + }, + "segmentToken": { + "type": "string", + "description": "Token that identifies the user's segment, shared with other users with similar navigation parameters." + } + } + }, + "GetSessionResponse": { + "type": "object", + "description": "Session information.", + "properties": { + "id": { + "type": "string", + "description": "Session ID." + }, + "namespaces": { + "type": "object", + "description": "Object with namespaces, each containing a set of information about the session.", + "properties": { + "account": { + "type": "object", + "description": "Account information related to the session.", + "properties": { + "id": { + "type": "object", + "description": "VTEX account ID.", + "properties": { + "value": { + "type": "string", + "description": "Value of the VTEX account ID." + }, + "keepAlive": { + "type": "boolean", + "description": "Determines whether or not the connection should be kept alive." + } + } + }, + "accountName": { + "type": "object", + "description": "VTEX account name.", + "properties": { + "value": { + "type": "string", + "description": "Value of the VTEX account name." + } + } + } + } + }, + "store": { + "type": "object", + "description": "Store information related to the session.", + "properties": { + "channel": { + "type": "object", + "description": "[Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID.", + "properties": { + "value": { + "type": "string", + "description": "Value of the [Trade policy](https://help.vtex.com/en/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV) ID." + } + } + }, + "countryCode": { + "type": "object", + "description": "Country code.", + "properties": { + "value": { + "type": "string", + "description": "Value of the country code." + } + } + }, + "cultureInfo": { + "type": "object", + "description": "Locale that provides culture-specific information, such as the language, sublanguage, country/region, calendar, and conventions associated with a particular culture. Read [this documentation](https://learn.microsoft.com/en-us/dotnet/api/system.globalization.cultureinfo?view=net-7.0#culture-names-and-identifiers) for more details.", + "properties": { + "value": { + "type": "string", + "description": "Value of the `cultureInfo` property." + } + } + }, + "currencyCode": { + "type": "object", + "description": "Currency code.", + "properties": { + "value": { + "type": "string", + "description": "Value of the currency code." + } + } + }, + "currencySymbol": { + "type": "object", + "description": "Currency symbol.", + "properties": { + "value": { + "type": "string", + "description": "Value of the currency symbol." + } + } + }, + "channelPrivacy": { + "type": "object", + "description": "Defines whether or not the channel is private.", + "properties": { + "value": { + "type": "string", + "description": "Value containing the channel's privacy option." + } + } + } + } + }, + "public": { + "type": "object", + "description": "Public and editable information related to the session.", + "additionalProperties": { + "type": "object", + "description": "Custom property.", + "properties": { + "value": { + "type": "string", + "description": "Value of the custom property." + } + } + } + }, + "checkout": { + "type": "object", + "description": "Checkout information related to the session.", + "properties": { + "regionId": { + "type": "object", + "description": "ID of the session's region.", + "properties": { + "value": { + "type": "string", + "description": "Value of the Region ID." + } + } + } + } + } + } + } + } + }, + "PickupPoint": { + "type": "object", + "description": "Pickup point information.", + "properties": { + "id": { + "type": "string", + "description": "[Pickup point](https://help.vtex.com/en/tutorial/pickup-points--2fljn6wLjn8M4lJHA6HP3R) ID." + }, + "name": { + "type": "string", + "description": "Pickup point name displayed to customers at checkout." + }, + "description": { + "type": "string", + "description": "Pickup point description displayed to customers at checkout." + }, + "instructions": { + "type": "string", + "description": "Instructions for customers when collecting their package." + }, + "formatted_address": { + "type": "string", + "description": "Formatted address.", + "nullable": true + }, + "address": { + "type": "object", + "description": "Pickup point address information.", + "properties": { + "postalCode": { + "type": "string", + "description": "Pickup point address postal code." + }, + "country": { + "type": "object", + "description": "Information about the pickup point address country.", + "properties": { + "acronym": { + "type": "string", + "description": "Three-digit country code of the pickup point address, in [ISO 3166 ALPHA-3](https://www.iban.com/country-codes) format." + }, + "name": { + "type": "string", + "description": "Country name of the pickup point address." + } + } + }, + "city": { + "type": "string", + "description": "Pickup point address city." + }, + "state": { + "type": "string", + "description": "Pickup point address state." + }, + "neighborhood": { + "type": "string", + "description": "Pickup point address neighborhood." + }, + "street": { + "type": "string", + "description": "Pickup point address street." + }, + "number": { + "type": "string", + "description": "Pickup point address number." + }, + "complement": { + "type": "string", + "description": "Pickup point address complement." + }, + "reference": { + "type": "string", + "description": "Reference point to help the customer find the pickup point." + }, + "location": { + "type": "object", + "description": "Pickup point address geolocation coordinates.", + "properties": { + "latitude": { + "type": "number", + "description": "Latitude coordinate." + }, + "longitude": { + "type": "number", + "description": "Longitude coordinate." + } + } + } + } + }, + "isActive": { + "type": "boolean", + "description": "Defines if the pickup point is active (`true`) or inactive (`false`)." + }, + "distance": { + "type": "number", + "description": "Pickup point configured distance." + }, + "seller": { + "type": "string", + "description": "Seller that corresponds to the pickup point." + }, + "_sort": { + "type": "array", + "description": "Sort array.", + "items": { + "type": "number", + "description": "Pickup point sort information." + } + }, + "businessHours": { + "type": "array", + "description": "Pickup point business hours configurations.", + "items": { + "type": "object", + "description": "Business hours configurations from Monday to Friday.", + "properties": { + "dayOfWeek": { + "type": "integer", + "description": "Day of the week identification, as in `1` = Monday, `2` = Tuesday, `3` = Wednesday, `4` = Thursday, and `5` = Friday." + }, + "openingTime": { + "type": "string", + "description": "Opening time in `HH:MM:SS` format." + }, + "closingTime": { + "type": "string", + "description": "Closing time in `HH:MM:SS` format." + } + } + } + }, + "tagsLabel": { + "type": "array", + "description": "Tags that identify a group of pickup points.", + "items": { + "type": "string", + "description": "Pickup point tag label." + } + }, + "pickupHolidays": { + "type": "array", + "description": "[Holidays](https://help.vtex.com/en/tutorial/registering-holidays--2ItOthSEAoyAmcwsuiO6Yk) configured for the pickup point.", + "items": { + "type": "object", + "description": "Holiday information.", + "properties": { + "date": { + "type": "string", + "description": "Holiday date and time, in [ISO 8601 time zone offset format](https://learn.microsoft.com/en-us/rest/api/storageservices/formatting-datetime-values), as in `YYYY-MM-DDThh:mm:ss.ssZ`." + }, + "hourBegin": { + "type": "string", + "description": "Holiday beginning time in `HH:MM` format." + }, + "hourEnd": { + "type": "string", + "description": "Holiday ending time in `HH:MM` format." + } + } + } + }, + "isThirdPartyPickup": { + "type": "boolean", + "description": "Defines if the pickup point is third-party (`true`) or not (`false`)." + }, + "accountOwnerName": { + "type": "string", + "description": "Account owner name." + }, + "accountOwnerId": { + "type": "string", + "description": "Account owner ID." + }, + "parentAccountName": { + "type": "string", + "description": "Parent account name." + }, + "originalId": { + "type": "string", + "description": "Original ID.", + "nullable": true + } + } + }, + "CreateNewDocument": { + "type": "object", + "properties": { + "Id": { + "type": "string" + }, + "Href": { + "type": "string" + }, + "DocumentId": { + "type": "string" + } + } + }, + "OrderFormSimulationRequest": { + "required": [ + "items", + "country" + ], + "type": "object", + "properties": { + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "Array containing information about the SKUs inside the cart to be simulated." + }, + "country": { + "type": "string" + } + }, + "example": { + "items": [ + { + "id": "{{skuId}}", + "quantity": 1, + "seller": "1" + } + ], + "country": "{{countryCode-ISO-3-digits}}" + } + }, + "Item": { + "title": "Item", + "required": [ + "id", + "quantity", + "seller" + ], + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "The SKU ID." + }, + "quantity": { + "type": "integer", + "format": "int32", + "description": "The quantity of items of this specific SKU in the cart to be simulated." + }, + "seller": { + "type": "string", + "description": "The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin." + } + }, + "example": { + "id": "{{skuId}}", + "quantity": 1, + "seller": "1" + } + }, + "PriceChangeRequest": { + "required": [ + "price" + ], + "type": "object", + "properties": { + "price": { + "type": "integer", + "format": "int32", + "description": "The new price of the item." + } + }, + "example": { + "price": 10000 + } + }, + "SetsinglecustomfieldvalueRequest": { + "required": [ + "value" + ], + "type": "object", + "properties": { + "value": { + "type": "string", + "description": "The value you want to set to the specified field." + } + } + }, + "UpdateorderFormconfigurationRequest": { + "required": [ + "paymentConfiguration", + "taxConfiguration", + "minimumQuantityAccumulatedForItems", + "decimalDigitsPrecision", + "minimumValueAccumulated", + "apps", + "allowMultipleDeliveries", + "allowManualPrice" + ], + "type": "object", + "properties": { + "paymentConfiguration": { + "$ref": "#/components/schemas/PaymentConfiguration" + }, + "taxConfiguration": { + "type": "object", + "description": "External tax service configuration.", + "nullable": true, + "properties": { + "url": { + "type": "string", + "nullable": true, + "description": "Endpoint URL." + }, + "authorizationHeader": { + "type": "string", + "description": "Authorization header.", + "nullable": true + }, + "appId": { + "type": "string", + "description": "Custom data ID sent to the tax system." + } + } + }, + "minimumQuantityAccumulatedForItems": { + "type": "integer", + "format": "int32", + "description": "Minimum SKU quantity by cart." + }, + "decimalDigitsPrecision": { + "type": "integer", + "format": "int32", + "description": "Number of price digits." + }, + "minimumValueAccumulated": { + "type": "integer", + "nullable": true, + "description": "Minimum cart value." + }, + "apps": { + "type": "array", + "nullable": true, + "description": "Array of objects containing Apps configuration information.", + "items": { + "type": "object", + "properties": { + "id": { + "type": "string", + "description": "App ID.", + "example": "birthdayApp" + }, + "fields": { + "type": "array", + "description": "Array of fields available to the app.", + "items": { + "type": "string", + "example": "birthdayField" + } + }, + "major": { + "type": "integer", + "description": "App major version.", + "example": 1 + } + } + } + }, + "allowMultipleDeliveries": { + "type": "boolean", + "nullable": true, + "description": "On the same purchase, allows the selection of items from multiple delivery channels." + }, + "allowManualPrice": { + "type": "boolean", + "nullable": true, + "description": "Allows the editing of SKU prices right in the cart." + }, + "maxNumberOfWhiteLabelSellers": { + "type": "integer", + "description": "Allows the input of a limit of white label sellers involved on the cart." + }, + "maskFirstPurchaseData": { + "type": "boolean", + "description": "Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client doesn't want to share its data." + }, + "recaptchaValidation": { + "type": "string", + "description": "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)\n\r\n\rPossible values are:\n\r- `\"never\"`: no purchases are validated with reCAPTCHA.\n\r- `\"always\"`: every purchase is validated with reCAPTCHA.\n\r- `\"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.", + "default": "vtexCriteria" + }, + "requiresLoginToPlaceOrder": { + "type": "boolean", + "description": "Indicates whether authentication is required for completing purchases." + }, + "minimumPurchaseDowntimeSeconds": { + "type": "integer", + "description": "Minimum interval (in seconds) between successive purchases." + }, + "cartAgeToUseNewCardSeconds": { + "type": "integer", + "description": "Minimum cart existence period (in seconds) before allowing the use of a new credit card." + }, + "paymentSystemToCheckFirstInstallment": { + "type": "string", + "description": "If you want to apply a first installment discount to a particular payment system, set this field to that payment system's ID. Learn more: [Configuring a discount for orders prepaid in full](https://help.vtex.com/en/tutorial/configurar-desconto-de-preco-a-vista--7Lfcj9Wb5dpYfA2gKkACIt).", + "example": "6" + } + }, + "example": { + "paymentConfiguration": { + "requiresAuthenticationForPreAuthorizedPaymentOption": false + }, + "taxConfiguration": null, + "minimumQuantityAccumulatedForItems": 1, + "decimalDigitsPrecision": 2, + "minimumValueAccumulated": null, + "apps": null, + "allowMultipleDeliveries": null, + "allowManualPrice": null + } + }, + "PaymentConfiguration": { + "title": "PaymentConfiguration", + "description": "Payment Configuration object", + "required": [ + "requiresAuthenticationForPreAuthorizedPaymentOption" + ], + "type": "object", + "properties": { + "requiresAuthenticationForPreAuthorizedPaymentOption": { + "type": "boolean", + "description": "Determines whether pre-authorized payments require authentication" + }, + "allowInstallmentsMerge": { + "type": "boolean", + "description": "By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installments options configured by every seller will be available. When `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those don't match. Installment values may not be equal in this case." + } + }, + "example": { + "requiresAuthenticationForPreAuthorizedPaymentOption": false, + "allowInstallmentsMerge": false + } + }, + "WaitingTime": { + "type": "object", + "required": [ + "waitingTime" + ], + "properties": { + "waitingTime": { + "type": "integer", + "description": "Number of days after order cancelation by a seller, during which another seller may be assigned to fulfill the order." + } + } + }, + "SKUFileURL": { + "type": "object", + "required": [ + "Name", + "Url" + ], + "properties": { + "IsMain": { + "type": "boolean", + "description": "Defines if the Image is the main image of the SKU.", + "example": true + }, + "Label": { + "type": "string", + "description": "SKU image label.", + "example": "Main" + }, + "Name": { + "type": "string", + "description": "SKU image name.", + "example": "Nike-Red-Janoski-1" + }, + "Text": { + "type": "string", + "description": "General text of the image.", + "example": "Nike-Red-Janoski", + "nullable": true + }, + "Url": { + "type": "string", + "description": "External Image's URL. The URL must start with the protocol identifier (`http://` or `https://`) and end with the file extension (`.jpg`, `.png` or `.gif`).", + "example": "https://m.media-amazon.com/images/I/610G2-sJx5L._AC_UX695_.jpg" + } + } + }, + "SKUFile": { + "type": "string", + "format": "binary", + "description": "The image file has a size limit of 3200 x 3200 pixels." + }, + "GetCategoryTree": { + "required": [ + "id", + "name", + "hasChildren", + "url", + "children", + "Title", + "MetaTagDescription" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "Category ID.", + "example": 1 + }, + "name": { + "type": "string", + "description": "Category name.", + "example": "Toys" + }, + "hasChildren": { + "type": "boolean", + "description": "If the category has a category child (`true`) or not (`false`).", + "example": true + }, + "url": { + "type": "string", + "description": "Category URL.", + "example": "https://lojadobreno.vtexcommercestable.com.br/toys" + }, + "children": { + "type": "array", + "items": { + "$ref": "#/components/schemas/GetCategoryTreeChild" + }, + "description": "Array with information about the category's children." + }, + "Title": { + "type": "string", + "description": "Category page title.", + "example": "Toys" + }, + "MetaTagDescription": { + "type": "string", + "description": "Category page Meta tag description.", + "example": "New and used toys for sale." + } + }, + "example": { + "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": "" + } + }, + "GetCategoryTreeChild": { + "required": [ + "id", + "name", + "hasChildren", + "url", + "children", + "Title", + "MetaTagDescription" + ], + "type": "object", + "properties": { + "id": { + "type": "integer", + "format": "int32", + "description": "Category ID.", + "example": 1 + }, + "name": { + "type": "string", + "description": "Category name.", + "example": "Dolls" + }, + "hasChildren": { + "type": "boolean", + "description": "If the category has a category child (`true`) or not (`false`).", + "example": true + }, + "url": { + "type": "string", + "description": "Category URL.", + "example": "https://lojadobreno.vtexcommercestable.com.br/dolls" + }, + "children": { + "type": "array", + "description": "Array with information about the category's children.", + "items": {} + }, + "Title": { + "type": "string", + "description": "Category page title.", + "example": "Dolls" + }, + "MetaTagDescription": { + "type": "string", + "description": "Category page Meta tag description.", + "example": "New and used dolls for sale." + } + }, + "example": { + "id": 78, + "name": "Xbox 360", + "hasChildren": false, + "url": "https://ambienteqa.vtexcommercestable.com.br/games/xbox-360", + "children": [ + { + "id": 79, + "name": "Consoles", + "hasChildren": false, + "url": "https://ambienteqa.vtexcommercestable.com.br/games/xbox-360/consoles", + "children": [] + }, + { + "id": 126, + "name": "Acessorio", + "hasChildren": false, + "url": "https://ambienteqa.vtexcommercestable.com.br/games/xbox-360/acessorio", + "children": [] + } + ], + "Title": "Games", + "MetaTagDescription": "Video games." + } + }, + "Category": { + "required": [ + "Id", + "Name", + "FatherCategoryId", + "Title", + "Description", + "Keywords", + "IsActive", + "LomadeeCampaignCode", + "AdWordsRemarketingCode", + "ShowInStoreFront", + "ShowBrandFilter", + "ActiveStoreFrontLink", + "GlobalCategoryId", + "StockKeepingUnitSelectionMode", + "Score", + "LinkId", + "HasChildren" + ], + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Category ID." + }, + "Name": { + "type": "string", + "description": "Category name." + }, + "FatherCategoryId": { + "type": "integer", + "description": "ID of the father category, apply in case of category and subcategory.", + "nullable": true + }, + "Title": { + "type": "string", + "description": "Category page title." + }, + "Description": { + "type": "string", + "description": "Describes details about the category." + }, + "Keywords": { + "type": "string", + "description": "Substitutes words for the category." + }, + "IsActive": { + "type": "boolean", + "description": "Shows if the category is active (`true`) or not (`false`)." + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true + }, + "ShowInStoreFront": { + "type": "boolean", + "description": "Defines if the category is shown on side and upper menu (`true`) or not (`false`)." + }, + "ShowBrandFilter": { + "type": "boolean", + "description": "Defines if the category has brand filter (`true`) or not (`false`)." + }, + "ActiveStoreFrontLink": { + "type": "boolean", + "description": "Defines if the Category has an active link on the website (`true`) or not (`false`)." + }, + "GlobalCategoryId": { + "type": "integer", + "description": "Google Global Category ID." + }, + "StockKeepingUnitSelectionMode": { + "type": "string", + "description": "Defines how the SKU will be exhibited." + }, + "Score": { + "type": "integer", + "description": "Score for search ordination.", + "nullable": true + }, + "LinkId": { + "type": "string", + "description": "Text Link.", + "nullable": true + }, + "HasChildren": { + "type": "boolean", + "description": "Defines if the category has child categories (`true`) or not (`false`)." + } + }, + "example": { + "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 + } + }, + "CreateCategoryRequest": { + "type": "object", + "required": [ + "Name", + "Keywords", + "Title", + "Description", + "AdWordsRemarketingCode", + "LomadeeCampaignCode", + "FatherCategoryId", + "GlobalCategoryId", + "ShowInStoreFront", + "IsActive", + "ActiveStoreFrontLink", + "ShowBrandFilter", + "Score", + "StockKeepingUnitSelectionMode" + ], + "properties": { + "Id": { + "type": "integer", + "description": "Category unique identifier. If not informed, it will be automatically generated by VTEX.", + "example": 1 + }, + "Name": { + "type": "string", + "description": "Category name.", + "example": "Home Appliances" + }, + "Keywords": { + "type": "string", + "description": "Substitute words for the Category.", + "example": "Kitchen, Laundry, Appliances" + }, + "Title": { + "type": "string", + "description": "Text used in title tag for Category page.", + "example": "Home Appliances" + }, + "Description": { + "type": "string", + "description": "Text used in meta description tag for Category page.", + "example": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now." + }, + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "example": "Sale", + "nullable": true, + "deprecated": true + }, + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "example": "Sale", + "nullable": true, + "deprecated": true + }, + "FatherCategoryId": { + "type": "integer", + "description": "ID of the parent category, apply in case of category and subcategory.", + "example": 2, + "nullable": true + }, + "GlobalCategoryId": { + "type": "integer", + "description": "Google Global Category ID.", + "example": 222 + }, + "ShowInStoreFront": { + "type": "boolean", + "description": "If true, the Category is shown in the top and side menu.", + "example": true + }, + "IsActive": { + "type": "boolean", + "description": "If true, the Category page becomes available in store.", + "example": true + }, + "ActiveStoreFrontLink": { + "type": "boolean", + "description": "If true, the Category link becomes active in store.", + "example": true + }, + "ShowBrandFilter": { + "type": "boolean", + "description": "If true, the Category page displays a Brand filter.", + "example": true + }, + "Score": { + "type": "integer", + "description": "Score for search sorting order.", + "nullable": true, + "example": 3 + }, + "StockKeepingUnitSelectionMode": { + "type": "string", + "description": "Defines how the SKU will be exhibited", + "example": "SPECIFICATION" + } + }, + "example": { + "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": 800, + "StockKeepingUnitSelectionMode": "SPECIFICATION", + "Score": null + } + }, + "GetorUpdateProductSpecification": { + "required": [ + "Value" + ], + "type": "object", + "properties": { + "Value": { + "type": "array", + "description": "Array with Specification values.", + "items": { + "type": "string", + "description": "Specification value.", + "example": "Cotton" + } + }, + "Id": { + "type": "integer", + "format": "int32", + "description": "Specification field ID, which is the same as `FieldId` in other specification endpoints.", + "example": 7 + }, + "Name": { + "type": "string", + "description": "Name of the Specification.", + "example": "Fabric" + } + }, + "example": { + "Value": [ + "Iron", + "Plastic" + ], + "Id": 30, + "Name": "Material" + } + }, + "GetSKUandContext": { + "required": [ + "Id", + "ProductId", + "NameComplete", + "ProductName", + "ProductDescription", + "SkuName", + "IsActive", + "IsTransported", + "IsInventoried", + "IsGiftCardRecharge", + "ImageUrl", + "DetailUrl", + "CSCIdentification", + "BrandId", + "BrandName", + "Dimension", + "RealDimension", + "ManufacturerCode", + "IsKit", + "KitItems", + "Services", + "Categories", + "Attachments", + "Collections", + "SkuSellers", + "SalesChannels", + "Images", + "SkuSpecifications", + "ProductSpecifications", + "ProductClustersIds", + "ProductCategoryIds", + "ProductGlobalCategoryId", + "ProductCategories", + "CommercialConditionId", + "RewardValue", + "AlternateIds", + "AlternateIdValues", + "EstimatedDateArrival", + "MeasurementUnit", + "UnitMultiplier", + "InformationSource", + "ModalType" + ], + "type": "object", + "properties": { + "Id": { + "type": "integer", + "format": "int32", + "description": "SKU ID." + }, + "ProductId": { + "type": "integer", + "format": "int32", + "description": "ID of the related Product." + }, + "NameComplete": { + "type": "string", + "description": "Product Name and SKU Name concatenated." + }, + "ComplementName": { + "type": "string", + "description": "Product Complement Name." + }, + "ProductName": { + "type": "string", + "description": "Product Name." + }, + "ProductDescription": { + "type": "string", + "description": "Product Description. HTML is allowed." + }, + "ProductRefId": { + "type": "string", + "description": "Reference ID of the related Product." + }, + "TaxCode": { + "type": "string", + "description": "SKU Tax Code." + }, + "SkuName": { + "type": "string", + "description": "SKU Name." + }, + "IsActive": { + "type": "boolean", + "description": "Defines if the SKU is active or not." + }, + "IsTransported": { + "type": "boolean", + "nullable": true, + "deprecated": true + }, + "IsInventoried": { + "type": "boolean", + "nullable": true, + "deprecated": true + }, + "IsGiftCardRecharge": { + "type": "boolean", + "description": "Defines if the purchase will generate a reward." + }, + "ImageUrl": { + "type": "string", + "description": "SKU image URL." + }, + "DetailUrl": { + "type": "string", + "description": "Product URL." + }, + "CSCIdentification": { + "type": "string", + "nullable": true, + "description": "SKU Seller identification." + }, + "BrandId": { + "type": "string", + "description": "Product Brand ID." + }, + "BrandName": { + "type": "string", + "description": "Product Brand Name." + }, + "Dimension": { + "$ref": "#/components/schemas/Dimension" + }, + "RealDimension": { + "$ref": "#/components/schemas/RealDimension" + }, + "ManufacturerCode": { + "type": "string", + "description": "Product Supplier ID." + }, + "IsKit": { + "type": "boolean", + "description": "Defines if the SKU is part of a bundle." + }, + "KitItems": { + "type": "array", + "items": { + "type": "string", + "description": "SKU ID." + }, + "description": "Array with SKU IDs of bundle components." + }, + "Services": { + "type": "array", + "items": { + "type": "string", + "description": "Service ID." + }, + "description": "Array with Service IDs that are related to the SKU." + }, + "Categories": { + "type": "array", + "items": { + "type": "string", + "description": "Category ID." + }, + "description": "Array with Categories from the related Product." + }, + "Attachments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Attachment" + }, + "description": "Array with Attachments ID that are related to the SKU." + }, + "Collections": { + "type": "array", + "items": { + "type": "string", + "description": "Collection ID." + }, + "description": "Array with Collections ID that are related to the Product." + }, + "SkuSellers": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SkuSeller" + }, + "description": "Array with SKU Sellers data." + }, + "SalesChannels": { + "type": "array", + "items": { + "type": "integer", + "format": "int32" + }, + "description": "Array with the ID of all the Sales Channels that are related to the product." + }, + "Images": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Image" + }, + "description": "Array with SKU images." + }, + "SkuSpecifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SkuSpecification" + }, + "description": "Array with related SKU Specifications." + }, + "ProductSpecifications": { + "type": "array", + "items": { + "$ref": "#/components/schemas/ProductSpecification" + }, + "description": "Array with related Product Specifications." + }, + "ProductClusterNames": { + "type": "object", + "additionalProperties": { + "type": "string", + "description": "Collection ID", + "additionalProperties": { + "type": "string", + "description": "Category Name." + } + } + }, + "ProductClustersIds": { + "type": "string", + "description": "Product Clusters IDs." + }, + "ProductCategoryIds": { + "type": "string", + "description": "Category Hierarchy with Category IDs." + }, + "ProductGlobalCategoryId": { + "type": "integer", + "nullable": true, + "description": "Global Category ID." + }, + "ProductCategories": { + "type": "object", + "description": "Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\".", + "additionalProperties": { + "type": "string", + "description": "Category ID.", + "additionalProperties": { + "type": "string", + "description": "Category Name." + } + } + }, + "CommercialConditionId": { + "type": "integer", + "format": "int32", + "description": "SKU Commercial Condition ID." + }, + "RewardValue": { + "type": "number", + "description": "Reward value related to the SKU." + }, + "AlternateIds": { + "$ref": "#/components/schemas/AlternateIds" + }, + "AlternateIdValues": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array with values of alternative SKU IDs." + }, + "EstimatedDateArrival": { + "type": "string", + "nullable": true, + "description": "To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date." + }, + "MeasurementUnit": { + "type": "string", + "description": "SKU Measurement Unit." + }, + "UnitMultiplier": { + "type": "number", + "description": "This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward." + }, + "InformationSource": { + "type": "string", + "description": "Information Source.", + "nullable": true + }, + "ModalType": { + "type": "string", + "nullable": true, + "description": "Modal Type." + }, + "KeyWords": { + "type": "string", + "nullable": true, + "description": "Keywords related to the product." + }, + "ReleaseDate": { + "type": "string", + "nullable": true, + "description": "Release date of the product." + }, + "ProductIsVisible": { + "type": "boolean", + "description": "Defines if the product is visible or not." + }, + "ShowIfNotAvailable": { + "type": "boolean", + "description": "Defines if the product will be shown if it is not available." + }, + "IsProductActive": { + "type": "boolean", + "description": "Defines if the product is active or not." + }, + "ProductFinalScore": { + "type": "integer", + "description": "Product Final Score." + } + }, + "example": { + "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 + } + }, + "Dimension": { + "required": [ + "cubicweight", + "height", + "length", + "weight", + "width" + ], + "type": "object", + "description": "Object containing the SKU dimensions to be used on the shipping calculation.", + "properties": { + "cubicweight": { + "type": "number", + "description": "SKU Cubic Weight." + }, + "height": { + "type": "number", + "description": "SKU Height." + }, + "length": { + "type": "number", + "description": "SKU Length." + }, + "weight": { + "type": "number", + "description": "SKU Weight." + }, + "width": { + "type": "number", + "description": "SKU Width." + } + }, + "example": { + "cubicweight": 81.6833, + "height": 65, + "length": 58, + "weight": 10000, + "width": 130 + } + }, + "RealDimension": { + "required": [ + "realCubicWeight", + "realHeight", + "realLength", + "realWeight", + "realWidth" + ], + "type": "object", + "description": "Object containing the real SKU dimensions, which appear in the product page.", + "properties": { + "realCubicWeight": { + "type": "number", + "description": "Real SKU Cubic Weight." + }, + "realHeight": { + "type": "number", + "description": "Real SKU Height." + }, + "realLength": { + "type": "number", + "description": "Real SKU Length." + }, + "realWeight": { + "type": "number", + "description": "Real SKU Weight." + }, + "realWidth": { + "type": "number", + "description": "Real SKU Width." + } + }, + "example": { + "realCubicWeight": 274.1375, + "realHeight": 241, + "realLength": 65, + "realWeight": 9800, + "realWidth": 105 + } + }, + "Attachment": { + "required": [ + "Id", + "Name", + "Keys", + "Fields", + "IsActive", + "IsRequired" + ], + "type": "object", + "description": "Object containing information about SKU attachments.", + "properties": { + "Id": { + "type": "integer", + "format": "int32", + "description": "Attachment ID." + }, + "Name": { + "type": "string", + "description": "Attachment Name." + }, + "Keys": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Attachment Keys." + }, + "Fields": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Field" + }, + "description": "Array containing Attachment fields." + }, + "IsActive": { + "type": "boolean", + "description": "Defines if the Attachment is active or not." + }, + "IsRequired": { + "type": "boolean", + "description": "Defines if the Attachment is required or not." + } + }, + "example": { + "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 + } + }, + "Field": { + "required": [ + "FieldName", + "MaxCaracters", + "DomainValues" + ], + "type": "object", + "properties": { + "FieldName": { + "type": "string", + "description": "Attachment field name." + }, + "MaxCaracters": { + "type": "string", + "description": "Maximum number of characters accepted in the attachment field." + }, + "DomainValues": { + "type": "string", + "nullable": true, + "description": "Allowed key values." + } + }, + "example": { + "FieldName": "nome", + "MaxCaracters": "20", + "DomainValues": "Adalberto,Pedro,João" + } + }, + "IdHrefDocumentID": { + "type": "object", + "description": "Document information.", + "properties": { + "Id": { + "type": "string", + "description": "ID of the document that was created, with data entity prefix." + }, + "Href": { + "type": "string", + "description": "Document reference URL." + }, + "DocumentId": { + "type": "string", + "description": "Unique identifier of the document." + } + } + }, + "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." + } + } + }, + "SkuSeller": { + "required": [ + "SellerId", + "StockKeepingUnitId", + "SellerStockKeepingUnitId", + "IsActive", + "FreightCommissionPercentage", + "ProductCommissionPercentage" + ], + "type": "object", + "description": "Object containing related SKU Sellers data.", + "properties": { + "SellerId": { + "type": "string", + "description": "SKU Seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID." + }, + "StockKeepingUnitId": { + "type": "integer", + "format": "int32", + "description": "SKU ID." + }, + "SellerStockKeepingUnitId": { + "type": "string", + "description": "SKU ID for the SKU Seller." + }, + "IsActive": { + "type": "boolean", + "description": "Defines if the SKU is active." + }, + "FreightCommissionPercentage": { + "type": "number", + "description": "Registered value for Seller Freight Commission." + }, + "ProductCommissionPercentage": { + "type": "number", + "description": "Registered value for Seller Product Commission." + } + }, + "example": { + "SellerId": "1", + "StockKeepingUnitId": 2001773, + "SellerStockKeepingUnitId": "2001773", + "IsActive": true, + "FreightCommissionPercentage": 0, + "ProductCommissionPercentage": 0 + } + }, + "Image": { "required": [ - "items", - "country" + "ImageUrl", + "ImageName", + "FileId" ], "type": "object", + "description": "Object containing SKU images details.", "properties": { - "items": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Item" - }, - "description": "Array containing information about the SKUs inside the cart to be simulated." + "ImageUrl": { + "type": "string", + "description": "Image URL." }, - "country": { - "type": "string" + "ImageName": { + "type": "string", + "description": "Image label.", + "nullable": true + }, + "FileId": { + "type": "integer", + "format": "int32", + "description": "SKU image ID." } }, "example": { - "items": [ - { - "id": "{{skuId}}", - "quantity": 1, - "seller": "1" - } - ], - "country": "{{countryCode-ISO-3-digits}}" + "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", + "ImageName": "", + "FileId": 168952 } }, - "Item": { - "title": "Item", + "SkuSpecification": { "required": [ - "id", - "quantity", - "seller" + "FieldId", + "FieldName", + "FieldValueIds", + "FieldValues" ], "type": "object", + "description": "Object containing related SKU Specifications.", "properties": { - "id": { - "type": "string", - "description": "The SKU ID." - }, - "quantity": { + "FieldId": { "type": "integer", "format": "int32", - "description": "The quantity of items of this specific SKU in the cart to be simulated." + "description": "Specification field ID." }, - "seller": { + "FieldName": { "type": "string", - "description": "The ID of the seller responsible for this SKU. This ID can be found in your VTEX Admin." + "description": "Specification field Name." + }, + "FieldValueIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32", + "description": "Specification Value ID." + }, + "description": "Array with related Specification Values IDs." + }, + "FieldValues": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array with related Specification Values." } }, "example": { - "id": "{{skuId}}", - "quantity": 1, - "seller": "1" + "FieldId": 102, + "FieldName": "Cor", + "FieldValueIds": [ + 266 + ], + "FieldValues": [ + "Padrão" + ] } }, - "PriceChangeRequest": { + "ProductSpecification": { "required": [ - "price" + "FieldId", + "FieldName", + "FieldValueIds", + "FieldValues" ], "type": "object", "properties": { - "price": { + "FieldId": { "type": "integer", "format": "int32", - "description": "The new price of the item." + "description": "Specification field ID." + }, + "FieldName": { + "type": "string", + "description": "Specification name. Limited to 100 characters." + }, + "FieldValueIds": { + "type": "array", + "items": { + "type": "integer", + "format": "int32", + "description": "Specification Value ID." + }, + "description": "Array with related Specification Values IDs." + }, + "FieldValues": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array with related Specification Values." } }, "example": { - "price": 10000 + "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" + ] } }, - "SetsinglecustomfieldvalueRequest": { - "required": [ - "value" - ], + "AlternateIds": { "type": "object", + "description": "Array with alternate SKU IDs, such as EAN and RefId.", "properties": { - "value": { + "Ean": { "type": "string", - "description": "The value you want to set to the specified field." + "description": "SKU EAN." + }, + "RefId": { + "type": "string", + "description": "SKU Reference ID." } + }, + "example": { + "Ean": "8781", + "RefId": "878181" } }, - "UpdateorderFormconfigurationRequest": { + "GetSKUAltID": { "required": [ - "paymentConfiguration", - "taxConfiguration", - "minimumQuantityAccumulatedForItems", - "decimalDigitsPrecision", - "minimumValueAccumulated", - "apps", - "allowMultipleDeliveries", - "allowManualPrice" + "Id", + "ProductId", + "NameComplete", + "ProductName", + "ProductDescription", + "SkuName", + "IsActive", + "IsTransported", + "IsInventoried", + "IsGiftCardRecharge", + "ImageUrl", + "DetailUrl", + "CSCIdentification", + "BrandId", + "BrandName", + "Dimension", + "RealDimension", + "ManufacturerCode", + "IsKit", + "KitItems", + "Services", + "Categories", + "Attachments", + "Collections", + "SkuSellers", + "SalesChannels", + "Images", + "SkuSpecifications", + "ProductSpecifications", + "ProductClustersIds", + "ProductCategoryIds", + "ProductGlobalCategoryId", + "ProductCategories", + "CommercialConditionId", + "RewardValue", + "AlternateIds", + "AlternateIdValues", + "EstimatedDateArrival", + "MeasurementUnit", + "UnitMultiplier", + "InformationSource", + "ModalType" ], "type": "object", "properties": { - "paymentConfiguration": { - "$ref": "#/components/schemas/PaymentConfiguration" - }, - "taxConfiguration": { - "type": "object", - "description": "External tax service configuration.", - "nullable": true, - "properties": { - "url": { - "type": "string", - "nullable": true, - "description": "Endpoint URL." - }, - "authorizationHeader": { - "type": "string", - "description": "Authorization header.", - "nullable": true - }, - "appId": { - "type": "string", - "description": "Custom data ID sent to the tax system." - } - } - }, - "minimumQuantityAccumulatedForItems": { + "Id": { "type": "integer", "format": "int32", - "description": "Minimum SKU quantity by cart." + "description": "SKU ID." }, - "decimalDigitsPrecision": { + "ProductId": { "type": "integer", "format": "int32", - "description": "Number of price digits." + "description": "Product ID." }, - "minimumValueAccumulated": { - "type": "integer", - "nullable": true, - "description": "Minimum cart value." + "NameComplete": { + "type": "string", + "description": "Product Name and SKU Name combined." }, - "apps": { - "type": "array", - "nullable": true, - "description": "Array of objects containing Apps configuration information.", - "items": { - "type": "object", - "properties": { - "id": { - "type": "string", - "description": "App ID.", - "example": "birthdayApp" - }, - "fields": { - "type": "array", - "description": "Array of fields available to the app.", - "items": { - "type": "string", - "example": "birthdayField" - } - }, - "major": { - "type": "integer", - "description": "App major version.", - "example": 1 - } - } - } + "ComplementName": { + "type": "string", + "description": "Product Complement Name." }, - "allowMultipleDeliveries": { + "ProductName": { + "type": "string", + "description": "Product Name." + }, + "ProductDescription": { + "type": "string", + "description": "Product Description. HTML is allowed." + }, + "ProductRefId": { + "type": "string", + "description": "Product Reference ID." + }, + "TaxCode": { + "type": "string", + "description": "SKU Tax Code." + }, + "SkuName": { + "type": "string", + "description": "SKU Name." + }, + "IsActive": { "type": "boolean", - "nullable": true, - "description": "On the same purchase, allows the selection of items from multiple delivery channels." + "description": "Defines if the SKU is active or not." }, - "allowManualPrice": { + "IsTransported": { + "type": "boolean", + "deprecated": true + }, + "IsInventoried": { + "type": "boolean", + "deprecated": true + }, + "IsGiftCardRecharge": { "type": "boolean", + "description": "Defines if the purchase of the SKU will generate reward value for the customer." + }, + "ImageUrl": { + "type": "string", + "description": "SKU image URL." + }, + "DetailUrl": { + "type": "string", + "description": "Product slug." + }, + "CSCIdentification": { + "type": "string", "nullable": true, - "description": "Allows the editing of SKU prices right in the cart." + "description": "SKU Seller Identification." }, - "maxNumberOfWhiteLabelSellers": { - "type": "integer", - "description": "Allows the input of a limit of white label sellers involved on the cart." + "BrandId": { + "type": "string", + "description": "Brand ID." }, - "maskFirstPurchaseData": { + "BrandName": { + "type": "string", + "description": "Brand Name." + }, + "Dimension": { + "$ref": "#/components/schemas/Dimension" + }, + "RealDimension": { + "$ref": "#/components/schemas/RealDimension" + }, + "ManufacturerCode": { + "type": "string", + "description": "Product Supplier ID." + }, + "IsKit": { "type": "boolean", - "description": "Allows, on a first purchase, masking client's data. It could be useful when a shared cart is used and the client doesn't want to share its data." + "description": "Defines if the SKU is part of a bundle." }, - "recaptchaValidation": { + "KitItems": { + "type": "array", + "description": "Array with SKU IDs of bundle components.", + "items": { + "type": "string", + "description": "SKU ID of each bundle component." + } + }, + "Services": { + "type": "array", + "description": "Array with Service IDs that are related to the SKU.", + "items": { + "type": "string", + "description": "Service IDs of each service related to the SKU." + } + }, + "Categories": { + "type": "array", + "description": "Categories of the related product.", + "items": { + "type": "string", + "description": "Category ID." + } + }, + "CategoriesFullPath": { + "type": "array", + "description": "Path of Categories of the related product.", + "items": { + "type": "string", + "description": "Path composed by Category IDs separated by `/`." + } + }, + "Attachments": { + "type": "array", + "description": "Array with Attachments ID that are related to the SKU.", + "items": { + "$ref": "#/components/schemas/Attachment" + } + }, + "Collections": { + "type": "array", + "description": "Array with Collections IDs that are related to the Product.", + "items": { + "type": "string", + "description": "Collection ID." + } + }, + "SkuSellers": { + "type": "array", + "description": "Array with related Sellers data.", + "items": { + "$ref": "#/components/schemas/SkuSeller" + } + }, + "SalesChannels": { + "type": "array", + "description": "Array of trade policy IDs.", + "items": { + "type": "integer", + "format": "int32", + "description": "Trade policy ID." + } + }, + "Images": { + "type": "array", + "description": "Array of objects with SKU image details.", + "items": { + "$ref": "#/components/schemas/Image" + } + }, + "SkuSpecifications": { + "type": "array", + "description": "Array with related SKU Specifications.", + "items": { + "$ref": "#/components/schemas/SkuSpecification" + } + }, + "ProductSpecifications": { + "type": "array", + "description": "Array with related Product Specifications.", + "items": { + "$ref": "#/components/schemas/ProductSpecification" + } + }, + "ProductClustersIds": { + "type": "string", + "description": "Product Cluster IDs separated by comma (`,`)." + }, + "PositionsInClusters": { + "type": "object", + "description": "Product Clusters position in each Cluster. Structure: \"{Product Cluster ID}\": {Position}.\n\n`{Product Cluster ID}` is a string, while `{Position}` is an integer.", + "additionalProperties": { + "type": "integer", + "description": "Product Cluster ID.", + "additionalProperties": { + "type": "integer", + "description": "Position." + } + } + }, + "ProductClusterNames": { + "type": "object", + "description": "Product Clusters Names. Structure: \"{Product Cluster ID}\": \"{Product Cluster Name}\". Both the key and the value are strings.", + "additionalProperties": { + "type": "string", + "description": "Product Cluster ID.", + "additionalProperties": { + "type": "string", + "description": "Product Cluster Name." + } + } + }, + "ProductClusterHighlights": { + "type": "object", + "description": "Product Clusters Highlights. Structure: \"{Product Cluster ID}\": \"{Product Cluster Name}\". Both the key and the value are strings.", + "additionalProperties": { + "type": "string", + "description": "Product Cluster ID.", + "additionalProperties": { + "type": "string", + "description": "Product Cluster Highlight." + } + } + }, + "ProductCategoryIds": { "type": "string", - "description": "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)\n\r\n\rPossible values are:\n\r- `\"never\"`: no purchases are validated with reCAPTCHA.\n\r- `\"always\"`: every purchase is validated with reCAPTCHA.\n\r- `\"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.", - "default": "vtexCriteria" + "description": "Category path composed by category IDs separated by `/`." }, - "requiresLoginToPlaceOrder": { + "IsDirectCategoryActive": { "type": "boolean", - "description": "Indicates whether authentication is required for completing purchases." + "description": "Indicates if the direct Product Category is active or not." }, - "minimumPurchaseDowntimeSeconds": { + "ProductGlobalCategoryId": { "type": "integer", - "description": "Minimum interval (in seconds) between successive purchases." + "nullable": true, + "description": "Product Global Category ID." }, - "cartAgeToUseNewCardSeconds": { + "ProductCategories": { + "type": "object", + "description": "Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\". Both the key and the value are strings.", + "additionalProperties": { + "type": "string", + "description": "Category ID.", + "additionalProperties": { + "type": "string", + "description": "Category Name." + } + } + }, + "CommercialConditionId": { "type": "integer", - "description": "Minimum cart existence period (in seconds) before allowing the use of a new credit card." + "format": "int32", + "description": "SKU Commercial Condition ID." }, - "paymentSystemToCheckFirstInstallment": { - "type": "string", - "description": "If you want to apply a first installment discount to a particular payment system, set this field to that payment system's ID. Learn more: [Configuring a discount for orders prepaid in full](https://help.vtex.com/en/tutorial/configurar-desconto-de-preco-a-vista--7Lfcj9Wb5dpYfA2gKkACIt).", - "example": "6" - } - }, - "example": { - "paymentConfiguration": { - "requiresAuthenticationForPreAuthorizedPaymentOption": false + "RewardValue": { + "type": "number", + "description": "Reward value related to the SKU." }, - "taxConfiguration": null, - "minimumQuantityAccumulatedForItems": 1, - "decimalDigitsPrecision": 2, - "minimumValueAccumulated": null, - "apps": null, - "allowMultipleDeliveries": null, - "allowManualPrice": null - } - }, - "PaymentConfiguration": { - "title": "PaymentConfiguration", - "description": "Payment Configuration object", - "required": [ - "requiresAuthenticationForPreAuthorizedPaymentOption" - ], - "type": "object", - "properties": { - "requiresAuthenticationForPreAuthorizedPaymentOption": { - "type": "boolean", - "description": "Determines whether pre-authorized payments require authentication" + "AlternateIds": { + "$ref": "#/components/schemas/AlternateIds" }, - "allowInstallmentsMerge": { - "type": "boolean", - "description": "By default (when `false`), on a multi-seller purchase is on the run, a simple intersection with installments options configured by every seller will be available. When `true`, this option allows a more complex but flexible installment option, since it considers max installments of every seller configuration, even if those don't match. Installment values may not be equal in this case." - } - }, - "example": { - "requiresAuthenticationForPreAuthorizedPaymentOption": false, - "allowInstallmentsMerge": false - } - }, - "WaitingTime": { - "type": "object", - "required": [ - "waitingTime" - ], - "properties": { - "waitingTime": { - "type": "integer", - "description": "Number of days after order cancelation by a seller, during which another seller may be assigned to fulfill the order." - } - } - }, - "SKUFileURL": { - "type": "object", - "required": [ - "Name", - "Url" - ], - "properties": { - "IsMain": { - "type": "boolean", - "description": "Defines if the Image is the main image of the SKU.", - "example": true + "AlternateIdValues": { + "type": "array", + "description": "Array with values of alternative SKU IDs.", + "items": { + "type": "string", + "description": "Alternative SKU ID." + } }, - "Label": { + "EstimatedDateArrival": { "type": "string", - "description": "SKU image label.", - "example": "Main" + "nullable": true, + "description": "SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date." }, - "Name": { + "MeasurementUnit": { "type": "string", - "description": "SKU image name.", - "example": "Nike-Red-Janoski-1" + "description": "Measurement unit." }, - "Text": { - "type": "string", - "description": "General text of the image.", - "example": "Nike-Red-Janoski", - "nullable": true + "UnitMultiplier": { + "type": "number", + "description": "This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward." }, - "Url": { + "InformationSource": { "type": "string", - "description": "External Image's URL. The URL must start with the protocol identifier (`http://` or `https://`) and end with the file extension (`.jpg`, `.png` or `.gif`).", - "example": "https://m.media-amazon.com/images/I/610G2-sJx5L._AC_UX695_.jpg" - } - } - }, - "SKUFile": { - "type": "string", - "format": "binary", - "description": "The image file has a size limit of 3200 x 3200 pixels." - }, - "GetCategoryTree": { - "required": [ - "id", - "name", - "hasChildren", - "url", - "children", - "Title", - "MetaTagDescription" - ], - "type": "object", - "properties": { - "id": { - "type": "integer", - "format": "int32", - "description": "Category ID.", - "example": 1 + "nullable": true, + "description": "Information Source." }, - "name": { + "ModalType": { "type": "string", - "description": "Category name.", - "example": "Toys" + "nullable": true, + "description": "Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)." }, - "hasChildren": { - "type": "boolean", - "description": "If the category has a category child (`true`) or not (`false`).", - "example": true + "KeyWords": { + "type": "string", + "nullable": true, + "description": "Keywords related to the product." }, - "url": { + "ReleaseDate": { "type": "string", - "description": "Category URL.", - "example": "https://lojadobreno.vtexcommercestable.com.br/toys" + "nullable": true, + "description": "Release date of the product." }, - "children": { - "type": "array", - "items": { - "$ref": "#/components/schemas/GetCategoryTreeChild" - }, - "description": "Array with information about the category's children." + "ProductIsVisible": { + "type": "boolean", + "description": "Defines if the product is visible or not." }, - "Title": { - "type": "string", - "description": "Category page title.", - "example": "Toys" + "ShowIfNotAvailable": { + "type": "boolean", + "description": "Defines if the product will be shown if it is not available." }, - "MetaTagDescription": { - "type": "string", - "description": "Category page Meta tag description.", - "example": "New and used toys for sale." + "IsProductActive": { + "type": "boolean", + "description": "Defines if the product is active or not." + }, + "ProductFinalScore": { + "type": "integer", + "description": "Product Final Score." } }, "example": { - "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": 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": [ { - "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": "" - }, + "SellerId": "1", + "StockKeepingUnitId": 310118450, + "SellerStockKeepingUnitId": "310118450", + "IsActive": true, + "FreightCommissionPercentage": 0.0, + "ProductCommissionPercentage": 0.0 + } + ], + "SalesChannels": [ + 1, + 3 + ], + "Images": [ { - "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": "" + "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451/caixa-areia-azul-petmate.jpg?v=637139451191670000", + "ImageName": null, + "FileId": 155451 } ], - "Title": "Alimentação para Gatos", - "MetaTagDescription": "" + "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 } }, - "GetCategoryTreeChild": { - "required": [ - "id", - "name", - "hasChildren", - "url", - "children", - "Title", - "MetaTagDescription" - ], + "SkulistbyProductId": { "type": "object", "properties": { - "id": { + "IsPersisted": { + "type": "boolean", + "description": "Defines if the SKU is persisted." + }, + "IsRemoved": { + "type": "boolean", + "deprecated": true, + "description": "Defines if the SKU is removed." + }, + "Id": { "type": "integer", "format": "int32", - "description": "Category ID.", - "example": 1 + "description": "SKU ID." }, - "name": { - "type": "string", - "description": "Category name.", - "example": "Dolls" + "ProductId": { + "type": "integer", + "format": "int32", + "description": "Product ID." }, - "hasChildren": { + "IsActive": { "type": "boolean", - "description": "If the category has a category child (`true`) or not (`false`).", - "example": true + "description": "Defines if the SKU is active or not." }, - "url": { + "Name": { "type": "string", - "description": "Category URL.", - "example": "https://lojadobreno.vtexcommercestable.com.br/dolls" + "description": "SKU Name." }, - "children": { - "type": "array", - "description": "Array with information about the category's children.", - "items": {} + "Height": { + "type": "number", + "description": "SKU Height." }, - "Title": { - "type": "string", - "description": "Category page title.", - "example": "Dolls" + "RealHeight": { + "type": "number", + "nullable": true, + "description": "Real SKU Height." }, - "MetaTagDescription": { - "type": "string", - "description": "Category page Meta tag description.", - "example": "New and used dolls for sale." - } - }, - "example": { - "id": 78, - "name": "Xbox 360", - "hasChildren": false, - "url": "https://ambienteqa.vtexcommercestable.com.br/games/xbox-360", - "children": [ - { - "id": 79, - "name": "Consoles", - "hasChildren": false, - "url": "https://ambienteqa.vtexcommercestable.com.br/games/xbox-360/consoles", - "children": [] - }, - { - "id": 126, - "name": "Acessorio", - "hasChildren": false, - "url": "https://ambienteqa.vtexcommercestable.com.br/games/xbox-360/acessorio", - "children": [] - } - ], - "Title": "Games", - "MetaTagDescription": "Video games." - } - }, - "Category": { - "required": [ - "Id", - "Name", - "FatherCategoryId", - "Title", - "Description", - "Keywords", - "IsActive", - "LomadeeCampaignCode", - "AdWordsRemarketingCode", - "ShowInStoreFront", - "ShowBrandFilter", - "ActiveStoreFrontLink", - "GlobalCategoryId", - "StockKeepingUnitSelectionMode", - "Score", - "LinkId", - "HasChildren" - ], - "type": "object", - "properties": { - "Id": { + "Width": { + "type": "number", + "description": "SKU Width." + }, + "RealWidth": { + "type": "number", + "nullable": true, + "description": "Real SKU Width." + }, + "Length": { + "type": "number", + "description": "SKU Length." + }, + "RealLength": { + "type": "number", + "nullable": true, + "description": "Real SKU Length." + }, + "WeightKg": { + "type": "number", + "nullable": true, + "description": "Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams." + }, + "RealWeightKg": { + "type": "number", + "nullable": true, + "description": "Real Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams." + }, + "ModalId": { "type": "integer", - "description": "Category ID." + "format": "int32", + "description": "Delivery Method (Modal Type) ID." + }, + "RefId": { + "type": "string", + "description": "Product Reference ID." + }, + "CubicWeight": { + "type": "number", + "description": "[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)." }, - "Name": { - "type": "string", - "description": "Category name." + "IsKit": { + "type": "boolean", + "description": "Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted." }, - "FatherCategoryId": { - "type": "integer", - "description": "ID of the father category, apply in case of category and subcategory.", - "nullable": true + "IsDynamicKit": { + "type": "string", + "nullable": true, + "deprecated": true }, - "Title": { + "InternalNote": { "type": "string", - "description": "Category page title." + "nullable": true, + "description": "Internal note." }, - "Description": { + "DateUpdated": { "type": "string", - "description": "Describes details about the category." + "description": "Date when the product was updated for the most recent time." }, - "Keywords": { + "RewardValue": { + "type": "number", + "nullable": true, + "description": "Reward value related to the SKU." + }, + "CommercialConditionId": { + "type": "integer", + "format": "int32", + "description": "SKU Commercial Condition ID." + }, + "EstimatedDateArrival": { "type": "string", - "description": "Substitutes words for the category." + "nullable": true, + "description": "SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date." }, - "IsActive": { + "FlagKitItensSellApart": { "type": "boolean", - "description": "Shows if the category is active (`true`) or not (`false`)." + "description": "Defines if the SKU bundle items can be sold separately." }, - "LomadeeCampaignCode": { + "ManufacturerCode": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "description": "Product Supplier ID." }, - "AdWordsRemarketingCode": { + "ReferenceStockKeepingUnitId": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "nullable": true, + "description": "SKU Reference ID." }, - "ShowInStoreFront": { - "type": "boolean", - "description": "Defines if the category is shown on side and upper menu (`true`) or not (`false`)." + "Position": { + "type": "integer", + "format": "int32", + "description": "SKU Position." }, - "ShowBrandFilter": { + "ActivateIfPossible": { "type": "boolean", - "description": "Defines if the category has brand filter (`true`) or not (`false`)." + "description": "When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component." }, - "ActiveStoreFrontLink": { - "type": "boolean", - "description": "Defines if the Category has an active link on the website (`true`) or not (`false`)." + "MeasurementUnit": { + "type": "string", + "description": "Measurement unit." }, - "GlobalCategoryId": { - "type": "integer", - "description": "Google Global Category ID." + "UnitMultiplier": { + "type": "number", + "description": "This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward." }, - "StockKeepingUnitSelectionMode": { - "type": "string", - "description": "Defines how the SKU will be exhibited." + "IsInventoried": { + "type": "boolean", + "nullable": true, + "deprecated": true }, - "Score": { - "type": "integer", - "description": "Score for search ordination.", - "nullable": true + "IsTransported": { + "type": "boolean", + "nullable": true, + "deprecated": true }, - "LinkId": { + "IsGiftCardRecharge": { + "type": "boolean", + "nullable": true, + "description": "Defines if the purchase of the SKU will generate reward value for the customer." + }, + "ModalType": { "type": "string", - "description": "Text Link.", - "nullable": true + "nullable": true, + "description": "Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)." }, - "HasChildren": { + "isKitOptimized": { "type": "boolean", - "description": "Defines if the category has child categories (`true`) or not (`false`)." + "description": "Defines if the SKU is a Optimized bundle." } }, "example": { + "IsPersisted": true, "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", + "ProductId": 1, "IsActive": true, - "LomadeeCampaignCode": "", - "AdWordsRemarketingCode": "", - "ShowInStoreFront": true, - "ShowBrandFilter": true, - "ActiveStoreFrontLink": true, - "GlobalCategoryId": 3367, - "StockKeepingUnitSelectionMode": "LIST", - "Score": null, - "LinkId": "Alimentacao", - "HasChildren": true + "Name": "Ração Royal Canin Feline Urinary 500g", + "Height": 6.5000, + "RealHeight": 2.2000, + "Width": 14.0000, + "RealWidth": 3.3000, + "Length": 24.0000, + "RealLength": 4.4000, + "WeightKg": 550.0000, + "RealWeightKg": 1.1000, + "ModalId": 1, + "RefId": "0001", + "CubicWeight": 1.0000, + "IsKit": false, + "InternalNote": null, + "DateUpdated": "2021-10-29T18:25:00", + "RewardValue": null, + "CommercialConditionId": 1, + "EstimatedDateArrival": null, + "FlagKitItensSellApart": false, + "ManufacturerCode": "", + "ReferenceStockKeepingUnitId": null, + "Position": 1, + "ActivateIfPossible": true, + "MeasurementUnit": "un", + "UnitMultiplier": 300.0000, + "IsInventoried": true, + "IsTransported": true, + "IsGiftCardRecharge": false, + "ModalType": null, + "isKitOptimized": false } }, - "CreateCategoryRequest": { + "CreateSellerRequest": { "type": "object", "required": [ + "SellerId", "Name", - "Keywords", - "Title", + "Email", "Description", - "AdWordsRemarketingCode", - "LomadeeCampaignCode", - "FatherCategoryId", - "GlobalCategoryId", - "ShowInStoreFront", + "ExchangeReturnPolicy", + "DeliveryPolicy", + "UseHybridPaymentOptions", + "UserName", + "Password", + "SecutityPrivacyPolicy", + "CNPJ", + "CSCIdentification", + "ArchiveId", + "UrlLogo", + "ProductCommissionPercentage", + "FreightCommissionPercentage", + "FulfillmentEndpoint", + "CatalogSystemEndpoint", "IsActive", - "ActiveStoreFrontLink", - "ShowBrandFilter", - "Score", - "StockKeepingUnitSelectionMode" + "FulfillmentSellerId", + "SellerType", + "IsBetterScope" ], "properties": { - "Id": { - "type": "integer", - "description": "Category unique identifier. If not informed, it will be automatically generated by VTEX.", - "example": 1 + "SellerId": { + "type": "string", + "description": "Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name.", + "example": "pedrostore" }, "Name": { "type": "string", - "description": "Category name.", - "example": "Home Appliances" + "description": "Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method.", + "example": "My pedrostore" }, - "Keywords": { + "Email": { "type": "string", - "description": "Substitute words for the Category.", - "example": "Kitchen, Laundry, Appliances" + "description": "Email of the admin responsible for the seller.", + "example": "breno@breno.com" }, - "Title": { + "Description": { "type": "string", - "description": "Text used in title tag for Category page.", - "example": "Home Appliances" + "description": "Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563).", + "example": "Brief description" }, - "Description": { + "ExchangeReturnPolicy": { "type": "string", - "description": "Text used in meta description tag for Category page.", - "example": "Discover our range of home appliances. Find smart vacuums, kitchen and laundry appliances to suit your needs. Order online now." + "description": "Text describing the exchange and return policy previously agreed between the marketplace and the seller.", + "example": "Exchange return policy text" }, - "AdWordsRemarketingCode": { + "DeliveryPolicy": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "example": "Sale", - "nullable": true, - "deprecated": true + "description": "Text describing the delivery policy previously agreed between the marketplace and the seller.", + "example": "Delivery policy text" }, - "LomadeeCampaignCode": { + "UseHybridPaymentOptions": { + "type": "boolean", + "description": "Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller.", + "example": false + }, + "UserName": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "example": "Sale", - "nullable": true, - "deprecated": true + "description": "Seller username.", + "example": "myseller" }, - "FatherCategoryId": { - "type": "integer", - "description": "ID of the parent category, apply in case of category and subcategory.", - "example": 2, - "nullable": true + "Password": { + "type": "string", + "description": "Seller password.", + "example": "passoword" }, - "GlobalCategoryId": { + "SecutityPrivacyPolicy": { + "type": "string", + "description": "Text describing the security policy previously agreed between the marketplace and the seller.", + "example": "Secutity privacy policy text" + }, + "CNPJ": { + "type": "string", + "description": "Company registration number.", + "example": "12035072751" + }, + "CSCIdentification": { + "type": "string", + "description": "CSC identification.", + "example": "pedrostore" + }, + "ArchiveId": { "type": "integer", - "description": "Google Global Category ID.", - "example": 222 + "description": "Seller archive ID.", + "example": 1 }, - "ShowInStoreFront": { - "type": "boolean", - "description": "If true, the Category is shown in the top and side menu.", - "example": true + "UrlLogo": { + "type": "string", + "description": "Seller URL logo.", + "example": "/myseller" }, - "IsActive": { - "type": "boolean", - "description": "If true, the Category page becomes available in store.", - "example": true + "ProductCommissionPercentage": { + "type": "number", + "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", + "example": 0.0 }, - "ActiveStoreFrontLink": { - "type": "boolean", - "description": "If true, the Category link becomes active in store.", - "example": true + "FreightCommissionPercentage": { + "type": "number", + "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", + "example": 0.0 }, - "ShowBrandFilter": { + "CategoryCommissionPercentage": { + "type": "string", + "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", + "example": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]" + }, + "FulfillmentEndpoint": { + "type": "string", + "description": "URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added.", + "example": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1" + }, + "CatalogSystemEndpoint": { + "type": "string", + "description": "URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`.", + "example": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/" + }, + "IsActive": { "type": "boolean", - "description": "If true, the Category page displays a Brand filter.", + "description": "If the selle is active (`true`) or not (`false`).", "example": true }, - "Score": { - "type": "integer", - "description": "Score for search sorting order.", - "nullable": true, - "example": 3 - }, - "StockKeepingUnitSelectionMode": { + "MerchantName": { "type": "string", - "description": "Defines how the SKU will be exhibited", - "example": "SPECIFICATION" - } - }, - "example": { - "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": 800, - "StockKeepingUnitSelectionMode": "SPECIFICATION", - "Score": null - } - }, - "GetorUpdateProductSpecification": { - "required": [ - "Value" - ], - "type": "object", - "properties": { - "Value": { - "type": "array", - "description": "Array with Specification values.", - "items": { - "type": "string", - "description": "Specification value.", - "example": "Cotton" - } + "description": "Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more.", + "example": "pedrostore" }, - "Id": { + "FulfillmentSellerId": { "type": "integer", - "format": "int32", - "description": "Specification field ID, which is the same as `FieldId` in other specification endpoints.", - "example": 7 + "description": "Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank.", + "example": 1 }, - "Name": { + "SellerType": { + "type": "integer", + "description": "Seller type.", + "example": 1 + }, + "IsBetterScope": { + "type": "boolean", + "description": "Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI).", + "example": false + }, + "TrustPolicy": { "type": "string", - "description": "Name of the Specification.", - "example": "Fabric" + "description": "Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`.", + "example": "Default" } - }, - "example": { - "Value": [ - "Iron", - "Plastic" - ], - "Id": 30, - "Name": "Material" } }, - "GetSKUandContext": { + "UpdateSellerRequest": { + "type": "object", "required": [ - "Id", - "ProductId", - "NameComplete", - "ProductName", - "ProductDescription", - "SkuName", - "IsActive", - "IsTransported", - "IsInventoried", - "IsGiftCardRecharge", - "ImageUrl", - "DetailUrl", + "SellerId", + "Name", + "Email", + "Description", + "ExchangeReturnPolicy", + "DeliveryPolicy", + "UseHybridPaymentOptions", + "UserName", + "Password", + "SecutityPrivacyPolicy", + "CNPJ", "CSCIdentification", - "BrandId", - "BrandName", - "Dimension", - "RealDimension", - "ManufacturerCode", - "IsKit", - "KitItems", - "Services", - "Categories", - "Attachments", - "Collections", - "SkuSellers", - "SalesChannels", - "Images", - "SkuSpecifications", - "ProductSpecifications", - "ProductClustersIds", - "ProductCategoryIds", - "ProductGlobalCategoryId", - "ProductCategories", - "CommercialConditionId", - "RewardValue", - "AlternateIds", - "AlternateIdValues", - "EstimatedDateArrival", - "MeasurementUnit", - "UnitMultiplier", - "InformationSource", - "ModalType" + "ArchiveId", + "UrlLogo", + "ProductCommissionPercentage", + "FreightCommissionPercentage", + "FulfillmentEndpoint", + "CatalogSystemEndpoint", + "IsActive", + "FulfillmentSellerId", + "SellerType", + "IsBetterScope" ], - "type": "object", "properties": { - "Id": { - "type": "integer", - "format": "int32", - "description": "SKU ID." - }, - "ProductId": { - "type": "integer", - "format": "int32", - "description": "ID of the related Product." - }, - "NameComplete": { - "type": "string", - "description": "Product Name and SKU Name concatenated." - }, - "ComplementName": { + "SellerId": { "type": "string", - "description": "Product Complement Name." + "description": "ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID.", + "example": "pedrostore" }, - "ProductName": { + "Name": { "type": "string", - "description": "Product Name." + "description": "Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method.", + "example": "My pedrostore" }, - "ProductDescription": { + "Email": { "type": "string", - "description": "Product Description. HTML is allowed." + "description": "Email of the admin responsible for the seller.", + "example": "breno@breno.com" }, - "ProductRefId": { + "Description": { "type": "string", - "description": "Reference ID of the related Product." + "description": "Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563).", + "example": "Brief description" }, - "TaxCode": { + "ExchangeReturnPolicy": { "type": "string", - "description": "SKU Tax Code." + "description": "Text describing the exchange and return policy previously agreed between the marketplace and the seller.", + "example": "Exchange return policy text" }, - "SkuName": { + "DeliveryPolicy": { "type": "string", - "description": "SKU Name." - }, - "IsActive": { - "type": "boolean", - "description": "Defines if the SKU is active or not." - }, - "IsTransported": { - "type": "boolean", - "nullable": true, - "deprecated": true - }, - "IsInventoried": { - "type": "boolean", - "nullable": true, - "deprecated": true + "description": "Text describing the delivery policy previously agreed between the marketplace and the seller.", + "example": "Delivery policy text" }, - "IsGiftCardRecharge": { + "UseHybridPaymentOptions": { "type": "boolean", - "description": "Defines if the purchase will generate a reward." + "description": "Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller.", + "example": false }, - "ImageUrl": { + "UserName": { "type": "string", - "description": "SKU image URL." + "description": "Seller username.", + "example": "myseller" }, - "DetailUrl": { + "Password": { "type": "string", - "description": "Product URL." + "description": "Seller password.", + "example": "passoword" }, - "CSCIdentification": { + "SecutityPrivacyPolicy": { "type": "string", - "nullable": true, - "description": "SKU Seller identification." + "description": "Text describing the security policy previously agreed between the marketplace and the seller.", + "example": "Secutity privacy policy text" }, - "BrandId": { + "CNPJ": { "type": "string", - "description": "Product Brand ID." + "description": "Company registration number.", + "example": "12035072751" }, - "BrandName": { + "CSCIdentification": { "type": "string", - "description": "Product Brand Name." + "description": "CSC identification.", + "example": "pedrostore" }, - "Dimension": { - "$ref": "#/components/schemas/Dimension" + "ArchiveId": { + "type": "integer", + "description": "Seller archive ID.", + "example": 1 }, - "RealDimension": { - "$ref": "#/components/schemas/RealDimension" + "UrlLogo": { + "type": "string", + "description": "Seller URL logo.", + "example": "/myseller" }, - "ManufacturerCode": { + "ProductCommissionPercentage": { + "type": "number", + "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", + "example": 0.0 + }, + "FreightCommissionPercentage": { + "type": "number", + "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", + "example": 0.0 + }, + "CategoryCommissionPercentage": { "type": "string", - "description": "Product Supplier ID." + "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", + "example": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]" }, - "IsKit": { + "FulfillmentEndpoint": { + "type": "string", + "description": "URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added.", + "example": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1" + }, + "CatalogSystemEndpoint": { + "type": "string", + "description": "URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`.", + "example": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/" + }, + "IsActive": { "type": "boolean", - "description": "Defines if the SKU is part of a bundle." + "description": "If the selle is active (`true`) or not (`false`).", + "example": true }, - "KitItems": { - "type": "array", - "items": { - "type": "string", - "description": "SKU ID." - }, - "description": "Array with SKU IDs of bundle components." + "MerchantName": { + "type": "string", + "description": "Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more.", + "example": "pedrostore" }, - "Services": { - "type": "array", - "items": { - "type": "string", - "description": "Service ID." - }, - "description": "Array with Service IDs that are related to the SKU." + "FulfillmentSellerId": { + "type": "integer", + "description": "Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank.", + "example": 1 }, - "Categories": { - "type": "array", - "items": { - "type": "string", - "description": "Category ID." - }, - "description": "Array with Categories from the related Product." + "SellerType": { + "type": "integer", + "description": "Seller type.", + "example": 1 }, - "Attachments": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Attachment" - }, - "description": "Array with Attachments ID that are related to the SKU." + "IsBetterScope": { + "type": "boolean", + "description": "Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI).", + "example": false }, - "Collections": { - "type": "array", - "items": { + "TrustPolicy": { + "type": "string", + "description": "Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`.", + "example": "Default" + } + } + }, + "CategorySpecification": { + "required": [ + "Name", + "CategoryId", + "FieldId", + "IsActive", + "IsStockKeepingUnit" + ], + "type": "array", + "description": "Array of objects.", + "items": { + "type": "object", + "description": "Object containing Specification information.", + "properties": { + "Name": { "type": "string", - "description": "Collection ID." - }, - "description": "Array with Collections ID that are related to the Product." - }, - "SkuSellers": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SkuSeller" + "description": "Specification name. Limited to 100 characters.", + "example": "Composition" }, - "description": "Array with SKU Sellers data." - }, - "SalesChannels": { - "type": "array", - "items": { + "CategoryId": { "type": "integer", - "format": "int32" + "description": "Category ID.", + "example": 1 }, - "description": "Array with the ID of all the Sales Channels that are related to the product." - }, - "Images": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Image" + "FieldId": { + "type": "integer", + "description": "Specification field ID.", + "example": 1 }, - "description": "Array with SKU images." - }, - "SkuSpecifications": { - "type": "array", - "items": { - "$ref": "#/components/schemas/SkuSpecification" + "IsActive": { + "type": "boolean", + "description": "Defines if the specification is active.", + "example": true }, - "description": "Array with related SKU Specifications." + "IsStockKeepingUnit": { + "type": "boolean", + "description": "Defines if it is an SKU specification.", + "example": true + } + } + }, + "example": [ + { + "Name": "Specification A", + "CategoryId": 1, + "FieldId": 33, + "IsActive": true, + "IsStockKeepingUnit": false }, - "ProductSpecifications": { - "type": "array", - "items": { - "$ref": "#/components/schemas/ProductSpecification" - }, - "description": "Array with related Product Specifications." + { + "Name": "Specification B", + "CategoryId": 1, + "FieldId": 34, + "IsActive": true, + "IsStockKeepingUnit": false }, - "ProductClusterNames": { - "type": "object", - "additionalProperties": { - "type": "string", - "description": "Collection ID", - "additionalProperties": { - "type": "string", - "description": "Category Name." - } - } + { + "Name": "Specification C", + "CategoryId": 1, + "FieldId": 35, + "IsActive": false, + "IsStockKeepingUnit": false + } + ] + }, + "GetSpecFieldValue": { + "required": [ + "FieldValueId", + "Value", + "IsActive", + "Position" + ], + "type": "object", + "properties": { + "FieldValueId": { + "type": "integer", + "format": "int32", + "description": "Specification Field Value ID." }, - "ProductClustersIds": { + "Value": { "type": "string", - "description": "Product Clusters IDs." + "description": "Specification Field Value." }, - "ProductCategoryIds": { + "IsActive": { + "type": "boolean", + "description": "Defines if the Specification Field is active (`true`) or inactive (`false`)." + }, + "Position": { + "type": "integer", + "format": "int32", + "description": "Specification Field Value Position." + } + }, + "example": { + "FieldValueId": 52, + "Value": "0 a 6 meses", + "IsActive": true, + "Position": 1 + } + }, + "SpecificationsInsertFieldRequest": { + "required": [ + "Name", + "CategoryId", + "IsActive", + "FieldId", + "IsRequired", + "FieldTypeId", + "FieldValueId", + "Description", + "IsStockKeepingUnit", + "IsFilter", + "IsOnProductDetails", + "Position", + "IsWizard", + "IsTopMenuLinkActive", + "IsSideMenuLinkActive", + "DefaultValue", + "FieldGroupId", + "FieldGroupName" + ], + "type": "object", + "properties": { + "Name": { "type": "string", - "description": "Category Hierarchy with Category IDs." + "description": "Specification Field name. Limited to 100 characters." }, - "ProductGlobalCategoryId": { + "CategoryId": { "type": "integer", "nullable": true, - "description": "Global Category ID." - }, - "ProductCategories": { - "type": "object", - "description": "Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\".", - "additionalProperties": { - "type": "string", - "description": "Category ID.", - "additionalProperties": { - "type": "string", - "description": "Category Name." - } - } + "description": "Category ID." }, - "CommercialConditionId": { + "FieldId": { "type": "integer", - "format": "int32", - "description": "SKU Commercial Condition ID." - }, - "RewardValue": { - "type": "number", - "description": "Reward value related to the SKU." - }, - "AlternateIds": { - "$ref": "#/components/schemas/AlternateIds" - }, - "AlternateIdValues": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Array with values of alternative SKU IDs." - }, - "EstimatedDateArrival": { - "type": "string", "nullable": true, - "description": "To add the product as pre-sale, enter the product estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format. You must take into consideration both the launch date and the freight calculation for the arrival date." - }, - "MeasurementUnit": { - "type": "string", - "description": "SKU Measurement Unit." + "description": "Specification Field ID." }, - "UnitMultiplier": { - "type": "number", - "description": "This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward." + "IsActive": { + "type": "boolean", + "description": "Defines if the Specification Field is active. The default value is `true`." }, - "InformationSource": { - "type": "string", - "description": "Information Source.", - "nullable": true + "IsRequired": { + "type": "boolean", + "description": "Makes the Specification Field mandatory (`true`) or optional (`false`)." }, - "ModalType": { - "type": "string", - "nullable": true, - "description": "Modal Type." + "FieldTypeId": { + "type": "integer", + "format": "int32", + "description": "Specification Field Type ID." }, - "KeyWords": { - "type": "string", + "FieldValueId": { + "type": "integer", "nullable": true, - "description": "Keywords related to the product." + "description": "Specification Field Value ID." }, - "ReleaseDate": { + "Description": { "type": "string", "nullable": true, - "description": "Release date of the product." + "description": "Specification Field Description." }, - "ProductIsVisible": { + "IsStockKeepingUnit": { "type": "boolean", - "description": "Defines if the product is visible or not." + "description": "If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field." }, - "ShowIfNotAvailable": { + "IsFilter": { "type": "boolean", - "description": "Defines if the product will be shown if it is not available." + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar.\r\n" }, - "IsProductActive": { + "IsOnProductDetails": { "type": "boolean", - "description": "Defines if the product is active or not." + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page.\r\n" }, - "ProductFinalScore": { + "Position": { "type": "integer", - "description": "Product Final Score." - } - }, - "example": { - "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 - } - }, - "Dimension": { - "required": [ - "cubicweight", - "height", - "length", - "weight", - "width" - ], - "type": "object", - "description": "Object containing the SKU dimensions to be used on the shipping calculation.", - "properties": { - "cubicweight": { - "type": "number", - "description": "SKU Cubic Weight." - }, - "height": { - "type": "number", - "description": "SKU Height." - }, - "length": { - "type": "number", - "description": "SKU Length." + "format": "int32", + "description": "Specification Field Position." }, - "weight": { - "type": "number", - "description": "SKU Weight." + "IsWizard": { + "type": "boolean", + "description": "Deprecated field.", + "deprecated": true }, - "width": { - "type": "number", - "description": "SKU Width." - } - }, - "example": { - "cubicweight": 81.6833, - "height": 65, - "length": 58, - "weight": 10000, - "width": 130 - } - }, - "RealDimension": { - "required": [ - "realCubicWeight", - "realHeight", - "realLength", - "realWeight", - "realWidth" - ], - "type": "object", - "description": "Object containing the real SKU dimensions, which appear in the product page.", - "properties": { - "realCubicWeight": { - "type": "number", - "description": "Real SKU Cubic Weight." + "IsTopMenuLinkActive": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu.\r\n" }, - "realHeight": { - "type": "number", - "description": "Real SKU Height." + "IsSideMenuLinkActive": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar.\r\n" }, - "realLength": { - "type": "number", - "description": "Real SKU Length." + "DefaultValue": { + "type": "string", + "nullable": true, + "description": "Specification Field default Value." }, - "realWeight": { - "type": "number", - "description": "Real SKU Weight." + "FieldGroupId": { + "type": "integer", + "format": "int32", + "description": "Specification Field Group ID." }, - "realWidth": { - "type": "number", - "description": "Real SKU Width." + "FieldGroupName": { + "type": "string", + "description": "Specification Field Group Name." } }, "example": { - "realCubicWeight": 274.1375, - "realHeight": 241, - "realLength": 65, - "realWeight": 9800, - "realWidth": 105 + "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" } }, - "Attachment": { + "SpecificationsInsertFieldUpdateRequest": { "required": [ - "Id", "Name", - "Keys", - "Fields", + "CategoryId", "IsActive", - "IsRequired" + "FieldId", + "IsRequired", + "FieldTypeId", + "Description", + "IsStockKeepingUnit", + "IsWizard", + "IsFilter", + "IsOnProductDetails", + "Position", + "IsTopMenuLinkActive", + "IsSideMenuLinkActive", + "DefaultValue", + "FieldGroupId", + "FieldGroupName" ], "type": "object", - "description": "Object containing information about SKU attachments.", "properties": { - "Id": { - "type": "integer", - "format": "int32", - "description": "Attachment ID." - }, "Name": { "type": "string", - "description": "Attachment Name." + "description": "Specification Field ID." }, - "Keys": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Attachment Keys." + "CategoryId": { + "type": "integer", + "nullable": true, + "description": "Category ID." }, - "Fields": { - "type": "array", - "items": { - "$ref": "#/components/schemas/Field" - }, - "description": "Array containing Attachment fields." + "FieldId": { + "type": "integer", + "nullable": true, + "description": "Specification Field ID." }, "IsActive": { "type": "boolean", - "description": "Defines if the Attachment is active or not." + "description": "Enables(`true`) or disables (`false`) the Specification Field.", + "example": true }, "IsRequired": { "type": "boolean", - "description": "Defines if the Attachment is required or not." + "description": "Makes the Specification Field mandatory (`true`) or optional (`false`)." + }, + "FieldTypeId": { + "type": "integer", + "format": "int32", + "description": "Specification Field Type ID." + }, + "FieldValueId": { + "type": "integer", + "nullable": true, + "description": "Specification Field Value ID." + }, + "Description": { + "type": "string", + "nullable": true, + "description": "Specification Field Description." + }, + "IsStockKeepingUnit": { + "type": "boolean", + "description": "If `true`, it will be added as a SKU specification field. If `false`, it will be added as a product specification field." + }, + "IsFilter": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar.\r\n" + }, + "IsOnProductDetails": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page.\r\n" + }, + "Position": { + "type": "integer", + "format": "int32", + "description": "Specification Field Position." + }, + "IsWizard": { + "type": "boolean", + "description": "Deprecated field.", + "deprecated": true + }, + "IsTopMenuLinkActive": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu.\r\n" + }, + "IsSideMenuLinkActive": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar.\r\n", + "example": false + }, + "DefaultValue": { + "type": "string", + "nullable": true, + "description": "Specification Field default Value." + }, + "FieldGroupId": { + "type": "integer", + "format": "int32", + "description": "Specification Field Group ID." + }, + "FieldGroupName": { + "type": "string", + "description": "Specification Field Group Name." } - }, - "example": { - "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 } }, - "Field": { + "SpecificationsInsertFieldValueRequest": { "required": [ - "FieldName", - "MaxCaracters", - "DomainValues" + "FieldId", + "Name", + "Text", + "IsActive", + "Position" ], "type": "object", "properties": { - "FieldName": { - "type": "string", - "description": "Attachment field name." + "FieldId": { + "type": "integer", + "format": "int32", + "description": "Specification Field ID." }, - "MaxCaracters": { + "Name": { "type": "string", - "description": "Maximum number of characters accepted in the attachment field." + "description": "Specification Field Value Name." }, - "DomainValues": { + "Text": { "type": "string", - "nullable": true, - "description": "Allowed key values." + "description": "Specification Field Value Description." + }, + "IsActive": { + "type": "boolean", + "description": "Defines if the Specification Field Value is active (`true`) or inactive (`false`)." + }, + "Position": { + "type": "integer", + "format": "int32", + "description": "Specification Field Value Position." } }, "example": { - "FieldName": "nome", - "MaxCaracters": "20", - "DomainValues": "Adalberto,Pedro,João" + "FieldValueId": 143, + "FieldId": 34, + "Name": "Cotton", + "Text": "Cotton fibers", + "IsActive": true, + "Position": 100 } }, - "SkuSeller": { + "SpecificationsUpdateFieldValueRequest": { "required": [ - "SellerId", - "StockKeepingUnitId", - "SellerStockKeepingUnitId", + "FieldId", + "Name", + "Text", "IsActive", - "FreightCommissionPercentage", - "ProductCommissionPercentage" + "Position" ], "type": "object", - "description": "Object containing related SKU Sellers data.", "properties": { - "SellerId": { - "type": "string", - "description": "SKU Seller ID. This is the ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID." - }, - "StockKeepingUnitId": { + "FieldId": { "type": "integer", - "format": "int32", - "description": "SKU ID." + "nullable": true, + "description": "Specification Field ID." }, - "SellerStockKeepingUnitId": { + "Name": { "type": "string", - "description": "SKU ID for the SKU Seller." + "description": "Specification Field Value Name." + }, + "Text": { + "type": "string", + "nullable": true, + "description": "Specification Field Value Description." }, "IsActive": { "type": "boolean", - "description": "Defines if the SKU is active." - }, - "FreightCommissionPercentage": { - "type": "number", - "description": "Registered value for Seller Freight Commission." + "description": "Defines if the Specification Field Value is active (`true`) or inactive (`false`)." }, - "ProductCommissionPercentage": { - "type": "number", - "description": "Registered value for Seller Product Commission." + "Position": { + "type": "integer", + "format": "int32", + "description": "Specification Field Position." } }, "example": { - "SellerId": "1", - "StockKeepingUnitId": 2001773, - "SellerStockKeepingUnitId": "2001773", + "FieldId": 1, + "FieldValueId": 143, + "Name": "Cotton", + "Text": "Cotton fibers", "IsActive": true, - "FreightCommissionPercentage": 0, - "ProductCommissionPercentage": 0 + "Position": 100 } }, - "Image": { + "SpecificationsGroup": { "required": [ - "ImageUrl", - "ImageName", - "FileId" + "CategoryId", + "Id", + "Name", + "Position" ], "type": "object", - "description": "Object containing SKU images details.", "properties": { - "ImageUrl": { - "type": "string", - "description": "Image URL." + "CategoryId": { + "type": "integer", + "nullable": true, + "description": "Category ID." }, - "ImageName": { + "Id": { + "type": "integer", + "format": "int32", + "description": "Specification Group ID." + }, + "Name": { "type": "string", - "description": "Image label.", - "nullable": true + "description": "Specification Group Name." }, - "FileId": { + "Position": { "type": "integer", "format": "int32", - "description": "SKU image ID." + "nullable": true, + "description": "Specification Group Position." } }, "example": { - "ImageUrl": "http://ambienteqa.vteximg.com.br/arquivos/ids/168952/7508800GG.jpg", - "ImageName": "", - "FileId": 168952 + "CategoryId": 1, + "Id": 4, + "Name": "Sizes", + "Position": 1 } }, - "SkuSpecification": { + "SpecificationGroupInsertRequest": { "required": [ - "FieldId", - "FieldName", - "FieldValueIds", - "FieldValues" + "CategoryId", + "Name" ], "type": "object", - "description": "Object containing related SKU Specifications.", "properties": { - "FieldId": { + "CategoryId": { "type": "integer", "format": "int32", - "description": "Specification field ID." + "description": "Category ID." }, - "FieldName": { + "Name": { "type": "string", - "description": "Specification field Name." - }, - "FieldValueIds": { - "type": "array", - "items": { - "type": "integer", - "format": "int32", - "description": "Specification Value ID." - }, - "description": "Array with related Specification Values IDs." - }, - "FieldValues": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Array with related Specification Values." + "description": "Specification Group Name." } }, "example": { - "FieldId": 102, - "FieldName": "Cor", - "FieldValueIds": [ - 266 - ], - "FieldValues": [ - "Padrão" - ] + "CategoryId": 1, + "Name": "GroupName1" } }, - "ProductSpecification": { + "SkuComplement": { "required": [ - "FieldId", - "FieldName", - "FieldValueIds", - "FieldValues" + "Id", + "SkuId", + "ParentSkuId", + "ComplementTypeId" ], + "type": "array", + "items": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "SKU Complement’s unique numerical identifier." + }, + "SkuId": { + "type": "integer", + "description": "ID of the SKU which will be inserted as a Complement in the Parent SKU." + }, + "ParentSkuId": { + "type": "integer", + "description": "ID of the Parent SKU, where the Complement will be inserted." + }, + "ComplementTypeId": { + "type": "integer", + "description": "Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together." + } + } + }, + "example": [ + { + "Id": 61, + "SkuId": 7, + "ParentSkuId": 1, + "ComplementTypeId": 1 + } + ] + }, + "SkuKit": { "type": "object", "properties": { - "FieldId": { + "Id": { "type": "integer", - "format": "int32", - "description": "Specification field ID." + "description": "SKU Kit ID, same as `StockKeepingUnitParent`." }, - "FieldName": { - "type": "string", - "description": "Specification name. Limited to 100 characters." + "StockKeepingUnitParent": { + "type": "integer", + "description": "Parent SKU ID." }, - "FieldValueIds": { - "type": "array", - "items": { - "type": "integer", - "format": "int32", - "description": "Specification Value ID." - }, - "description": "Array with related Specification Values IDs." + "StockKeepingUnitId": { + "type": "integer", + "description": "SKU ID of the kit component." }, - "FieldValues": { - "type": "array", - "items": { - "type": "string" - }, - "description": "Array with related Specification Values." + "Quantity": { + "type": "integer", + "description": "Component quantity." + }, + "UnitPrice": { + "type": "integer", + "description": "Component price per unit." } }, "example": { - "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" - ] + "Id": 7, + "StockKeepingUnitParent": 7, + "StockKeepingUnitId": 1, + "Quantity": 1, + "UnitPrice": 50.0000 } }, - "AlternateIds": { + "SKUSpecificationResponse": { "type": "object", - "description": "Array with alternate SKU IDs, such as EAN and RefId.", "properties": { - "Ean": { - "type": "string", - "description": "SKU EAN." + "Id": { + "type": "integer", + "description": "ID of the association of the specification and the SKU. This ID is used to update or delete the specification." + }, + "SkuId": { + "type": "integer", + "description": "SKU ID." }, - "RefId": { + "FieldId": { + "type": "integer", + "description": "Specification field ID." + }, + "FieldValueId": { + "type": "integer", + "description": "Specification Value ID. Required only for `FieldTypeId` as `5`, `6` and `7`." + }, + "Text": { "type": "string", - "description": "SKU Reference ID." + "description": "Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`." } }, "example": { - "Ean": "8781", - "RefId": "878181" + "Id": 1505, + "SkuId": 1234568387, + "FieldId": 193, + "FieldValueId": 360, + "Text": "Size 10" } }, - "GetSKUAltID": { - "required": [ - "Id", - "ProductId", - "NameComplete", - "ProductName", - "ProductDescription", - "SkuName", - "IsActive", - "IsTransported", - "IsInventoried", - "IsGiftCardRecharge", - "ImageUrl", - "DetailUrl", - "CSCIdentification", - "BrandId", - "BrandName", - "Dimension", - "RealDimension", - "ManufacturerCode", - "IsKit", - "KitItems", - "Services", - "Categories", - "Attachments", - "Collections", - "SkuSellers", - "SalesChannels", - "Images", - "SkuSpecifications", - "ProductSpecifications", - "ProductClustersIds", - "ProductCategoryIds", - "ProductGlobalCategoryId", - "ProductCategories", - "CommercialConditionId", - "RewardValue", - "AlternateIds", - "AlternateIdValues", - "EstimatedDateArrival", - "MeasurementUnit", - "UnitMultiplier", - "InformationSource", - "ModalType" - ], + "SKUService": { "type": "object", "properties": { "Id": { "type": "integer", - "format": "int32", - "description": "SKU ID." + "description": "SKU Service ID.", + "example": 1 }, - "ProductId": { + "SkuServiceTypeId": { "type": "integer", - "format": "int32", - "description": "Product ID." - }, - "NameComplete": { - "type": "string", - "description": "Product Name and SKU Name combined." - }, - "ComplementName": { - "type": "string", - "description": "Product Complement Name." + "description": "SKU Service Type ID.", + "example": 1 }, - "ProductName": { - "type": "string", - "description": "Product Name." + "SkuServiceValueId": { + "type": "integer", + "description": "SKU Service Value ID.", + "example": 1 }, - "ProductDescription": { - "type": "string", - "description": "Product Description. HTML is allowed." + "SkuId": { + "type": "integer", + "description": "SKU ID.", + "example": 1 }, - "ProductRefId": { + "Name": { "type": "string", - "description": "Product Reference ID." + "description": "SKU Service Name. Maximum of 50 characters.", + "example": "Engraving" }, - "TaxCode": { + "Text": { "type": "string", - "description": "SKU Tax Code." + "description": "Internal description of the SKU Service. Maximum of 100 characters.", + "example": "Name engraving additional service." }, - "SkuName": { + "IsActive": { + "type": "boolean", + "description": "Defines if the SKU Service is active or not.", + "example": true + } + }, + "example": { + "Id": 1, + "SkuServiceTypeId": 1, + "SkuServiceValueId": 1, + "SkuId": 1, + "Name": "name", + "Text": "text", + "IsActive": false + } + }, + "SKUServiceTypeRequest": { + "type": "object", + "required": [ + "Name", + "IsActive", + "ShowOnProductFront", + "ShowOnCartFront", + "ShowOnAttachmentFront", + "ShowOnFileUpload", + "IsGiftCard", + "IsRequired" + ], + "properties": { + "Name": { "type": "string", - "description": "SKU Name." + "description": "SKU Service Type Name. Maximum of 100 characters.", + "default": "Test API Sku Services" }, "IsActive": { "type": "boolean", - "description": "Defines if the SKU is active or not." + "description": "Defines if the SKU Service Type is active or not.", + "default": true }, - "IsTransported": { + "ShowOnProductFront": { "type": "boolean", + "description": "Deprecated", + "example": false, "deprecated": true }, - "IsInventoried": { + "ShowOnCartFront": { "type": "boolean", - "deprecated": true + "description": "Defines if the SKU Service Type is displayed on the cart screen.", + "example": false }, - "IsGiftCardRecharge": { + "ShowOnAttachmentFront": { "type": "boolean", - "description": "Defines if the purchase of the SKU will generate reward value for the customer." - }, - "ImageUrl": { - "type": "string", - "description": "SKU image URL." + "description": "Defines if the SKU Service Type has an attachment.", + "example": false }, - "DetailUrl": { - "type": "string", - "description": "Product slug." + "ShowOnFileUpload": { + "type": "boolean", + "description": "Defines if the SKU Service Type can be associated with an attachment or not.", + "example": false }, - "CSCIdentification": { - "type": "string", - "nullable": true, - "description": "SKU Seller Identification." + "IsGiftCard": { + "type": "boolean", + "description": "Defines if the SKU Service Type is displayed as a Gift Card.", + "example": false }, - "BrandId": { - "type": "string", - "description": "Brand ID." + "IsRequired": { + "type": "boolean", + "description": "Defines if the SKU Service type is mandatory.", + "example": false + } + } + }, + "SKUServiceTypeResponse": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "SKU Service Type ID.", + "example": 2 }, - "BrandName": { + "Name": { "type": "string", - "description": "Brand Name." - }, - "Dimension": { - "$ref": "#/components/schemas/Dimension" + "description": "SKU Service Type Name. Maximum of 100 characters.", + "example": "Test API Sku Services" }, - "RealDimension": { - "$ref": "#/components/schemas/RealDimension" + "IsActive": { + "type": "boolean", + "description": "Defines if the SKU Service Type is active or not.", + "example": true }, - "ManufacturerCode": { - "type": "string", - "description": "Product Supplier ID." + "ShowOnProductFront": { + "type": "boolean", + "description": "Deprecated.", + "example": false, + "deprecated": true }, - "IsKit": { + "ShowOnCartFront": { "type": "boolean", - "description": "Defines if the SKU is part of a bundle." + "description": "Defines if the SKU Service Type is displayed on the cart screen.", + "example": false }, - "KitItems": { - "type": "array", - "description": "Array with SKU IDs of bundle components.", - "items": { - "type": "string", - "description": "SKU ID of each bundle component." - } + "ShowOnAttachmentFront": { + "type": "boolean", + "description": "Defines if the SKU Service Type has an attachment.", + "default": false }, - "Services": { - "type": "array", - "description": "Array with Service IDs that are related to the SKU.", - "items": { - "type": "string", - "description": "Service IDs of each service related to the SKU." - } + "ShowOnFileUpload": { + "type": "boolean", + "description": "Defines if the SKU Service Type can be associated with an attachment or not.", + "default": false }, - "Categories": { - "type": "array", - "description": "Categories of the related product.", - "items": { - "type": "string", - "description": "Category ID." - } + "IsGiftCard": { + "type": "boolean", + "description": "Defines if the SKU Service Type is displayed as a Gift Card.", + "default": false }, - "CategoriesFullPath": { - "type": "array", - "description": "Path of Categories of the related product.", - "items": { - "type": "string", - "description": "Path composed by Category IDs separated by `/`." - } + "IsRequired": { + "type": "boolean", + "description": "Defines if the SKU Service type is mandatory.", + "default": false + } + }, + "example": { + "Id": 2, + "Name": "Test API SKU Services", + "IsActive": true, + "ShowOnProductFront": true, + "ShowOnCartFront": true, + "ShowOnAttachmentFront": true, + "ShowOnFileUpload": true, + "IsGiftCard": true, + "IsRequired": true + } + }, + "SKUServiceValueRequest": { + "type": "object", + "required": [ + "SkuServiceTypeId", + "Name", + "Value", + "Cost" + ], + "properties": { + "SkuServiceTypeId": { + "type": "integer", + "description": "SKU Service Type ID.", + "example": 2 }, - "Attachments": { - "type": "array", - "description": "Array with Attachments ID that are related to the SKU.", - "items": { - "$ref": "#/components/schemas/Attachment" - } + "Name": { + "type": "string", + "description": "SKU Service Value name. Maximum of 100 characters.", + "example": "Test ServiceValue API" }, - "Collections": { - "type": "array", - "description": "Array with Collections IDs that are related to the Product.", - "items": { - "type": "string", - "description": "Collection ID." - } + "Value": { + "type": "number", + "description": "SKU Service Value value.", + "example": 10.5 }, - "SkuSellers": { - "type": "array", - "description": "Array with related Sellers data.", - "items": { - "$ref": "#/components/schemas/SkuSeller" - } + "Cost": { + "type": "number", + "description": "SKU Service Value cost.", + "example": 10.5 + } + }, + "example": { + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + }, + "SKUServiceValueResponse": { + "type": "object", + "required": [ + "SkuServiceTypeId", + "Name", + "Value", + "Cost" + ], + "properties": { + "Id": { + "type": "integer", + "description": "SKU Service Value ID.", + "example": 2 }, - "SalesChannels": { - "type": "array", - "description": "Array of trade policy IDs.", - "items": { - "type": "integer", - "format": "int32", - "description": "Trade policy ID." - } + "SkuServiceTypeId": { + "type": "integer", + "description": "SKU Service Type ID.", + "example": 2 }, - "Images": { - "type": "array", - "description": "Array of objects with SKU image details.", - "items": { - "$ref": "#/components/schemas/Image" - } + "Name": { + "type": "string", + "description": "SKU Service Value name. Maximum of 100 characters.", + "example": "Test ServiceValue API" }, - "SkuSpecifications": { - "type": "array", - "description": "Array with related SKU Specifications.", - "items": { - "$ref": "#/components/schemas/SkuSpecification" - } + "Value": { + "type": "number", + "description": "SKU Service Value value.", + "example": 10.5 }, - "ProductSpecifications": { - "type": "array", - "description": "Array with related Product Specifications.", - "items": { - "$ref": "#/components/schemas/ProductSpecification" - } + "Cost": { + "type": "number", + "description": "SKU Service Value cost.", + "example": 10.5 + } + }, + "example": { + "Id": 2, + "SkuServiceTypeId": 2, + "Name": "Test ServiceValue API", + "Value": 10.5, + "Cost": 10.5 + } + }, + "BrandCreateUpdate": { + "type": "object", + "description": "Object containing Brand information.", + "required": [ + "Id", + "Name" + ], + "properties": { + "Id": { + "type": "integer", + "description": "Brand's unique numerical identifier.", + "example": 2000003 }, - "ProductClustersIds": { + "Name": { "type": "string", - "description": "Product Cluster IDs separated by comma (`,`)." - }, - "PositionsInClusters": { - "type": "object", - "description": "Product Clusters position in each Cluster. Structure: \"{Product Cluster ID}\": {Position}.\n\n`{Product Cluster ID}` is a string, while `{Position}` is an integer.", - "additionalProperties": { - "type": "integer", - "description": "Product Cluster ID.", - "additionalProperties": { - "type": "integer", - "description": "Position." - } - } - }, - "ProductClusterNames": { - "type": "object", - "description": "Product Clusters Names. Structure: \"{Product Cluster ID}\": \"{Product Cluster Name}\". Both the key and the value are strings.", - "additionalProperties": { - "type": "string", - "description": "Product Cluster ID.", - "additionalProperties": { - "type": "string", - "description": "Product Cluster Name." - } - } + "description": "Brand name.", + "example": "Adidas" }, - "ProductClusterHighlights": { - "type": "object", - "description": "Product Clusters Highlights. Structure: \"{Product Cluster ID}\": \"{Product Cluster Name}\". Both the key and the value are strings.", - "additionalProperties": { - "type": "string", - "description": "Product Cluster ID.", - "additionalProperties": { - "type": "string", - "description": "Product Cluster Highlight." - } - } + "Text": { + "type": "string", + "description": "Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description.", + "example": "Adidas" }, - "ProductCategoryIds": { + "Keywords": { "type": "string", - "description": "Category path composed by category IDs separated by `/`." + "description": "Store Framework - Deprecated.\r\nLegacy 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.\r\n", + "example": "adidas" }, - "IsDirectCategoryActive": { - "type": "boolean", - "description": "Indicates if the direct Product Category is active or not." + "SiteTitle": { + "type": "string", + "description": "Meta Title for the Brand page.", + "example": "Adidas" }, - "ProductGlobalCategoryId": { - "type": "integer", - "nullable": true, - "description": "Product Global Category ID." + "AdWordsRemarketingCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true }, - "ProductCategories": { - "type": "object", - "description": "Object containing product categories. Structure: \"{CategoryID}\": \"{CategoryName}\". Both the key and the value are strings.", - "additionalProperties": { - "type": "string", - "description": "Category ID.", - "additionalProperties": { - "type": "string", - "description": "Category Name." - } - } + "LomadeeCampaignCode": { + "type": "string", + "description": "This is a legacy field. Do not take this information into consideration.", + "deprecated": true }, - "CommercialConditionId": { + "Score": { "type": "integer", - "format": "int32", - "description": "SKU Commercial Condition ID." - }, - "RewardValue": { - "type": "number", - "description": "Reward value related to the SKU." - }, - "AlternateIds": { - "$ref": "#/components/schemas/AlternateIds" + "description": "Store Framework - Deprecated\r\nLegacy CMS Portal - Value used to set the priority on the search result page.\r\n", + "example": 10, + "nullable": true }, - "AlternateIdValues": { - "type": "array", - "description": "Array with values of alternative SKU IDs.", - "items": { - "type": "string", - "description": "Alternative SKU ID." - } + "MenuHome": { + "type": "boolean", + "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - Defines if the Brand appears in the Department Menu control (``).\r\n", + "example": true }, - "EstimatedDateArrival": { + "Active": { + "type": "boolean", + "description": "Defines if the brand is active (`true`) or not (`false`).", + "example": true + }, + "LinkId": { "type": "string", - "nullable": true, - "description": "SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date." + "description": "Brand page slug. Only lowercase letters and hyphens (`-`) are allowed.", + "example": "adidas-sports", + "nullable": true + } + }, + "example": { + "Id": 2000013, + "Name": "Orma Carbono2", + "Text": "Orma Carbon2", + "Keywords": "orma", + "SiteTitle": "Orma Carbon2", + "Active": true, + "MenuHome": true, + "AdWordsRemarketingCode": "", + "LomadeeCampaignCode": "", + "Score": null, + "LinkId": null + } + }, + "BrandGet": { + "type": "object", + "description": "Object containing Brand information.", + "required": [ + "id", + "name", + "isActive", + "imageUrl", + "title", + "metaTagDescription" + ], + "properties": { + "id": { + "type": "integer", + "description": "Brand's unique numerical identifier." }, - "MeasurementUnit": { + "name": { "type": "string", - "description": "Measurement unit." + "description": "Brand name." }, - "UnitMultiplier": { - "type": "number", - "description": "This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward." + "isActive": { + "type": "boolean", + "description": "Defines if the brand is active (`true`) or not (`false`)." }, - "InformationSource": { + "title": { "type": "string", - "nullable": true, - "description": "Information Source." + "description": "Meta Title for the Brand page." }, - "ModalType": { + "metaTagDescription": { "type": "string", - "nullable": true, - "description": "Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)." + "description": "Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description." }, - "KeyWords": { + "imageUrl": { "type": "string", - "nullable": true, - "description": "Keywords related to the product." + "description": "URL of the brand's image.", + "nullable": true + } + } + }, + "AttachmentResponse": { + "type": "object", + "required": [ + "Id", + "Name", + "IsRequired", + "IsActive", + "Domains" + ], + "properties": { + "Id": { + "type": "integer", + "description": "Attachment ID.", + "example": 8 }, - "ReleaseDate": { + "Name": { "type": "string", - "nullable": true, - "description": "Release date of the product." - }, - "ProductIsVisible": { - "type": "boolean", - "description": "Defines if the product is visible or not." + "description": "Attachment Name.", + "example": "Shirt customization" }, - "ShowIfNotAvailable": { + "IsRequired": { "type": "boolean", - "description": "Defines if the product will be shown if it is not available." + "description": "Defines if the attachment is required or not.", + "example": false }, - "IsProductActive": { + "IsActive": { "type": "boolean", - "description": "Defines if the product is active or not." + "description": "Defines if the attachment is active or not.", + "example": false }, - "ProductFinalScore": { - "type": "integer", - "description": "Product Final Score." + "Domains": { + "type": "array", + "description": "List of characteristics related to the attachment.", + "items": { + "type": "object", + "properties": { + "FieldName": { + "type": "string", + "description": "Attachment key name.", + "example": "Number" + }, + "MaxCaracters": { + "type": "string", + "description": "Maximum number of characters in the attachment key.", + "example": "1" + }, + "DomainValues": { + "type": "string", + "description": "Allowed key values.", + "example": "7,9,10" + } + } + } } }, "example": { - "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", + "Id": 8, + "Name": "Ingredients", + "IsRequired": true, "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": [ + "Domains": [ { - "SellerId": "1", - "StockKeepingUnitId": 310118450, - "SellerStockKeepingUnitId": "310118450", - "IsActive": true, - "FreightCommissionPercentage": 0.0, - "ProductCommissionPercentage": 0.0 - } - ], - "SalesChannels": [ - 1, - 3 - ], - "Images": [ + "FieldName": "Sauce", + "MaxCaracters": "", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + }, { - "ImageUrl": "https://lojadobreno.vteximg.com.br/arquivos/ids/155451/caixa-areia-azul-petmate.jpg?v=637139451191670000", - "ImageName": null, - "FileId": 155451 + "FieldName": "Toppings", + "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" } - ], - "Videos": [], - "SkuSpecifications": [], - "ProductSpecifications": [], - "ProductClustersIds": "151,158", - "PositionsInClusters": { - "151": 1, - "158": 2 - }, - "ProductClusterNames": { - "151": "asdfghj", - "158": "Coleção halloween" - }, - "ProductClusterHighlights": { - "151": "asdfghj" + ] + } + }, + "AttachmentRequest": { + "type": "object", + "required": [ + "Name", + "IsRequired", + "IsActive", + "Domains" + ], + "properties": { + "Name": { + "type": "string", + "description": "Attachment Name.", + "example": "Shirt customization" }, - "ProductCategoryIds": "/3/15/", - "IsDirectCategoryActive": true, - "ProductGlobalCategoryId": 5000, - "ProductCategories": { - "15": "Caixa de Areia", - "3": "Higiene", - "1": "Alimentação" + "IsRequired": { + "type": "boolean", + "description": "Defines if the attachment is required or not.", + "example": false }, - "CommercialConditionId": 1, - "RewardValue": 0.0, - "AlternateIds": { - "RefId": "1" + "IsActive": { + "type": "boolean", + "description": "Defines if the attachment is active or not.", + "example": false }, - "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 + "Domains": { + "type": "array", + "description": "List of characteristics related to the attachment.", + "items": { + "type": "object", + "properties": { + "FieldName": { + "type": "string", + "description": "Attachment key name.", + "example": "Number" + }, + "MaxCaracters": { + "type": "string", + "description": "Maximum number of characters in the attachment key.", + "example": "1" + }, + "DomainValues": { + "type": "string", + "description": "Allowed key values.", + "example": "7,9,10" + } + } + } + } + }, + "example": { + "Name": "Ingredients", + "IsRequired": true, + "IsActive": true, + "Domains": [ + { + "FieldName": "Sauce", + "MaxCaracters": "", + "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" + }, + { + "FieldName": "Toppings", + "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" + } + ] } }, - "SkulistbyProductId": { + "SupplierRequest": { "type": "object", + "required": [ + "Name", + "CorporateName", + "StateInscription", + "Cnpj", + "Phone", + "CellPhone", + "CorportePhone", + "Email", + "IsActive" + ], "properties": { - "IsPersisted": { - "type": "boolean", - "description": "Defines if the SKU is persisted." + "Name": { + "type": "string", + "description": "Supplier Name.", + "example": "Supplier" }, - "IsRemoved": { - "type": "boolean", - "deprecated": true, - "description": "Defines if the SKU is removed." + "CorporateName": { + "type": "string", + "description": "Supplier Corporate Name.", + "example": "TopStore" }, - "Id": { - "type": "integer", - "format": "int32", - "description": "SKU ID." + "StateInscription": { + "type": "string", + "description": "State Inscription.", + "example": "123456" }, - "ProductId": { - "type": "integer", - "format": "int32", - "description": "Product ID." + "Cnpj": { + "type": "string", + "description": "Corporate legal ID.", + "example": "33304981001272" + }, + "Phone": { + "type": "string", + "description": "Supplier Phone.", + "example": "3333333333" + }, + "CellPhone": { + "type": "string", + "description": "Supplier Cellphone.", + "example": "4444444444" + }, + "CorportePhone": { + "type": "string", + "description": "Supplier Corporate Phone.", + "example": "5555555555" + }, + "Email": { + "type": "string", + "description": "Supplier email.", + "example": "email@email.com" }, "IsActive": { "type": "boolean", - "description": "Defines if the SKU is active or not." + "description": "Defines if the Supplier is active (`true`) or not (`false`).", + "example": false + } + } + }, + "SupplierResponse": { + "type": "object", + "properties": { + "Id": { + "type": "integer", + "description": "Supplier unique identifier code.", + "example": 123 }, "Name": { "type": "string", - "description": "SKU Name." + "description": "Supplier Name.", + "example": "Supplier" }, - "Height": { - "type": "number", - "description": "SKU Height." + "CorporateName": { + "type": "string", + "description": "Supplier Corporate Name.", + "example": "TopStore" }, - "RealHeight": { - "type": "number", - "nullable": true, - "description": "Real SKU Height." + "StateInscription": { + "type": "string", + "description": "State Inscription.", + "example": "123456" }, - "Width": { - "type": "number", - "description": "SKU Width." + "Cnpj": { + "type": "string", + "description": "Corporate legal ID.", + "example": "33304981001272" }, - "RealWidth": { - "type": "number", - "nullable": true, - "description": "Real SKU Width." + "Phone": { + "type": "string", + "description": "Supplier Phone.", + "example": "3333333333" }, - "Length": { - "type": "number", - "description": "SKU Length." + "CellPhone": { + "type": "string", + "description": "Supplier Cellphone.", + "example": "4444444444" }, - "RealLength": { - "type": "number", - "nullable": true, - "description": "Real SKU Length." + "CorportePhone": { + "type": "string", + "description": "Supplier Corporate Phone.", + "example": "5555555555" }, - "WeightKg": { - "type": "number", - "nullable": true, - "description": "Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams." + "Email": { + "type": "string", + "description": "Supplier email.", + "example": "email@email.com" }, - "RealWeightKg": { - "type": "number", - "nullable": true, - "description": "Real Weight of the SKU in the measurement [configured in the store](https://help.vtex.com/en/tutorial/filling-in-system-settings--tutorials_269), which by default is in grams." + "IsActive": { + "type": "boolean", + "description": "Defines if the Supplier is active (`true`) or not (`false`).", + "example": false + } + } + }, + "Userorderslist": { + "title": "Userorderslist", + "required": ["list", "facets", "paging", "stats"], + "type": "object", + "description": "Order list object.", + "properties": { + "list": { + "type": "array", + "items": { + "$ref": "#/components/schemas/List1" + }, + "description": "List with user's orders details." }, - "ModalId": { - "type": "integer", - "format": "int32", - "description": "Delivery Method (Modal Type) ID." + "facets": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Array containing facets information." }, - "RefId": { - "type": "string", - "description": "Product Reference ID." + "paging": { + "$ref": "#/components/schemas/Paging" }, - "CubicWeight": { - "type": "number", - "description": "[Cubic weight](https://help.vtex.com/en/tutorial/understanding-the-cubic-weight-factor--tutorials_128)." + "stats": { + "$ref": "#/components/schemas/Stats2" + } + } + }, + "List1": { + "title": "List1", + "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", + "description": "Order ID is a unique code that identifies an order." }, - "IsKit": { - "type": "boolean", - "description": "Flag to set whether the product SKU is made up of one or more SKUs, thereby becoming a bundle. Must be enabled if you are adding a bundle. Once activated, the flag cannot be reverted." + "creationDate": { + "type": "string", + "description": "Order's creation date." }, - "IsDynamicKit": { + "clientName": { "type": "string", + "description": "Order's customer name." + }, + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item2" + }, + "description": "Information about order's items.", "nullable": true, "deprecated": true }, - "InternalNote": { + "totalValue": { + "type": "integer", + "description": "Total value amount." + }, + "paymentNames": { "type": "string", "nullable": true, - "description": "Internal note." + "description": "Payment system name." }, - "DateUpdated": { + "status": { "type": "string", - "description": "Date when the product was updated for the most recent time." + "description": "Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)." }, - "RewardValue": { - "type": "number", + "statusDescription": { + "type": "string", + "description": "Status description which is displayed on the Admin panel. This field is deprecated and may not return any value.", + "deprecated": true + }, + "marketPlaceOrderId": { + "type": "string", "nullable": true, - "description": "Reward value related to the SKU." + "description": "Marketplace order ID." }, - "CommercialConditionId": { - "type": "integer", - "format": "int32", - "description": "SKU Commercial Condition ID." + "sequence": { + "type": "string", + "description": "Six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`." + }, + "salesChannel": { + "type": "string", + "description": "Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order." }, - "EstimatedDateArrival": { + "affiliateId": { "type": "string", - "nullable": true, - "description": "SKU estimated arrival date in [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) format, when the product is on pre-sale. You must take into consideration both the launch date and the freight calculation for the arrival date." + "description": "Corresponds to the three-digits [affiliate](https://help.vtex.com/en/tutorial/configuring-affiliates--tutorials_187) identification code of the seller responsible for the order." }, - "FlagKitItensSellApart": { + "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`." + }, + "workflowInErrorState": { "type": "boolean", - "description": "Defines if the SKU bundle items can be sold separately." + "description": "If there is a work flow error (`true`) or not (`false`)." }, - "ManufacturerCode": { - "type": "string", - "description": "Product Supplier ID." + "workflowInRetry": { + "type": "boolean", + "description": "If the order is in a work flow retry (`true`) or not (`false`)." }, - "ReferenceStockKeepingUnitId": { + "lastMessageUnread": { "type": "string", "nullable": true, - "description": "SKU Reference ID." - }, - "Position": { - "type": "integer", - "format": "int32", - "description": "SKU Position." + "description": "Last sent transactional message." }, - "ActivateIfPossible": { - "type": "boolean", - "description": "When set to `true`, this attribute will automatically update the SKU as active once associated with an image or an active component." + "ShippingEstimatedDate": { + "type": "string", + "nullable": true, + "description": "Estimate shipping date." }, - "MeasurementUnit": { + "ShippingEstimatedDateMax": { "type": "string", - "description": "Measurement unit." + "nullable": true, + "description": "The most extended shipping estimation possible." }, - "UnitMultiplier": { - "type": "number", - "description": "This is the multiple number of SKU. If the Multiplier is 5.0000, the product can be added in multiple quantities of 5, 10, 15, 20, onward." + "ShippingEstimatedDateMin": { + "type": "string", + "nullable": true, + "description": "The least extended shipping estimation possible." }, - "IsInventoried": { + "orderIsComplete": { "type": "boolean", + "description": "If it is a completed order (`true`) or not (`false`). For more information, see [Order flow and status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)." + }, + "listId": { + "type": "string", "nullable": true, - "deprecated": true + "description": "Related Gift List ID." }, - "IsTransported": { - "type": "boolean", + "listType": { + "type": "string", "nullable": true, - "deprecated": true + "description": "Related Gift list type." }, - "IsGiftCardRecharge": { - "type": "boolean", + "authorizedDate": { + "type": "string", "nullable": true, - "description": "Defines if the purchase of the SKU will generate reward value for the customer." + "description": "Authorized order date." }, - "ModalType": { + "callCenterOperatorName": { "type": "string", "nullable": true, - "description": "Links an unusual type of SKU to a carrier specialized in delivering it. This field should be filled in with the name of the modal (e.g. \"Chemicals\" or \"Refrigerated products\"). To learn more about this feature, read our articles [How the modal works](https://help.vtex.com/en/tutorial/how-does-the-modal-work--tutorials_125) and [Setting up modal for carriers](https://help.vtex.com/en/tutorial/configure-modal--3jhLqxuPhuiq24UoykCcqy)." + "description": "Call center operator responsible for the order." }, - "isKitOptimized": { - "type": "boolean", - "description": "Defines if the SKU is a Optimized bundle." + "totalItems": { + "type": "integer", + "description": "Order's total amount of items." + }, + "currencyCode": { + "type": "string", + "nullable": true, + "description": "Currency code in ISO 4217. For example, `BRL`." } }, "example": { - "IsPersisted": true, - "Id": 1, - "ProductId": 1, - "IsActive": true, - "Name": "Ração Royal Canin Feline Urinary 500g", - "Height": 6.5000, - "RealHeight": 2.2000, - "Width": 14.0000, - "RealWidth": 3.3000, - "Length": 24.0000, - "RealLength": 4.4000, - "WeightKg": 550.0000, - "RealWeightKg": 1.1000, - "ModalId": 1, - "RefId": "0001", - "CubicWeight": 1.0000, - "IsKit": false, - "InternalNote": null, - "DateUpdated": "2021-10-29T18:25:00", - "RewardValue": null, - "CommercialConditionId": 1, - "EstimatedDateArrival": null, - "FlagKitItensSellApart": false, - "ManufacturerCode": "", - "ReferenceStockKeepingUnitId": null, - "Position": 1, - "ActivateIfPossible": true, - "MeasurementUnit": "un", - "UnitMultiplier": 300.0000, - "IsInventoried": true, - "IsTransported": true, - "IsGiftCardRecharge": false, - "ModalType": null, - "isKitOptimized": false + "orderId": "1172452900788-01", + "creationDate": "2019-01-28T20:09:43+00:00", + "clientName": "Cunha VTEX", + "items": [ + { + "seller": "1", + "quantity": 1, + "description": "Reservoir hose", + "ean": null, + "refId": "TE3121110", + "id": "195", + "productId": "134", + "sellingPrice": 7390, + "price": 7390 + }, + { + "seller": "1", + "quantity": 1, + "description": "Reservoir filter", + "ean": null, + "refId": "XC459N610CA", + "id": "238", + "productId": "162", + "sellingPrice": 5190, + "price": 5190 + } + ], + "totalValue": 1160, + "paymentNames": "Boleto Bancário", + "status": "handling", + "statusDescription": "Preparing for delivery", + "marketPlaceOrderId": null, + "sequence": "502556", + "salesChannel": "1", + "affiliateId": "GTB", + "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" } }, - "CreateSellerRequest": { - "type": "object", + "Item2": { + "title": "Item2", "required": [ - "SellerId", - "Name", - "Email", - "Description", - "ExchangeReturnPolicy", - "DeliveryPolicy", - "UseHybridPaymentOptions", - "UserName", - "Password", - "SecutityPrivacyPolicy", - "CNPJ", - "CSCIdentification", - "ArchiveId", - "UrlLogo", - "ProductCommissionPercentage", - "FreightCommissionPercentage", - "FulfillmentEndpoint", - "CatalogSystemEndpoint", - "IsActive", - "FulfillmentSellerId", - "SellerType", - "IsBetterScope" + "seller", + "quantity", + "description", + "ean", + "refId", + "id", + "productId", + "sellingPrice", + "price" ], + "type": "object", "properties": { - "SellerId": { + "seller": { "type": "string", - "description": "Code used to identify the seller. It is assigned by the marketplace. We recommend filling it in with the seller's account name.", - "example": "pedrostore" + "description": "Seller related to the order." }, - "Name": { - "type": "string", - "description": "Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method.", - "example": "My pedrostore" + "quantity": { + "type": "integer", + "description": "Quantity of SKUs." }, - "Email": { + "description": { "type": "string", - "description": "Email of the admin responsible for the seller.", - "example": "breno@breno.com" + "description": "Description of items." }, - "Description": { + "ean": { "type": "string", - "description": "Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563).", - "example": "Brief description" + "nullable": true, + "description": "EAN of the SKU." }, - "ExchangeReturnPolicy": { + "refId": { "type": "string", - "description": "Text describing the exchange and return policy previously agreed between the marketplace and the seller.", - "example": "Exchange return policy text" + "nullable": true, + "description": "Item's reference ID." }, - "DeliveryPolicy": { + "id": { "type": "string", - "description": "Text describing the delivery policy previously agreed between the marketplace and the seller.", - "example": "Delivery policy text" - }, - "UseHybridPaymentOptions": { - "type": "boolean", - "description": "Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller.", - "example": false + "description": "Item's SKU ID, which is a unique numerical identifier." }, - "UserName": { + "productId": { "type": "string", - "description": "Seller username.", - "example": "myseller" + "description": "ID of the Product associated with the item." }, - "Password": { - "type": "string", - "description": "Seller password.", - "example": "passoword" + "sellingPrice": { + "type": "integer", + "description": "Details on item's selling price." }, - "SecutityPrivacyPolicy": { - "type": "string", - "description": "Text describing the security policy previously agreed between the marketplace and the seller.", - "example": "Secutity privacy policy text" + "price": { + "type": "integer", + "description": "Item's price." + } + }, + "example": { + "seller": "1", + "quantity": 1, + "description": "Mangueira Reservatório Ao Cavalete", + "ean": null, + "refId": "TE3121110", + "id": "195", + "productId": "134", + "sellingPrice": 7390, + "price": 7390 + } + }, + "Paging": { + "type": "object", + "description": "Pagination information.", + "required": [ + "total", + "pages", + "currentPage", + "perPage" + ], + "properties": { + "total": { + "type": "integer", + "description": "Total number of orders." }, - "CNPJ": { - "type": "string", - "description": "Company registration number.", - "example": "12035072751" + "pages": { + "type": "integer", + "description": "Total number of pages." }, - "CSCIdentification": { - "type": "string", - "description": "CSC identification.", - "example": "pedrostore" + "currentPage": { + "type": "integer", + "description": "Number of the current page." }, - "ArchiveId": { + "perPage": { "type": "integer", - "description": "Seller archive ID.", - "example": 1 + "description": "Number of orders per page." + } + } + }, + "Stats2": { + "title": "Stats2", + "required": ["stats"], + "type": "object", + "properties": { + "stats": { + "$ref": "#/components/schemas/Stats3" + } + }, + "example": { + "stats": { + "totalValue": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + }, + "totalItems": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + } + } + } + }, + "Stats3": { + "title": "Stats3", + "required": ["totalValue", "totalItems"], + "type": "object", + "properties": { + "totalValue": { + "$ref": "#/components/schemas/TotalValue1" }, - "UrlLogo": { - "type": "string", - "description": "Seller URL logo.", - "example": "/myseller" + "totalItems": { + "$ref": "#/components/schemas/TotalItems1" + } + }, + "example": { + "totalValue": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + }, + "totalItems": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + } + } + }, + "TotalValue1": { + "title": "TotalValue1", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" }, - "ProductCommissionPercentage": { - "type": "number", - "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", - "example": 0.0 + "Max": { + "type": "integer" }, - "FreightCommissionPercentage": { - "type": "number", - "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", - "example": 0.0 + "Mean": { + "type": "integer" }, - "CategoryCommissionPercentage": { - "type": "string", - "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", - "example": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]" + "Min": { + "type": "integer" }, - "FulfillmentEndpoint": { - "type": "string", - "description": "URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added.", - "example": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1" + "Missing": { + "type": "integer" }, - "CatalogSystemEndpoint": { - "type": "string", - "description": "URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`.", - "example": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/" + "StdDev": { + "type": "integer" }, - "IsActive": { - "type": "boolean", - "description": "If the selle is active (`true`) or not (`false`).", - "example": true + "Sum": { + "type": "integer" }, - "MerchantName": { - "type": "string", - "description": "Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more.", - "example": "pedrostore" + "SumOfSquares": { + "type": "integer" }, - "FulfillmentSellerId": { - "type": "integer", - "description": "Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank.", - "example": 1 + "Facets": { + "type": "object" + } + }, + "example": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} + } + }, + "TotalItems1": { + "title": "TotalItems1", + "required": [ + "Count", + "Max", + "Mean", + "Min", + "Missing", + "StdDev", + "Sum", + "SumOfSquares", + "Facets" + ], + "type": "object", + "properties": { + "Count": { + "type": "integer" }, - "SellerType": { - "type": "integer", - "description": "Seller type.", - "example": 1 + "Max": { + "type": "integer" }, - "IsBetterScope": { - "type": "boolean", - "description": "Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI).", - "example": false + "Mean": { + "type": "integer" }, - "TrustPolicy": { - "type": "string", - "description": "Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`.", - "example": "Default" + "Min": { + "type": "integer" + }, + "Missing": { + "type": "integer" + }, + "StdDev": { + "type": "integer" + }, + "Sum": { + "type": "integer" + }, + "SumOfSquares": { + "type": "integer" + }, + "Facets": { + "type": "object" } + }, + "example": { + "Count": 19, + "Max": 0, + "Mean": 0, + "Min": 0, + "Missing": 0, + "StdDev": 0, + "Sum": 0, + "SumOfSquares": 0, + "Facets": {} } }, - "UpdateSellerRequest": { - "type": "object", + "Userorderdetails": { + "title": "Userorderdetails", "required": [ - "SellerId", - "Name", - "Email", - "Description", - "ExchangeReturnPolicy", - "DeliveryPolicy", - "UseHybridPaymentOptions", - "UserName", - "Password", - "SecutityPrivacyPolicy", - "CNPJ", - "CSCIdentification", - "ArchiveId", - "UrlLogo", - "ProductCommissionPercentage", - "FreightCommissionPercentage", - "FulfillmentEndpoint", - "CatalogSystemEndpoint", - "IsActive", - "FulfillmentSellerId", - "SellerType", - "IsBetterScope" + "orderId", + "sequence", + "marketplaceOrderId", + "marketplaceServicesEndpoint", + "sellerOrderId", + "origin", + "affiliateId", + "salesChannel", + "merchantName", + "status", + "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" ], + "type": "object", "properties": { - "SellerId": { + "orderId": { "type": "string", - "description": "ID that identifies the seller in the marketplace. It can be the same as the seller name or a unique number. Check the **Sellers management** section in the Admin to get the correct ID.", - "example": "pedrostore" + "description": "Order ID is a unique code that identifies an order." }, - "Name": { + "sequence": { "type": "string", - "description": "Name of the account in the seller's environment. You can find it on **Account settings > Account > Account Name**). Applicable only if the seller uses their own payment method.", - "example": "My pedrostore" + "description": "Sequence is a six-digit string that follows the order ID. For example, in order `1268540501456-01 (501456)`, the sequence is `501456`." }, - "Email": { + "marketplaceOrderId": { "type": "string", - "description": "Email of the admin responsible for the seller.", - "example": "breno@breno.com" + "description": "Marketplace order ID." }, - "Description": { + "marketplaceServicesEndpoint": { "type": "string", - "description": "Text describing the seller with a marketing tone. You can display this text in the marketplace window display by [customizing the CMS](https://help.vtex.com/en/tutorial/list-of-controls-for-templates--tutorials_563).", - "example": "Brief description" + "description": "Marketplace services endpoint." }, - "ExchangeReturnPolicy": { + "sellerOrderId": { "type": "string", - "description": "Text describing the exchange and return policy previously agreed between the marketplace and the seller.", - "example": "Exchange return policy text" + "description": "ID of the seller related to the order. It can be a VTEX seller or an external seller." }, - "DeliveryPolicy": { + "origin": { "type": "string", - "description": "Text describing the delivery policy previously agreed between the marketplace and the seller.", - "example": "Delivery policy text" - }, - "UseHybridPaymentOptions": { - "type": "boolean", - "description": "Allows customers to use gift cards from the seller to buy their products on the marketplace. It identifies purchases made with a gift card so that only the final price (with discounts applied) is paid to the seller.", - "example": false + "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`." }, - "UserName": { + "affiliateId": { "type": "string", - "description": "Seller username.", - "example": "myseller" + "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." }, - "Password": { + "salesChannel": { "type": "string", - "description": "Seller password.", - "example": "passoword" + "description": "Sales channel (or [trade policy](https://help.vtex.com/tutorial/how-trade-policies-work--6Xef8PZiFm40kg2STrMkMV)) ID related to the order." }, - "SecutityPrivacyPolicy": { + "merchantName": { "type": "string", - "description": "Text describing the security policy previously agreed between the marketplace and the seller.", - "example": "Secutity privacy policy text" + "description": "Name of the merchant." }, - "CNPJ": { + "status": { "type": "string", - "description": "Company registration number.", - "example": "12035072751" + "description": "Order [status](https://help.vtex.com/en/tutorial/order-flow-and-status--tutorials_196)." }, - "CSCIdentification": { + "statusDescription": { "type": "string", - "description": "CSC identification.", - "example": "pedrostore" + "description": "`Deprecated`. Status description which is displayed on the Admin panel. This field is obsolete and may not return any value.", + "deprecated": true }, - "ArchiveId": { + "value": { "type": "integer", - "description": "Seller archive ID.", - "example": 1 - }, - "UrlLogo": { - "type": "string", - "description": "Seller URL logo.", - "example": "/myseller" - }, - "ProductCommissionPercentage": { - "type": "number", - "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", - "example": 0.0 - }, - "FreightCommissionPercentage": { - "type": "number", - "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", - "example": 0.0 + "description": "Order's total amount." }, - "CategoryCommissionPercentage": { + "creationDate": { "type": "string", - "description": "The percentage that must be filled in as agreed between the marketplace and the seller. If there is no such commission, please fill in the field with the value: `0.00`.", - "example": "[{\"CategoryId\":14,\"ProductCommission\":15.0,\"FreightCommission\":0.0}]" + "description": "Order's creation date." }, - "FulfillmentEndpoint": { + "lastChange": { "type": "string", - "description": "URL of the endpoint for fulfillment of seller's orders, which the marketplace will use to communicate with the seller. This field applies to all sellers, regardless of their type. However, for `VTEX Stores`, you don’t need to fill it in because the system will do that automatically. You can edit this field once the seller has been successfully added.", - "example": "http://pedrostore.vtexcommercestable.com.br/api/fulfillment?affiliateid=LDB&sc=1" + "description": "Order's last change date." }, - "CatalogSystemEndpoint": { + "orderGroup": { "type": "string", - "description": "URL of the endpoint of the seller's catalog. This field will only be displayed if the seller type is VTEX Store. The field format will be as follows: `http://{sellerName}.vtexcommercestable.com.br/api/catalog_system/`.", - "example": "http://pedrostore.vtexcommercestable.com.br/api/catalog_system/" - }, - "IsActive": { - "type": "boolean", - "description": "If the selle is active (`true`) or not (`false`).", - "example": true + "description": "Order's group ID." }, - "MerchantName": { - "type": "string", - "description": "Name of the marketplace, used to guide payments. This field should be nulled if the marketplace is responsible for processing payments. Check out our [Split Payment](https://help.vtex.com/en/tutorial/split-payment--6k5JidhYRUxileNolY2VLx) article to know more.", - "example": "pedrostore" + "totals": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Total" + }, + "description": "List with details about orders' totals." }, - "FulfillmentSellerId": { - "type": "integer", - "description": "Identification code of the seller responsible for fulfilling the order. This is an optional field used when a seller sells SKUs from another seller. If the seller sells their own SKUs, it must be left blank.", - "example": 1 + "items": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Item" + }, + "description": "Information about order's items." }, - "SellerType": { - "type": "integer", - "description": "Seller type.", - "example": 1 + "marketplaceItems": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Marketplace details object." }, - "IsBetterScope": { - "type": "boolean", - "description": "Indicates whether it is a [comprehensive seller](https://help.vtex.com/en/tutorial/comprehensive-seller--5Qn4O2GpjUIzWTPpvLUfkI).", - "example": false + "clientProfileData": { + "$ref": "#/components/schemas/ClientProfileData" }, - "TrustPolicy": { + "giftRegistryData": { "type": "string", - "description": "Seller trust policy. The default value is `'Default'`, but if your store is a B2B marketplace and you want to share the customers'emails with the sellers you need to set this field as `'AllowEmailSharing'`.", - "example": "Default" - } - } - }, - "CategorySpecification": { - "required": [ - "Name", - "CategoryId", - "FieldId", - "IsActive", - "IsStockKeepingUnit" - ], - "type": "array", - "description": "Array of objects.", - "items": { - "type": "object", - "description": "Object containing Specification information.", - "properties": { - "Name": { - "type": "string", - "description": "Specification name. Limited to 100 characters.", - "example": "Composition" - }, - "CategoryId": { - "type": "integer", - "description": "Category ID.", - "example": 1 - }, - "FieldId": { - "type": "integer", - "description": "Specification field ID.", - "example": 1 - }, - "IsActive": { - "type": "boolean", - "description": "Defines if the specification is active.", - "example": true - }, - "IsStockKeepingUnit": { - "type": "boolean", - "description": "Defines if it is an SKU specification.", - "example": true - } - } - }, - "example": [ - { - "Name": "Specification A", - "CategoryId": 1, - "FieldId": 33, - "IsActive": true, - "IsStockKeepingUnit": false - }, - { - "Name": "Specification B", - "CategoryId": 1, - "FieldId": 34, - "IsActive": true, - "IsStockKeepingUnit": false + "nullable": true, + "description": "Information about gift list, when it applies." }, - { - "Name": "Specification C", - "CategoryId": 1, - "FieldId": 35, - "IsActive": false, - "IsStockKeepingUnit": false - } - ] - }, - "GetSpecFieldValue": { - "required": [ - "FieldValueId", - "Value", - "IsActive", - "Position" - ], - "type": "object", - "properties": { - "FieldValueId": { - "type": "integer", - "format": "int32", - "description": "Specification Field Value ID." + "marketingData": { + "type": "object", + "description": "Information about promotions and marketing. For example, coupon tracking information and internal or external UTMs.", + "required": [ + "id", + "utmSource", + "utmPartner", + "utmMedium", + "utmCampaign", + "coupon", + "utmiCampaign", + "utmipage", + "utmiPart", + "marketingTags" + ], + "properties": { + "id": { + "type": "string", + "description": "Object ID which 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's code information." + }, + "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" + } + } + } }, - "Value": { - "type": "string", - "description": "Specification Field Value." + "ratesAndBenefitsData": { + "$ref": "#/components/schemas/RatesAndBenefitsData" }, - "IsActive": { - "type": "boolean", - "description": "Defines if the Specification Field is active (`true`) or inactive (`false`)." + "shippingData": { + "$ref": "#/components/schemas/ShippingData" }, - "Position": { - "type": "integer", - "format": "int32", - "description": "Specification Field Value Position." - } - }, - "example": { - "FieldValueId": 52, - "Value": "0 a 6 meses", - "IsActive": true, - "Position": 1 - } - }, - "SpecificationsInsertFieldRequest": { - "required": [ - "Name", - "CategoryId", - "IsActive", - "FieldId", - "IsRequired", - "FieldTypeId", - "FieldValueId", - "Description", - "IsStockKeepingUnit", - "IsFilter", - "IsOnProductDetails", - "Position", - "IsWizard", - "IsTopMenuLinkActive", - "IsSideMenuLinkActive", - "DefaultValue", - "FieldGroupId", - "FieldGroupName" - ], - "type": "object", - "properties": { - "Name": { - "type": "string", - "description": "Specification Field name. Limited to 100 characters." + "paymentData": { + "$ref": "#/components/schemas/PaymentData" }, - "CategoryId": { - "type": "integer", + "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": "Category ID." + "description": "Call center operator responsible for the order." }, - "FieldId": { - "type": "integer", + "followUpEmail": { + "type": "string", + "description": "Email of the store's employee responsible for managing the order." + }, + "lastMessage": { + "type": "string", "nullable": true, - "description": "Specification Field ID." + "description": "Last sent transactional message." }, - "IsActive": { - "type": "boolean", - "description": "Defines if the Specification Field is active. The default value is `true`." + "hostname": { + "type": "string", + "description": "Account Hostname registered in License Manager." }, - "IsRequired": { - "type": "boolean", - "description": "Makes the Specification Field mandatory (`true`) or optional (`false`)." + "invoiceData": { + "type": "object", + "description": "Information pertinent to the order's invoice.", + "nullable": true }, - "FieldTypeId": { - "type": "integer", - "format": "int32", - "description": "Specification Field Type ID." + "changesAttachment": { + "$ref": "#/components/schemas/ChangesAttachment" }, - "FieldValueId": { + "openTextField": { + "type": "string", + "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.", + "nullable": true + }, + "roundingError": { "type": "integer", - "nullable": true, - "description": "Specification Field Value ID." + "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." }, - "Description": { + "orderFormId": { "type": "string", - "nullable": true, - "description": "Specification Field Description." + "description": "[Order form](https://developers.vtex.com/docs/guides/orderform-fields) ID." }, - "IsStockKeepingUnit": { - "type": "boolean", - "description": "If `true`, it will be added as a SKU specification. If `false`, it will be added as a product specification field." + "commercialConditionData": { + "type": "string", + "nullable": true, + "description": "Information about commercial conditions." }, - "IsFilter": { + "isCompleted": { "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar.\r\n" + "description": "When set as `true`, the order's payment has been settled, and when set as `false`, it has not been settled yet." }, - "IsOnProductDetails": { - "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page.\r\n" + "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." }, - "Position": { - "type": "integer", - "format": "int32", - "description": "Specification Field Position." + "storePreferencesData": { + "$ref": "#/components/schemas/StorePreferencesData" }, - "IsWizard": { + "allowCancellation": { "type": "boolean", - "description": "Deprecated field.", - "deprecated": true + "description": "When set as `true`, the order can be canceled, and when set as `false`, it is no longer possible to cancel the order." }, - "IsTopMenuLinkActive": { + "allowEdition": { "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu.\r\n" + "description": "When set as `true`, the order can be edited, and when set as `false`, it is no longer possible to edit the order." }, - "IsSideMenuLinkActive": { + "isCheckedIn": { "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar.\r\n" + "description": "This field is set `true` when the order was made via inStore and `false` when it was not." }, - "DefaultValue": { + "marketplace": { + "$ref": "#/components/schemas/Marketplace" + }, + "authorizedDate": { + "type": "string", + "description": "Authorized order date." + }, + "invoicedDate": { "type": "string", "nullable": true, - "description": "Specification Field default Value." + "description": "Order's invoice date." }, - "FieldGroupId": { - "type": "integer", - "format": "int32", - "description": "Specification Field Group ID." + "cancelReason": { + "type": "string", + "description": "Reason for order cancellation.", + "nullable": true }, - "FieldGroupName": { + "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](https://help.vtex.com/en/tutorial/assembly-options--5x5FhNr4f5RUGDEGWzV1nH) related to the item, if there are any.", + "items": { + "required": [ + "Id", + "Name", + "Required", + "InputValues", + "Composition" + ], + "type": "object", + "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": "If this field is set as `true`, when the customer purchases the item sending the attachment is required, and when set as `false`, sending the attachment is optional." + }, + "InputValues": { + "type": "object", + "description": "Displays the attachment's content.", + "nullable": true + }, + "Composition": { + "type": "object", + "description": "Displays the attachment's composition.", + "nullable": true + } + } + } + } + } + } + } + } + }, + "subscriptionData": { + "type": "object", + "description": "Information about [subscriptions](https://help.vtex.com/tutorial/how-subscriptions-work--frequentlyAskedQuestions_4453).", + "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. The first order will have the value `0`, the second will have the value `1`, and so on." + }, + "PriceAtSubscriptionDate": { + "type": "number", + "description": "Price of the order when the customer signed up for subscriptions. Subscriptions created from Admin UI or APIs do not have an original order, so the field returns `0.0`. This field was valid only for Subscriptions v2 and is deprecated in Subscriptions v3.", + "deprecated": true + }, + "ItemIndex": { + "type": "integer", + "description": "Each item in the subscriptions' order is identified by an index. The position starts in`0`, followed by `1`, `2`, and so on." + }, + "Plan": { + "type": "object", + "description": "Information about the subscription's validility 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. The possible values are `DAILY`,`WEEKLY`, `MONTHLY` and `YEARLY`." + }, + "interval": { + "type": "integer", + "description": "Number of the time interval configured between subscription orders, which depends on the periodicity. For a `DAILY` periodicity, the field's value will correspond to days, for `MONTHLY` to months, and so on." + } + } + }, + "validity": { + "type": "object", + "description": "Information about the period during which the subscription will be valid.", + "required": [ + "begin", + "end" + ], + "properties": { + "begin": { + "type": "string", + "description": "Subscriptions' beginning date with the format `yyyy-mm-ddThh:mm:ss`." + }, + "end": { + "type": "string", + "description": "Subscriptions' ending date with the format `yyyy-mm-ddThh:mm:ss`." + } + } + } + } + } + } + } + } + } + }, + "taxData": { + "type": "object", + "description": "Order's tax information.", + "required": [ + "areTaxesDesignatedByMarketplace", + "taxInfoCollection" + ], + "properties": { + "areTaxesDesignatedByMarketplace": { + "type": "boolean", + "description": "If the taxes were designated by the marketplace (`true`) or not (`false`)." + }, + "taxInfoCollection": { + "type": "array", + "description": "Array with taxes' details.", + "items": { + "type": "object", + "required": [ + "itemIndex", + "sku", + "priceTags" + ], + "properties": { + "itemIndex": { + "type": "integer", + "description": "Item's indexing number." + }, + "sku": { + "type": "string", + "description": "Alphanumeric sequence that identifies an SKU." + }, + "priceTags": { + "type": "array", + "description": "Price tag information.", + "items": { + "type": "object", + "required": [ + "isPercentual", + "name", + "rawValue" + ], + "properties": { + "isPercentual": { + "type": "boolean", + "description": "If the tax is a percentage (`true`) or note (`false`)." + }, + "name": { + "type": "string", + "description": "Name that identifies the tax." + }, + "rawValue": { + "type": "string", + "description": "The amount that corresponds to the tax." + } + } + } + } + } + } + } + } + }, + "checkedInPickupPointId": { "type": "string", - "description": "Specification Field Group Name." + "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": { + "type": "object", + "description": "Information about order cancellation, when it applies.", + "required": [ + "RequestedByUser", + "RequestedBySystem", + "RequestedBySellerNotification", + "RequestedByPaymentNotification", + "Reason", + "CancellationDate" + ], + "properties": { + "RequestedByUser": { + "type": "boolean", + "description": "If the order cancellation was requested by the costumer (`true`) or not (`false`)." + }, + "RequestedBySystem": { + "type": "boolean", + "description": "If the order cancellation was made by the system (`true`) or not (`false`). This type of order cancellation happens in [incomplete orders](https://help.vtex.com/en/tutorial/how-incomplete-orders-work--tutorials_294), for example." + }, + "RequestedBySellerNotification": { + "type": "boolean", + "description": "If the order cancellation was requested by the seller (`true`) or not (`false`)." + }, + "RequestedByPaymentNotification": { + "type": "boolean", + "description": "If the order cancellation was requested by the payment gateway (`true`) or not (`false`)." + }, + "Reason": { + "type": "string", + "description": "The reason why the order was cancelled." + }, + "CancellationDate": { + "type": "string", + "description": "The date when the order was cancelled." + } + } + }, + "clientPreferencesData": { + "type": "object", + "description": "Information about customer's preferences.", + "required": [ + "locale", + "optinNewsLetter" + ], + "properties": { + "locale": { + "type": "string", + "description": "Customer's prefered language while accessing the store." + }, + "optinNewsLetter": { + "type": "boolean", + "description": "When set as `true`, this field indicates customers opted to receive the newsletters, and when set as `false`, it means they did not." + } + } } }, "example": { - "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" + "orderId": "v502556llux-01", + "sequence": "502556", + "marketplaceOrderId": "", + "marketplaceServicesEndpoint": "http://oms.vtexinternal.com.br/api/oms?an=luxstore", + "sellerOrderId": "00-v502556llux-01", + "origin": "Marketplace", + "affiliateId": "", + "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": "1234568358", + "productId": "9429485", + "ean": null, + "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/", + "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", + "utmMedium": "utm medium", + "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": "region13", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "0d", + "pickupDistance": 29.861602783203125 + }, + { + "id": "Expressa", + "name": "Expressa", + "shippingEstimate": "5bd", + "deliveryWindow": null, + "price": 1160, + "deliveryChannel": "delivery", + "pickupStoreInfo": { + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false + }, + "polygonName": "region13", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "0d", + "pickupDistance": 29.861602783203125 + }, + { + "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": "region13", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "0d", + "pickupDistance": 29.861602783203125 + }, + { + "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": "region13", + "lockTTL": "12d", + "pickupPointId": "1_VTEX-RJ", + "transitTime": "0d", + "pickupDistance": 29.861602783203125 + } + ], + "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": "region56", + "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": { + "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 + } } }, - "SpecificationsInsertFieldUpdateRequest": { + "Total": { "required": [ - "Name", - "CategoryId", - "IsActive", - "FieldId", - "IsRequired", - "FieldTypeId", - "Description", - "IsStockKeepingUnit", - "IsWizard", - "IsFilter", - "IsOnProductDetails", - "Position", - "IsTopMenuLinkActive", - "IsSideMenuLinkActive", - "DefaultValue", - "FieldGroupId", - "FieldGroupName" + "id", + "name", + "value" ], "type": "object", + "description": "Object about order's totals.", "properties": { - "Name": { + "id": { "type": "string", - "description": "Specification Field ID." - }, - "CategoryId": { - "type": "integer", - "nullable": true, - "description": "Category ID." - }, - "FieldId": { - "type": "integer", - "nullable": true, - "description": "Specification Field ID." - }, - "IsActive": { - "type": "boolean", - "description": "Enables(`true`) or disables (`false`) the Specification Field.", - "example": true + "description": "Code that identifies if the information is about `Items`, `Discounts`, `Shipping`, `Tax` or `Change`." }, - "IsRequired": { - "type": "boolean", - "description": "Makes the Specification Field mandatory (`true`) or optional (`false`)." - }, - "FieldTypeId": { - "type": "integer", - "format": "int32", - "description": "Specification Field Type ID." + "name": { + "type": "string", + "description": "Name of `Items`, `Discounts`, `Shipping`, `Tax` or `Change`." }, - "FieldValueId": { + "value": { "type": "integer", - "nullable": true, - "description": "Specification Field Value ID." - }, - "Description": { + "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", - "nullable": true, - "description": "Specification Field Description." - }, - "IsStockKeepingUnit": { - "type": "boolean", - "description": "If `true`, it will be added as a SKU specification field. If `false`, it will be added as a product specification field." + "description": "Object ID, the expected value is `clientProfileData`." }, - "IsFilter": { - "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To allow the specification to be used as a facet (filter) on the search navigation bar.\r\n" + "email": { + "type": "string", + "description": "Customer's email." }, - "IsOnProductDetails": { - "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal -If specification is visible on the product page.\r\n" + "firstName": { + "type": "string", + "description": "Customer's first name." }, - "Position": { - "type": "integer", - "format": "int32", - "description": "Specification Field Position." + "lastName": { + "type": "string", + "description": "Customer's last name." }, - "IsWizard": { - "type": "boolean", - "description": "Deprecated field.", - "deprecated": true + "documentType": { + "type": "string", + "description": "Type of the document informed by the customer." }, - "IsTopMenuLinkActive": { - "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification visible in the store's upper menu.\r\n" + "document": { + "type": "string", + "description": "Document identification code informed by the customer." }, - "IsSideMenuLinkActive": { - "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - To make the specification field clickable in the search navigation bar.\r\n", - "example": false + "phone": { + "type": "string", + "description": "Customers's phone number." }, - "DefaultValue": { + "corporateName": { "type": "string", "nullable": true, - "description": "Specification Field default Value." + "description": "If the customer is a legal entity, here goes the corporate name." }, - "FieldGroupId": { - "type": "integer", - "format": "int32", - "description": "Specification Field Group ID." + "tradeName": { + "type": "string", + "nullable": true, + "description": "If the customer is a legal entity, here goes the trade name." }, - "FieldGroupName": { + "corporateDocument": { "type": "string", - "description": "Specification Field Group Name." - } - } - }, - "SpecificationsInsertFieldValueRequest": { - "required": [ - "FieldId", - "Name", - "Text", - "IsActive", - "Position" - ], - "type": "object", - "properties": { - "FieldId": { - "type": "integer", - "format": "int32", - "description": "Specification Field ID." + "nullable": true, + "description": "If the customer is a legal entity, here goes the corporate document." }, - "Name": { + "stateInscription": { "type": "string", - "description": "Specification Field Value Name." + "nullable": true, + "description": "If the customer is a legal entity, here goes the state inscription." }, - "Text": { + "corporatePhone": { "type": "string", - "description": "Specification Field Value Description." + "nullable": true, + "description": "If the customer is a legal entity, here goes the corpany's phone number." }, - "IsActive": { + "isCorporate": { "type": "boolean", - "description": "Defines if the Specification Field Value is active (`true`) or inactive (`false`)." + "description": "The value is `true` when the customer is a legal entity and `false` when not." }, - "Position": { - "type": "integer", - "format": "int32", - "description": "Specification Field Value Position." + "userProfileId": { + "type": "string", + "description": "Customer user profile ID." + }, + "customerClass": { + "type": "string", + "nullable": true, + "description": "Identification of the class the customer belongs to." } }, "example": { - "FieldValueId": 143, - "FieldId": 34, - "Name": "Cotton", - "Text": "Cotton fibers", - "IsActive": true, - "Position": 100 + "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 } }, - "SpecificationsUpdateFieldValueRequest": { + "RatesAndBenefitsData": { + "title": "RatesAndBenefitsData", + "description": "Information on promotions and taxes that apply to the order.", "required": [ - "FieldId", - "Name", - "Text", - "IsActive", - "Position" + "id", + "rateAndBenefitsIdentifiers" ], "type": "object", "properties": { - "FieldId": { - "type": "integer", - "nullable": true, - "description": "Specification Field ID." - }, - "Name": { - "type": "string", - "description": "Specification Field Value Name." - }, - "Text": { + "id": { "type": "string", - "nullable": true, - "description": "Specification Field Value Description." + "description": "ID of the rate or benefit." }, - "IsActive": { - "type": "boolean", - "description": "Defines if the Specification Field Value is active (`true`) or inactive (`false`)." - }, - "Position": { - "type": "integer", - "format": "int32", - "description": "Specification Field Position." + "rateAndBenefitsIdentifiers": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Information about order's promotions and taxes identifiers." } }, "example": { - "FieldId": 1, - "FieldValueId": 143, - "Name": "Cotton", - "Text": "Cotton fibers", - "IsActive": true, - "Position": 100 + "id": "ratesAndBenefitsData", + "rateAndBenefitsIdentifiers": [] } }, - "SpecificationsGroup": { + "ShippingData": { + "title": "ShippingData", + "description": "Object containing shipping data.", "required": [ - "CategoryId", - "Id", - "Name", - "Position" + "id", + "address", + "logisticsInfo", + "trackingHints", + "selectedAddresses" ], "type": "object", "properties": { - "CategoryId": { - "type": "integer", - "nullable": true, - "description": "Category ID." + "id": { + "type": "string", + "description": "Object ID, the expected value is `shippingData`." }, - "Id": { - "type": "integer", - "format": "int32", - "description": "Specification Group ID." + "address": { + "$ref": "#/components/schemas/Address" }, - "Name": { + "logisticsInfo": { + "type": "array", + "items": { + "$ref": "#/components/schemas/LogisticsInfo" + }, + "description": "Array of objects containing item's logistics information." + }, + "trackingHints": { "type": "string", - "description": "Specification Group Name." + "nullable": true }, - "Position": { - "type": "integer", - "format": "int32", - "nullable": true, - "description": "Specification Group Position." + "selectedAddresses": { + "type": "array", + "items": { + "$ref": "#/components/schemas/SelectedAddress" + }, + "description": "Information about selected adresses." } }, "example": { - "CategoryId": 1, - "Id": 4, - "Name": "Sizes", - "Position": 1 + "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": [] + } + ] } }, - "SpecificationGroupInsertRequest": { + "Address": { + "title": "Address", + "description": "Shipping address details.", "required": [ - "CategoryId", - "Name" + "addressType", + "receiverName", + "addressId", + "versionId", + "entityId", + "postalCode", + "city", + "state", + "country", + "street", + "number", + "neighborhood", + "complement", + "reference", + "geoCoordinates" ], "type": "object", "properties": { - "CategoryId": { - "type": "integer", - "format": "int32", - "description": "Category ID." + "addressType": { + "type": "string", + "description": "Type of address. For example, `Residential` or `Pickup`, among others." }, - "Name": { + "receiverName": { "type": "string", - "description": "Specification Group Name." + "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": { - "CategoryId": 1, - "Name": "GroupName1" + "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": [] } }, - "SkuComplement": { + "LogisticsInfo": { + "title": "LogisticsInfo", "required": [ - "Id", - "SkuId", - "ParentSkuId", - "ComplementTypeId" + "itemIndex", + "selectedSla", + "lockTTL", + "price", + "listPrice", + "sellingPrice", + "deliveryWindow", + "deliveryCompany", + "shippingEstimate", + "shippingEstimateDate", + "slas", + "shipsTo", + "deliveryIds", + "deliveryChannels", + "deliveryChannel", + "pickupStoreInfo", + "addressId", + "versionId", + "entityId", + "polygonName", + "pickupPointId", + "transitTime" ], - "type": "array", - "items": { - "type": "object", - "properties": { - "Id": { - "type": "integer", - "description": "SKU Complement’s unique numerical identifier." - }, - "SkuId": { - "type": "integer", - "description": "ID of the SKU which will be inserted as a Complement in the Parent SKU." - }, - "ParentSkuId": { - "type": "integer", - "description": "ID of the Parent SKU, where the Complement will be inserted." - }, - "ComplementTypeId": { - "type": "integer", - "description": "Complement Type ID. This represents the type of the complement. The possible values are: `1` for Accessory; `2` for Suggestion; `3` for Similar Product; `5` for Show Together." - } - } - }, - "example": [ - { - "Id": 61, - "SkuId": 7, - "ParentSkuId": 1, - "ComplementTypeId": 1 - } - ] - }, - "SkuKit": { "type": "object", "properties": { - "Id": { + "itemIndex": { "type": "integer", - "description": "SKU Kit ID, same as `StockKeepingUnitParent`." + "description": "Index of the item starting from 0." }, - "StockKeepingUnitParent": { - "type": "integer", - "description": "Parent SKU ID." + "selectedSla": { + "type": "string", + "description": "Selected shipping option." }, - "StockKeepingUnitId": { + "lockTTL": { + "type": "string", + "description": "Logistics [reservation](https://help.vtex.com/en/tutorial/how-does-reservation-work--tutorials_92) waiting time." + }, + "price": { "type": "integer", - "description": "SKU ID of the kit component." + "description": "Shipping price for the item in cents. Does not account for the whole order's shipping price." }, - "Quantity": { + "listPrice": { "type": "integer", - "description": "Component quantity." + "description": "SKU's optional price for a specific trade policy." }, - "UnitPrice": { + "sellingPrice": { "type": "integer", - "description": "Component price per unit." + "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": { - "Id": 7, - "StockKeepingUnitParent": 7, - "StockKeepingUnitId": 1, - "Quantity": 1, - "UnitPrice": 50.0000 + "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" } }, - "SKUSpecificationResponse": { + "Sla": { + "title": "Sla", + "required": [ + "id", + "name", + "shippingEstimate", + "deliveryWindow", + "price", + "deliveryChannel", + "pickupStoreInfo", + "polygonName", + "lockTTL", + "pickupPointId", + "transitTime", + "pickupDistance" + ], "type": "object", "properties": { - "Id": { - "type": "integer", - "description": "ID of the association of the specification and the SKU. This ID is used to update or delete the specification." + "id": { + "type": "string", + "description": "ID of the shipping method used in the [shipping policy](https://help.vtex.com/en/tutorial/shipping-policy--tutorials_140)." }, - "SkuId": { - "type": "integer", - "description": "SKU ID." + "name": { + "type": "string", + "description": "Name of the shipping policy." }, - "FieldId": { - "type": "integer", - "description": "Specification field ID." + "shippingEstimate": { + "type": "string", + "description": "Total shipping estimate time in days. For instance, three business days is represented `3bd`." }, - "FieldValueId": { + "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": "Specification Value ID. Required only for `FieldTypeId` as `5`, `6` and `7`." + "description": "Shipping price for the item in cents. Does not account for the whole order's shipping price." }, - "Text": { + "deliveryChannel": { "type": "string", - "description": "Value of specification. Only for `FieldTypeId` different from `5`, `6` and `7`." + "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": 1505, - "SkuId": 1234568387, - "FieldId": 193, - "FieldValueId": 360, - "Text": "Size 10" + "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 } }, - "SKUService": { + "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": { - "Id": { - "type": "integer", - "description": "SKU Service ID.", - "example": 1 - }, - "SkuServiceTypeId": { - "type": "integer", - "description": "SKU Service Type ID.", - "example": 1 - }, - "SkuServiceValueId": { - "type": "integer", - "description": "SKU Service Value ID.", - "example": 1 + "additionalInfo": { + "type": "string", + "nullable": true, + "description": "Additional information about the pickup point." }, - "SkuId": { - "type": "integer", - "description": "SKU ID.", - "example": 1 + "address": { + "type": "string", + "nullable": true, + "description": "Pickup point's address." }, - "Name": { + "dockId": { "type": "string", - "description": "SKU Service Name. Maximum of 50 characters.", - "example": "Engraving" + "nullable": true, + "description": "ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj) related to the delivery or the pickup point." }, - "Text": { + "friendlyName": { "type": "string", - "description": "Internal description of the SKU Service. Maximum of 100 characters.", - "example": "Name engraving additional service." + "nullable": true, + "description": "Name of the pickup point displayed at checkout." }, - "IsActive": { + "isPickupStore": { "type": "boolean", - "description": "Defines if the SKU Service is active or not.", - "example": true + "description": "If this field is set `true`, it means the type of shipping is pickup, and if set as `false`, it is not." } }, "example": { - "Id": 1, - "SkuServiceTypeId": 1, - "SkuServiceValueId": 1, - "SkuId": 1, - "Name": "name", - "Text": "text", - "IsActive": false + "additionalInfo": null, + "address": null, + "dockId": null, + "friendlyName": null, + "isPickupStore": false } }, - "SKUServiceTypeRequest": { - "type": "object", + "DeliveryId": { + "title": "DeliveryId", + "description": "Information about delivery IDs.", "required": [ - "Name", - "IsActive", - "ShowOnProductFront", - "ShowOnCartFront", - "ShowOnAttachmentFront", - "ShowOnFileUpload", - "IsGiftCard", - "IsRequired" + "courierId", + "courierName", + "dockId", + "quantity", + "warehouseId", + "accountCarrierName", + "kitItemDetails" ], + "type": "object", "properties": { - "Name": { + "courierId": { "type": "string", - "description": "SKU Service Type Name. Maximum of 100 characters.", - "default": "Test API Sku Services" - }, - "IsActive": { - "type": "boolean", - "description": "Defines if the SKU Service Type is active or not.", - "default": true + "description": "[Carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)'s ID." }, - "ShowOnProductFront": { - "type": "boolean", - "description": "Deprecated", - "example": false, - "deprecated": true + "courierName": { + "type": "string", + "description": "Carrier's name." }, - "ShowOnCartFront": { - "type": "boolean", - "description": "Defines if the SKU Service Type is displayed on the cart screen.", - "example": false + "dockId": { + "type": "string", + "description": "ID of the [loading dock](https://help.vtex.com/pt/tutorial/doca--5DY8xHEjOLYDVL41Urd5qj)." }, - "ShowOnAttachmentFront": { - "type": "boolean", - "description": "Defines if the SKU Service Type has an attachment.", - "example": false + "quantity": { + "type": "integer", + "description": "Quantity of items." }, - "ShowOnFileUpload": { - "type": "boolean", - "description": "Defines if the SKU Service Type can be associated with an attachment or not.", - "example": false + "warehouseId": { + "type": "string", + "description": "ID of the [warehouse](https://help.vtex.com/tutorial/warehouse--6oIxvsVDTtGpO7y6zwhGpb)." }, - "IsGiftCard": { - "type": "boolean", - "description": "Defines if the SKU Service Type is displayed as a Gift Card.", - "example": false + "accountCarrierName": { + "type": "string", + "description": "Name of the account's [carrier](https://help.vtex.com/en/tutorial/transportadoras-na-vtex--7u9duMD5UQa2QQwukAWMcE)." }, - "IsRequired": { - "type": "boolean", - "description": "Defines if the SKU Service type is mandatory.", - "example": false + "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": [] } }, - "SKUServiceTypeResponse": { + "SelectedAddress": { + "title": "SelectedAddress", + "required": [ + "addressId", + "versionId", + "entityId", + "addressType", + "receiverName", + "street", + "number", + "complement", + "neighborhood", + "postalCode", + "city", + "state", + "country", + "reference", + "geoCoordinates" + ], "type": "object", "properties": { - "Id": { - "type": "integer", - "description": "SKU Service Type ID.", - "example": 2 + "addressId": { + "type": "string", + "description": "Selected address ID." }, - "Name": { + "versionId": { "type": "string", - "description": "SKU Service Type Name. Maximum of 100 characters.", - "example": "Test API Sku Services" + "description": "Shipping address version ID of the selected address.", + "nullable": true }, - "IsActive": { - "type": "boolean", - "description": "Defines if the SKU Service Type is active or not.", - "example": true + "entityId": { + "type": "string", + "description": "Shipping address entity ID of the selected address.", + "nullable": true }, - "ShowOnProductFront": { - "type": "boolean", - "description": "Deprecated.", - "example": false, - "deprecated": true + "addressType": { + "type": "string", + "description": "Selected adress's shipping type, which can be `pickup`, `residential`, `invoice`, `search`, `inStore`, `commercial` or `giftRegistry`." }, - "ShowOnCartFront": { - "type": "boolean", - "description": "Defines if the SKU Service Type is displayed on the cart screen.", - "example": false + "receiverName": { + "type": "string", + "description": "Name of the person who is going to receive the order in the selected address." }, - "ShowOnAttachmentFront": { - "type": "boolean", - "description": "Defines if the SKU Service Type has an attachment.", - "default": false + "street": { + "type": "string", + "description": "Street of the selected address." }, - "ShowOnFileUpload": { - "type": "boolean", - "description": "Defines if the SKU Service Type can be associated with an attachment or not.", - "default": false + "number": { + "type": "string", + "description": "Number of the building, house or apartment of the selected address." }, - "IsGiftCard": { - "type": "boolean", - "description": "Defines if the SKU Service Type is displayed as a Gift Card.", - "default": false + "complement": { + "type": "string", + "description": "Complement to the selected address if it applies." }, - "IsRequired": { - "type": "boolean", - "description": "Defines if the SKU Service type is mandatory.", - "default": false - } - }, - "example": { - "Id": 2, - "Name": "Test API SKU Services", - "IsActive": true, - "ShowOnProductFront": true, - "ShowOnCartFront": true, - "ShowOnAttachmentFront": true, - "ShowOnFileUpload": true, - "IsGiftCard": true, - "IsRequired": true + "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": [] } }, - "SKUServiceValueRequest": { - "type": "object", + "PaymentData": { + "title": "PaymentData", + "description": "Object with information about the payment.", "required": [ - "SkuServiceTypeId", - "Name", - "Value", - "Cost" + "transactions" ], + "type": "object", "properties": { - "SkuServiceTypeId": { - "type": "integer", - "description": "SKU Service Type ID.", - "example": 2 - }, - "Name": { - "type": "string", - "description": "SKU Service Value name. Maximum of 100 characters.", - "example": "Test ServiceValue API" - }, - "Value": { - "type": "number", - "description": "SKU Service Value value.", - "example": 10.5 + "giftCards": { + "type": "array", + "description": "Array with information about Gift Cards.", + "items": { + "type": "string" + } }, - "Cost": { - "type": "number", - "description": "SKU Service Value cost.", - "example": 10.5 + "transactions": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Transaction" + }, + "description": "Information about financial transactions." } }, "example": { - "SkuServiceTypeId": 2, - "Name": "Test ServiceValue API", - "Value": 10.5, - "Cost": 10.5 + "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": { + } + } + ] + } + ] } }, - "SKUServiceValueResponse": { - "type": "object", + "Transaction": { + "title": "Transaction", + "description": "Financial transaction details.", "required": [ - "SkuServiceTypeId", - "Name", - "Value", - "Cost" + "isActive", + "transactionId", + "merchantName", + "payments" ], + "type": "object", "properties": { - "Id": { - "type": "integer", - "description": "SKU Service Value ID.", - "example": 2 - }, - "SkuServiceTypeId": { - "type": "integer", - "description": "SKU Service Type ID.", - "example": 2 + "isActive": { + "type": "boolean", + "description": "When this field is set as `true`, the payment is active, and when it is `false`, the payment is inactive." }, - "Name": { + "transactionId": { "type": "string", - "description": "SKU Service Value name. Maximum of 100 characters.", - "example": "Test ServiceValue API" + "description": "ID of the transaction." }, - "Value": { - "type": "number", - "description": "SKU Service Value value.", - "example": 10.5 + "merchantName": { + "type": "string", + "description": "Name of the merchant that will receive the payment." }, - "Cost": { - "type": "number", - "description": "SKU Service Value cost.", - "example": 10.5 + "payments": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Payment" + }, + "description": "Detailed information about payment." } }, "example": { - "Id": 2, - "SkuServiceTypeId": 2, - "Name": "Test ServiceValue API", - "Value": 10.5, - "Cost": 10.5 + "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": { + } + } + ] } }, - "BrandCreateUpdate": { - "type": "object", - "description": "Object containing Brand information.", + "Payment": { + "title": "Payment", + "description": "Payment details.", "required": [ - "Id", - "Name" + "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": { + "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": "Brand's unique numerical identifier.", - "example": 2000003 + "description": "Payment's final amount in cents." }, - "Name": { + "installments": { + "type": "integer", + "description": "Number of payment installments." + }, + "referenceValue": { + "type": "integer", + "description": "Payment's reference value in cents." + }, + "cardHolder": { "type": "string", - "description": "Brand name.", - "example": "Adidas" + "nullable": true, + "description": "Name of the person who owns the card." }, - "Text": { + "cardNumber": { "type": "string", - "description": "Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description.", - "example": "Adidas" + "nullable": true, + "description": "Numeric sequence of the card used in the transaction." }, - "Keywords": { + "firstDigits": { "type": "string", - "description": "Store Framework - Deprecated.\r\nLegacy 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.\r\n", - "example": "adidas" + "nullable": true, + "description": "Fist digits of the card used in the transaction." }, - "SiteTitle": { + "lastDigits": { "type": "string", - "description": "Meta Title for the Brand page.", - "example": "Adidas" + "nullable": true, + "description": "Last digits of the card used in the transaction." }, - "AdWordsRemarketingCode": { + "cvv2": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "nullable": true, + "description": "Card Verification Value (CVV2) is a security code used by payment processors to reduce fraudulent credit and debit card transactions." }, - "LomadeeCampaignCode": { + "expireMonth": { "type": "string", - "description": "This is a legacy field. Do not take this information into consideration.", - "deprecated": true + "nullable": true, + "description": "Expire month of the card used in the transaction (2-digits)." }, - "Score": { - "type": "integer", - "description": "Store Framework - Deprecated\r\nLegacy CMS Portal - Value used to set the priority on the search result page.\r\n", - "example": 10, - "nullable": true + "expireYear": { + "type": "string", + "nullable": true, + "description": "Expire year of the card used in the transaction (4-digits)." }, - "MenuHome": { - "type": "boolean", - "description": "Store Framework - Deprecated.\r\nLegacy CMS Portal - Defines if the Brand appears in the Department Menu control (``).\r\n", - "example": true + "url": { + "type": "string", + "description": "Payment's URL." }, - "Active": { + "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": "Defines if the brand is active (`true`) or not (`false`).", - "example": true + "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." }, - "LinkId": { + "koinUrl": { "type": "string", - "description": "Brand page slug. Only lowercase letters and hyphens (`-`) are allowed.", - "example": "adidas-sports", - "nullable": true + "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": 2000013, - "Name": "Orma Carbono2", - "Text": "Orma Carbon2", - "Keywords": "orma", - "SiteTitle": "Orma Carbon2", - "Active": true, - "MenuHome": true, - "AdWordsRemarketingCode": "", - "LomadeeCampaignCode": "", - "Score": null, - "LinkId": null + "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": { + } } }, - "BrandGet": { + "PackageAttachment": { + "title": "PackageAttachment", + "description": "Package object populated after order invoiced.", + "required": [ + "packages" + ], "type": "object", - "description": "Object containing Brand information.", + "properties": { + "packages": { + "type": "array", + "items": { + "type": "string" + }, + "description": "Packages details." + } + }, + "example": { + "packages": [] + } + }, + "Seller": { + "title": "Seller", + "description": "Information about the seller associated with the order.", "required": [ "id", "name", - "isActive", - "imageUrl", - "title", - "metaTagDescription" + "logo", + "fulfillmentEndpoint" ], + "type": "object", "properties": { "id": { - "type": "integer", - "description": "Brand's unique numerical identifier." - }, - "name": { "type": "string", - "description": "Brand name." - }, - "isActive": { - "type": "boolean", - "description": "Defines if the brand is active (`true`) or not (`false`)." + "description": "Seller ID that identifies the seller." }, - "title": { + "name": { "type": "string", - "description": "Meta Title for the Brand page." + "description": "Seller's name." }, - "metaTagDescription": { + "logo": { "type": "string", - "description": "Meta Description for the Brand page. A brief description of the brand, displayed by search engines. Since search engines can only display less than 150 characters, we recommend not exceeding this character limit when creating the description." + "description": "URL of the seller's logo." }, - "imageUrl": { + "fulfillmentEndpoint": { "type": "string", - "description": "URL of the brand's image.", - "nullable": true + "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" } }, - "AttachmentResponse": { - "type": "object", + "ChangesAttachment": { + "title": "ChangesAttachment", + "description": "Information about changes in the order.", "required": [ - "Id", - "Name", - "IsRequired", - "IsActive", - "Domains" + "id", + "changesData" ], + "type": "object", "properties": { - "Id": { - "type": "integer", - "description": "Attachment ID.", - "example": 8 - }, - "Name": { + "id": { "type": "string", - "description": "Attachment Name.", - "example": "Shirt customization" - }, - "IsRequired": { - "type": "boolean", - "description": "Defines if the attachment is required or not.", - "example": false - }, - "IsActive": { - "type": "boolean", - "description": "Defines if the attachment is active or not.", - "example": false + "description": "Object ID, the expect value is `changeAttachment`." }, - "Domains": { + "changesData": { "type": "array", - "description": "List of characteristics related to the attachment.", "items": { - "type": "object", - "properties": { - "FieldName": { - "type": "string", - "description": "Attachment key name.", - "example": "Number" - }, - "MaxCaracters": { - "type": "string", - "description": "Maximum number of characters in the attachment key.", - "example": "1" - }, - "DomainValues": { - "type": "string", - "description": "Allowed key values.", - "example": "7,9,10" - } - } - } + "$ref": "#/components/schemas/ChangesDatum" + }, + "description": "Order change details." } }, "example": { - "Id": 8, - "Name": "Ingredients", - "IsRequired": true, - "IsActive": true, - "Domains": [ - { - "FieldName": "Sauce", - "MaxCaracters": "", - "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - }, + "id": "changeAttachment", + "changesData": [ { - "FieldName": "Toppings", - "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" + "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" + } } ] } }, - "AttachmentRequest": { - "type": "object", + "ChangesDatum": { + "title": "ChangesDatum", "required": [ - "Name", - "IsRequired", - "IsActive", - "Domains" + "reason", + "discountValue", + "incrementValue", + "itemsAdded", + "itemsRemoved", + "receipt" ], + "type": "object", "properties": { - "Name": { + "reason": { "type": "string", - "description": "Attachment Name.", - "example": "Shirt customization" + "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." }, - "IsRequired": { - "type": "boolean", - "description": "Defines if the attachment is required or not.", - "example": false + "discountValue": { + "type": "integer", + "description": "Order change discount value." }, - "IsActive": { - "type": "boolean", - "description": "Defines if the attachment is active or not.", - "example": false + "incrementValue": { + "type": "integer", + "description": "Order change increment value." }, - "Domains": { + "itemsAdded": { "type": "array", - "description": "List of characteristics related to the attachment.", "items": { - "type": "object", - "properties": { - "FieldName": { - "type": "string", - "description": "Attachment key name.", - "example": "Number" - }, - "MaxCaracters": { - "type": "string", - "description": "Maximum number of characters in the attachment key.", - "example": "1" - }, - "DomainValues": { - "type": "string", - "description": "Allowed key values.", - "example": "7,9,10" - } - } - } + "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": { - "Name": "Ingredients", - "IsRequired": true, - "IsActive": true, - "Domains": [ + "reason": "Blah", + "discountValue": 3290, + "incrementValue": 0, + "itemsAdded": [], + "itemsRemoved": [ { - "FieldName": "Sauce", - "MaxCaracters": "", - "DomainValues": "[1-2]#9[1-1][1]basic;#11[0-1][1]basic" - }, - { - "FieldName": "Toppings", - "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": "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" + } } }, - "SupplierRequest": { - "type": "object", + "ItemsRemoved": { + "title": "ItemsRemoved", "required": [ - "Name", - "CorporateName", - "StateInscription", - "Cnpj", - "Phone", - "CellPhone", - "CorportePhone", - "Email", - "IsActive" + "id", + "name", + "quantity", + "price", + "unitMultiplier" ], + "type": "object", "properties": { - "Name": { + "id": { "type": "string", - "description": "Supplier Name.", - "example": "Supplier" + "description": "SKU ID of the item removed from the order." }, - "CorporateName": { + "name": { "type": "string", - "description": "Supplier Corporate Name.", - "example": "TopStore" + "description": "Name of the item removed from the order." }, - "StateInscription": { - "type": "string", - "description": "State Inscription.", - "example": "123456" + "quantity": { + "type": "integer", + "description": "Quantity of items removed from the order." }, - "Cnpj": { - "type": "string", - "description": "Corporate legal ID.", - "example": "33304981001272" + "price": { + "type": "integer", + "description": "Total amount of items removed from the order." }, - "Phone": { + "unitMultiplier": { "type": "string", - "description": "Supplier Phone.", - "example": "3333333333" - }, - "CellPhone": { + "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 modified orders.", + "required": [ + "date", + "orderId", + "receipt" + ], + "type": "object", + "properties": { + "date": { "type": "string", - "description": "Supplier Cellphone.", - "example": "4444444444" + "description": "Date when the receipt was created." }, - "CorportePhone": { + "orderId": { "type": "string", - "description": "Supplier Corporate Phone.", - "example": "5555555555" + "description": "ID of the order." }, - "Email": { + "receipt": { "type": "string", - "description": "Supplier email.", - "example": "email@email.com" - }, - "IsActive": { - "type": "boolean", - "description": "Defines if the Supplier is active (`true`) or not (`false`).", - "example": false + "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" } }, - "SupplierResponse": { + "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": { - "Id": { - "type": "integer", - "description": "Supplier unique identifier code.", - "example": 123 - }, - "Name": { + "countryCode": { "type": "string", - "description": "Supplier Name.", - "example": "Supplier" + "description": "Three letters ISO code of the country (ISO 3166 ALPHA-3)." }, - "CorporateName": { + "currencyCode": { "type": "string", - "description": "Supplier Corporate Name.", - "example": "TopStore" + "description": "Currency code in ISO 4217. For example, `BRL`." }, - "StateInscription": { + "currencyFormatInfo": { + "$ref": "#/components/schemas/CurrencyFormatInfo" + }, + "currencyLocale": { + "type": "integer", + "description": "Currency Locale Code in LCID in decimal." + }, + "currencySymbol": { "type": "string", - "description": "State Inscription.", - "example": "123456" + "description": "Currency symbol." }, - "Cnpj": { + "timeZone": { "type": "string", - "description": "Corporate legal ID.", - "example": "33304981001272" + "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." }, - "Phone": { + "CurrencyDecimalSeparator": { "type": "string", - "description": "Supplier Phone.", - "example": "3333333333" + "description": "Defines what currency decimal separator will be applied." }, - "CellPhone": { + "CurrencyGroupSeparator": { "type": "string", - "description": "Supplier Cellphone.", - "example": "4444444444" + "description": "Defines what currency group separator will be applied." }, - "CorportePhone": { + "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": "Supplier Corporate Phone.", - "example": "5555555555" + "description": "Marketplace base URL." }, - "Email": { + "isCertified": { "type": "string", - "description": "Supplier email.", - "example": "email@email.com" + "nullable": true, + "description": "If is a certified marketplace." }, - "IsActive": { - "type": "boolean", - "description": "Defines if the Supplier is active (`true`) or not (`false`).", - "example": false + "name": { + "type": "string", + "description": "Name of the marketplace." } + }, + "example": { + "baseURL": "http://oms.vtexinternal.com.br/api/oms?an=luxstore", + "isCertified": null, + "name": "luxstore" } } } diff --git a/vtex/utils/orderForm.ts b/vtex/utils/orderForm.ts index 9179a666b..0953250d5 100644 --- a/vtex/utils/orderForm.ts +++ b/vtex/utils/orderForm.ts @@ -1,5 +1,6 @@ import { Cookie, getCookies } from "std/http/mod.ts"; import { stringify } from "./cookies.ts"; +import { MarketingData } from "./types.ts"; const VTEX_CHECKOUT_COOKIE = "checkout.vtex.com"; @@ -52,3 +53,13 @@ export const formatCookie = (orderFormId: string): Cookie => ({ secure: true, sameSite: "Lax", }); + +export const hasDifferentMarketingData = ( + md1: MarketingData, + md2: MarketingData, +) => { + const someDifferent = Object.keys(md1).some((key) => + md1[key as keyof MarketingData] !== md2[key as keyof MarketingData] + ); + return someDifferent; +}; diff --git a/vtex/utils/pickAndOmit.ts b/vtex/utils/pickAndOmit.ts new file mode 100644 index 000000000..b11431737 --- /dev/null +++ b/vtex/utils/pickAndOmit.ts @@ -0,0 +1,30 @@ +export function pick< + T extends object, + K extends keyof T = keyof T, +>( + keys: K[], + obj: T | null | undefined, +): Pick | null { + if (!keys.length || !obj) { + return null; + } + + const entries = keys.map((key) => [key, obj[key]]); + + return Object.fromEntries(entries); +} + +export function omit( + keys: K[], + obj: T | null | undefined, +): Omit | null { + if (!keys.length || !obj) { + return null; + } + + const pickedKeys = (Object.keys(obj) as K[]).filter( + (key) => !keys.includes(key), + ); + + return pick(pickedKeys, obj) as unknown as Omit; +} diff --git a/vtex/utils/resourceRange.ts b/vtex/utils/resourceRange.ts new file mode 100644 index 000000000..c9a0d0746 --- /dev/null +++ b/vtex/utils/resourceRange.ts @@ -0,0 +1,12 @@ +export function resourceRange( + skip: number, + take: number, +) { + const from = Math.max(skip, 0); + const to = from + Math.min(100, take); + + return { + from, + to, + }; +} diff --git a/vtex/utils/segment.ts b/vtex/utils/segment.ts index 409533f6f..8f2960946 100644 --- a/vtex/utils/segment.ts +++ b/vtex/utils/segment.ts @@ -1,31 +1,71 @@ -import { getCookies, setCookie } from "std/http/mod.ts"; +import { setCookie } from "std/http/mod.ts"; import { AppContext } from "../mod.ts"; import type { Segment } from "./types.ts"; +import { removeNonLatin1Chars } from "../../utils/normalize.ts"; const SEGMENT_COOKIE_NAME = "vtex_segment"; +const SALES_CHANNEL_COOKIE = "VTEXSC"; const SEGMENT = Symbol("segment"); -export const isAnonymous = ({ - campaigns, - utm_campaign, - utm_source, - utmi_campaign, - channel, - priceTables, - regionId, -}: Partial) => - !campaigns && - !utm_campaign && - !utm_source && - !utmi_campaign && - !channel && - !priceTables && - !regionId; - -export const getSegmentFromBag = (ctx: AppContext): Partial => - ctx.bag?.get(SEGMENT); -export const setSegmentInBag = (ctx: AppContext, segment: Partial) => - ctx.bag?.set(SEGMENT, segment); +export interface WrappedSegment { + payload: Partial; + token: string; +} + +/** + * by default segment starts with null values + */ +const DEFAULT_SEGMENT: Partial = { + utmi_campaign: null, + utmi_page: null, + utmi_part: null, + utm_campaign: null, + utm_source: null, + utm_medium: null, + channel: "1", + cultureInfo: "pt-BR", + currencyCode: "BRL", + currencySymbol: "R$", + countryCode: "BRA", +}; + +const isDefautSalesChannel = (ctx: AppContext, channel?: string) => { + return channel === + (ctx.salesChannel || DEFAULT_SEGMENT.channel || + ctx.defaultSegment?.channel); +}; + +export const isAnonymous = ( + ctx: AppContext, +) => { + const payload = getSegmentFromBag(ctx)?.payload; + if (!payload) { + return true; + } + const { + campaigns, + utm_campaign, + utm_source, + utmi_campaign, + channel, + priceTables, + regionId, + } = payload; + return !campaigns && + !utm_campaign && + !utm_source && + !utmi_campaign && + (!channel || isDefautSalesChannel(ctx, channel)) && + !priceTables && + !regionId; +}; + +const setSegmentInBag = (ctx: AppContext, data: WrappedSegment) => + ctx?.bag?.set(SEGMENT, data); + +export const getSegmentFromBag = ( + ctx: AppContext, +): WrappedSegment => ctx?.bag?.get(SEGMENT); /** * Stable serialization. @@ -33,54 +73,58 @@ export const setSegmentInBag = (ctx: AppContext, segment: Partial) => * This means that even if the attributes are in a different order, the final segment * value will be the same. This improves cache hits */ -export const serialize = ({ +const serialize = ({ campaigns, channel, priceTables, regionId, utm_campaign, utm_source, + utm_medium, utmi_campaign, + utmi_page, + utmi_part, currencyCode, currencySymbol, countryCode, cultureInfo, channelPrivacy, -}: Partial) => - btoa(JSON.stringify({ +}: Partial) => { + const seg = { campaigns, channel, priceTables, regionId, - utm_campaign, - utm_source, - utmi_campaign, + utm_campaign: utm_campaign && + removeNonLatin1Chars(utm_campaign).replace(/[\/\[\]{}()<>.]/g, ""), + utm_source: utm_source && + removeNonLatin1Chars(utm_source).replace(/[\/\[\]{}()<>.]/g, ""), + utm_medium: utm_medium && + removeNonLatin1Chars(utm_medium).replace(/[\/\[\]{}()<>.]/g, ""), + utmi_campaign: utmi_campaign && removeNonLatin1Chars(utmi_campaign), + utmi_page: utmi_page && removeNonLatin1Chars(utmi_page), + utmi_part: utmi_part && removeNonLatin1Chars(utmi_part), currencyCode, currencySymbol, countryCode, cultureInfo, channelPrivacy, - })); - -export const parse = (cookie: string) => JSON.parse(atob(cookie)); - -export const getSegmentFromCookie = ( - req: Request, -): Partial | undefined => { - const cookies = getCookies(req.headers); - const cookie = cookies[SEGMENT_COOKIE_NAME]; - const segment = cookie && parse(cookie); - - return segment; + }; + return btoa(JSON.stringify(seg)); }; +const parse = (cookie: string) => JSON.parse(atob(cookie)); + const SEGMENT_QUERY_PARAMS = [ "utmi_campaign" as const, + "utmi_page" as const, + "utmi_part" as const, "utm_campaign" as const, "utm_source" as const, + "utm_medium" as const, ]; -export const buildSegmentCookie = (req: Request): Partial => { +export const buildSegmentFromRequest = (req: Request): Partial => { const url = new URL(req.url); const partialSegment: Partial = {}; for (const qs of SEGMENT_QUERY_PARAMS) { @@ -90,31 +134,77 @@ export const buildSegmentCookie = (req: Request): Partial => { } } - return partialSegment; -}; + const sc = url.searchParams.get("sc"); + if (sc) { + partialSegment.channel = sc; + } -export const setSegmentCookie = ( - segment: Partial, - headers: Headers = new Headers(), -): Headers => { - setCookie(headers, { - value: serialize(segment), - name: SEGMENT_COOKIE_NAME, - path: "/", - secure: true, - httpOnly: true, - }); - - return headers; + return partialSegment; }; export const withSegmentCookie = ( - segment: Partial, + segment: WrappedSegment, headers?: Headers, ) => { const h = new Headers(headers); + if (!segment) { + return h; + } - h.set("cookie", `${SEGMENT_COOKIE_NAME}=${serialize(segment)}`); + const { token } = segment; + + h.set("cookie", `${SEGMENT_COOKIE_NAME}=${token}`); return h; }; + +export const setSegmentBag = ( + cookies: Record, + req: Request, + ctx: AppContext, +) => { + const vtex_segment = cookies[SEGMENT_COOKIE_NAME]; + const segmentFromCookie = vtex_segment && parse(vtex_segment); + const segmentFromSalesChannelCookie = cookies[SALES_CHANNEL_COOKIE] + ? { + channel: cookies[SALES_CHANNEL_COOKIE]?.split("=")[1], + } + : {}; + const segmentFromRequest = buildSegmentFromRequest(req); + + const segment = { + channel: ctx.salesChannel, + ...DEFAULT_SEGMENT, + ...ctx.defaultSegment, + ...segmentFromCookie, + ...segmentFromSalesChannelCookie, + ...segmentFromRequest, + }; + const token = serialize(segment); + setSegmentInBag(ctx, { payload: segment, token }); + + // If the user came from a sales channel in the URL, we set the cookie + if (segmentFromRequest.channel) { + setCookie(ctx.response.headers, { + value: `sc=${segmentFromRequest.channel}`, + name: SALES_CHANNEL_COOKIE, + path: "/", + secure: true, + }); + } + + 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, + }); + } +}; diff --git a/vtex/utils/simulationBehavior.ts b/vtex/utils/simulationBehavior.ts new file mode 100644 index 000000000..5ffce3b8d --- /dev/null +++ b/vtex/utils/simulationBehavior.ts @@ -0,0 +1,37 @@ +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 || {}; + if (!__resolveType) { + return false; + } + const skipSimulationBehavior = await ctx.invoke( + // @ts-ignore ignore + __resolveType, + props, + ) as Matcher; + return skipSimulationBehavior({ + request: req, + siteId: 0, + device: ctx.device, + }); +} diff --git a/vtex/utils/transform.ts b/vtex/utils/transform.ts index b9bfd81c8..0829eef54 100644 --- a/vtex/utils/transform.ts +++ b/vtex/utils/transform.ts @@ -1,9 +1,15 @@ import type { AggregateOffer, + Brand, BreadcrumbList, + DayOfWeek, Filter, FilterToggleValue, Offer, + OpeningHoursSpecification, + PageType, + Place, + PostalAddress, Product, ProductDetailsPage, ProductGroup, @@ -13,8 +19,12 @@ import type { } from "../../commerce/types.ts"; import { DEFAULT_IMAGE } from "../../commerce/utils/constants.ts"; import { formatRange } from "../../commerce/utils/filters.ts"; +import type { PickupPoint as PickupPointVCS } from "./openapi/vcs.openapi.gen.ts"; +import { pick } from "./pickAndOmit.ts"; import { slugify } from "./slugify.ts"; import type { + Address, + Brand as BrandVTEX, Category, Facet as FacetVTEX, FacetValueBoolean, @@ -22,16 +32,27 @@ import type { Item as SkuVTEX, LegacyFacet, LegacyItem as LegacySkuVTEX, + LegacyProduct, LegacyProduct as LegacyProductVTEX, + Maybe, + OrderForm, + PageType as PageTypeVTEX, + PickupHolidays, + PickupPoint, Product as ProductVTEX, + ProductInventoryData, + ProductRating, + ProductReviewData, SelectedFacet, Seller as SellerVTEX, + Teasers, } from "./types.ts"; const DEFAULT_CATEGORY_SEPARATOR = ">"; const isLegacySku = (sku: LegacySkuVTEX | SkuVTEX): sku is LegacySkuVTEX => - typeof (sku as LegacySkuVTEX).variations?.[0] === "string"; + typeof (sku as LegacySkuVTEX).variations?.[0] === "string" || + !!(sku as LegacySkuVTEX).Videos; const isLegacyProduct = ( product: ProductVTEX | LegacyProductVTEX, @@ -56,14 +77,17 @@ const getProductURL = ( return canonicalUrl; }; -const nonEmptyArray = (array: T[] | null | undefined) => - Array.isArray(array) && array.length > 0 ? array : null; +const nonEmptyArray = ( + array: T[] | null | undefined, +) => (Array.isArray(array) && array.length > 0 ? array : null); interface ProductOptions { baseUrl: string; /** Price coded currency, e.g.: USD, BRL */ priceCurrency: string; imagesByKey?: Map; + /** Original attributes to be included in the transformed product */ + includeOriginalAttributes?: string[]; } /** Returns first available sku */ @@ -78,17 +102,15 @@ export const pickSku = ( product: T, maybeSkuId?: string, ): T["items"][number] => { - const skuId = maybeSkuId ?? - findFirstAvailable(product.items)?.itemId ?? + const skuId = maybeSkuId ?? findFirstAvailable(product.items)?.itemId ?? product.items[0]?.itemId; - for (const item of product.items) { if (item.itemId === skuId) { return item; } } - throw new Error(`Missing sku ${skuId} on product ${product.productName}`); + return product.items[0]; }; const toAccessoryOrSparePartFor = ( @@ -102,19 +124,29 @@ const toAccessoryOrSparePartFor = ( return map; }, new Map()); - return sku.kitItems?.map(({ itemId }) => { - const product = productBySkuId.get(itemId); + return sku.kitItems + ?.map(({ itemId }) => { + const product = productBySkuId.get(itemId); - if (!product) { - throw new Error( - `Expected product for skuId ${itemId} but it was not returned by the search engine`, - ); - } + /** Sometimes VTEX does not return what I've asked for */ + if (!product) return; - const sku = pickSku(product, itemId); + const sku = pickSku(product, itemId); + + return toProduct(product, sku, 0, options); + }) + .filter((p): p is Product => typeof p !== "undefined"); +}; - return toProduct(product, sku, 0, options); +export const forceHttpsOnAssets = (orderForm: OrderForm) => { + orderForm.items.forEach((item) => { + if (item.imageUrl) { + item.imageUrl = item.imageUrl.startsWith("http://") + ? item.imageUrl.replace("http://", "https://") + : item.imageUrl; + } }); + return orderForm; }; export const toProductPage = ( @@ -124,7 +156,7 @@ export const toProductPage = ( options: ProductOptions, ): Omit => { const partialProduct = toProduct(product, sku, 0, options); - // Get accessories in ProductPage only. I don't see where it's necessary outside this page for now + // This is deprecated. Compose this loader at loaders > product > extension > detailsPage.ts const isAccessoryOrSparePartFor = toAccessoryOrSparePartFor( sku, kitItems, @@ -168,12 +200,25 @@ const toAdditionalPropertyCategories = < >( product: P, ): Product["additionalProperty"] => { - const categories = splitCategory(product.categories[0]); - const categoryIds = splitCategory(product.categoriesIds[0]); + const categories = new Set(); + const categoryIds = new Set(); + + product.categories.forEach((productCategory, i) => { + const category = splitCategory(productCategory); + const categoryId = splitCategory(product.categoriesIds[i]); + + category.forEach((splitCategoryItem, j) => { + categories.add(splitCategoryItem); + categoryIds.add(categoryId[j]); + }); + }); - return categories.map((category, index) => + const categoriesArray = Array.from(categories); + const categoryIdsArray = Array.from(categoryIds); + + return categoriesArray.map((category, index) => toAdditionalPropertyCategory({ - propertyID: categoryIds[index], + propertyID: categoryIdsArray[index], value: category || "", }) ); @@ -211,10 +256,10 @@ const toAdditionalPropertyClusters = < : new Set(product.clusterHighlights.map(({ id }) => id)); return allClusters.map((cluster) => - toAdditionalPropertyCluster( - { propertyID: cluster.id, value: cluster.name || "" }, - highlightsSet, - ) + toAdditionalPropertyCluster({ + propertyID: cluster.id, + value: cluster.name || "", + }, highlightsSet) ); }; @@ -303,18 +348,33 @@ export const toProduct =

( releaseDate, items, } = product; - const { name, ean, itemId: skuId, referenceId = [], kitItems } = sku; + const { + name, + ean, + itemId: skuId, + referenceId = [], + kitItems, + estimatedDateArrival, + } = sku; + + const videos = isLegacySku(sku) ? sku.Videos : sku.videos; + const nonEmptyVideos = nonEmptyArray(videos); const imagesByKey = options.imagesByKey ?? items .flatMap((i) => i.images) .reduce((map, img) => { - map.set(getImageKey(img.imageUrl), img.imageUrl); + img?.imageUrl && map.set(getImageKey(img.imageUrl), img.imageUrl); return map; }, new Map()); const groupAdditionalProperty = isLegacyProduct(product) ? legacyToProductGroupAdditionalProperties(product) : toProductGroupAdditionalProperties(product); + const originalAttributesAdditionalProperties = + toOriginalAttributesAdditionalProperties( + options.includeOriginalAttributes, + product, + ); const specificationsAdditionalProperty = isLegacySku(sku) ? toAdditionalPropertiesLegacy(sku) : toAdditionalProperties(sku); @@ -335,11 +395,43 @@ export const toProduct =

( ), url: getProductGroupURL(baseUrl, product).href, name: product.productName, - additionalProperty: groupAdditionalProperty, + additionalProperty: [ + ...groupAdditionalProperty, + ...originalAttributesAdditionalProperties, + ], model: productReference, } satisfies ProductGroup) : undefined; + const finalImages = images?.map(({ imageUrl, imageText, imageLabel }) => { + const url = imagesByKey.get(getImageKey(imageUrl)) ?? imageUrl; + const alternateName = imageText || imageLabel || ""; + const name = imageLabel || ""; + const encodingFormat = "image"; + + return { + "@type": "ImageObject" as const, + alternateName, + url, + name, + encodingFormat, + }; + }) ?? [DEFAULT_IMAGE]; + + const finalVideos = nonEmptyVideos?.map((video) => { + const url = video; + const alternateName = "Product video"; + const name = "Product video"; + const encodingFormat = "video"; + return { + "@type": "VideoObject" as const, + alternateName, + contentUrl: url, + name, + encodingFormat, + }; + }); + // From schema.org: A category for the item. Greater signs or slashes can be used to informally indicate a category hierarchy const categoriesString = splitCategory(product.categories[0]).join( DEFAULT_CATEGORY_SEPARATOR, @@ -353,12 +445,33 @@ export const toProduct =

( .concat(clusterAdditionalProperties ?? []) .concat(referenceIdAdditionalProperty ?? []); + const otherProps: { [key: string]: AdverTisement } = {}; + + if (product.advertisement) { + otherProps.advertisement = product.advertisement; + } + + estimatedDateArrival && additionalProperty.push({ + "@type": "PropertyValue", + name: "Estimated Date Arrival", + value: estimatedDateArrival, + }); + + if (sku.modalType) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "Modal Type", + value: sku.modalType, + }); + } + return { "@type": "Product", category: categoriesString, productID: skuId, url: getProductURL(baseUrl, product, sku.itemId).href, name, + alternateName: sku.complementName, description, brand: { "@type": "Brand", @@ -377,14 +490,10 @@ export const toProduct =

( releaseDate, additionalProperty, isVariantOf, - image: images?.map(({ imageUrl, imageText, imageLabel }) => { - const url = imagesByKey.get(getImageKey(imageUrl)) ?? imageUrl; - const alternateName = imageText || imageLabel || ""; - const name = imageLabel || ""; - - return { "@type": "ImageObject" as const, alternateName, url, name }; - }) ?? [DEFAULT_IMAGE], + image: finalImages, + video: finalVideos, offers: aggregateOffers(offers, priceCurrency), + ...otherProps, }; }; @@ -394,6 +503,7 @@ const toBreadcrumbList = ( ): BreadcrumbList => { const { categories, productName } = product; const names = categories[0]?.split("/").filter(Boolean); + const segments = names.map(slugify); return { @@ -405,8 +515,8 @@ const toBreadcrumbList = ( return { "@type": "ListItem" as const, name, - item: new URL(`/${segments.slice(0, position).join("/")}`, baseUrl) - .href, + item: + new URL(`/${segments.slice(0, position).join("/")}`, baseUrl).href, position, }; }), @@ -421,27 +531,72 @@ const toBreadcrumbList = ( }; }; -const legacyToProductGroupAdditionalProperties = (product: LegacyProductVTEX) => - product.allSpecifications?.flatMap((name) => { - const values = (product as unknown as Record)[name]; +const legacyToProductGroupAdditionalProperties = ( + product: LegacyProductVTEX, +) => { + const groups = product.allSpecificationsGroups ?? []; + const allSpecifications = product.allSpecifications ?? []; - return values.map((value) => - toAdditionalPropertySpecification({ name, value }) - ); - }) ?? []; + const specByGroup: Record = {}; -const toProductGroupAdditionalProperties = ({ properties = [] }: ProductVTEX) => - properties.flatMap(({ name, values }) => - values.map( - (value) => ({ - "@type": "PropertyValue", + groups.forEach((group) => { + const groupSpecs = (product as unknown as Record)[group]; + groupSpecs.forEach((specName) => { + specByGroup[specName] = group; + }); + }); + + return allSpecifications.flatMap((name) => { + const values = (product as unknown as Record)[name]; + return values.map((value) => + toAdditionalPropertySpecification({ name, value, - valueReference: "PROPERTY" as string, - } as const), + propertyID: specByGroup[name], + }) + ); + }); +}; + +const toProductGroupAdditionalProperties = ( + { specificationGroups = [] }: ProductVTEX, +) => + specificationGroups.flatMap(({ name: groupName, specifications }) => + specifications.flatMap(({ name, values }) => + values.map( + (value) => + ({ + "@type": "PropertyValue", + name, + value, + propertyID: groupName, + valueReference: "PROPERTY" as string, + }) as const, + ) ) ); +const toOriginalAttributesAdditionalProperties = ( + originalAttributes: Maybe, + product: ProductVTEX | LegacyProduct, +) => { + if (!originalAttributes) { + return []; + } + + const attributes = + pick(originalAttributes as Array, product) ?? {}; + + return Object.entries(attributes).map(([name, value]) => + ({ + "@type": "PropertyValue", + name, + value, + valueReference: "ORIGINAL_PROPERTY" as string, + }) as const + ) as unknown as PropertyValue[]; +}; + const toAdditionalProperties = (sku: SkuVTEX): PropertyValue[] => sku.variations?.flatMap(({ name, values }) => values.map((value) => toAdditionalPropertySpecification({ name, value })) @@ -473,26 +628,36 @@ const toAdditionalPropertiesLegacy = (sku: LegacySkuVTEX): PropertyValue[] => { ); const attachmentProperties = attachments.map( - (attachment) => ({ - "@type": "PropertyValue", - propertyID: `${attachment.id}`, - name: attachment.name, - value: attachment.domainValues, - required: attachment.required, - valueReference: "ATTACHMENT", - } as const), + (attachment) => + ({ + "@type": "PropertyValue", + propertyID: `${attachment.id}`, + name: attachment.name, + value: attachment.domainValues, + required: attachment.required, + valueReference: "ATTACHMENT", + }) as const, ); return [...specificationProperties, ...attachmentProperties]; }; -const toOffer = ({ commertialOffer: offer, sellerId }: SellerVTEX): Offer => ({ +const toOffer = ({ + commertialOffer: offer, + sellerId, + sellerName, + sellerDefault, +}: SellerVTEX): Offer => ({ "@type": "Offer", + identifier: sellerDefault ? "default" : undefined, price: offer.spotPrice ?? offer.Price, seller: sellerId, + sellerName, priceValidUntil: offer.PriceValidUntil, inventoryLevel: { value: offer.AvailableQuantity }, + giftSkuIds: offer.GiftSkuIds ?? [], teasers: offer.teasers ?? [], + sellerDefault, priceSpecification: [ { "@type": "UnitPriceSpecification", @@ -504,6 +669,11 @@ const toOffer = ({ commertialOffer: offer, sellerId }: SellerVTEX): Offer => ({ priceType: "https://schema.org/SalePrice", price: offer.Price, }, + { + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/SRP", + price: offer.PriceWithoutDiscount, + }, ...offer.Installments.map( (installment): UnitPriceSpecification => ({ "@type": "UnitPriceSpecification", @@ -522,32 +692,56 @@ const toOffer = ({ commertialOffer: offer, sellerId }: SellerVTEX): Offer => ({ : "https://schema.org/OutOfStock", }); -const toOfferLegacy = (seller: SellerVTEX): Offer => ({ - ...toOffer(seller), - teasers: (seller.commertialOffer.Teasers ?? []).map((teaser) => ({ - name: teaser["k__BackingField"], - generalValues: teaser["k__BackingField"], - conditions: { - minimumQuantity: teaser["k__BackingField"][ - "k__BackingField" - ], - parameters: teaser["k__BackingField"][ - "k__BackingField" - ].map((parameter) => ({ - name: parameter["k__BackingField"], - value: parameter["k__BackingField"], - })), - }, - effects: { - parameters: teaser["k__BackingField"][ - "k__BackingField" - ].map((parameter) => ({ - name: parameter["k__BackingField"], - value: parameter["k__BackingField"], +const toOfferLegacy = (seller: SellerVTEX): Offer => { + const otherTeasers = seller.commertialOffer.DiscountHighLight?.map((i) => { + const discount = i as Record; + const [_k__BackingField, discountName] = Object.entries(discount)?.[0] ?? + []; + + const teasers: Teasers = { + name: discountName, + conditions: { + minimumQuantity: 0, + parameters: [], + }, + effects: { + parameters: [], + }, + }; + + return teasers; + }) ?? []; + + return { + ...toOffer(seller), + teasers: [ + ...otherTeasers, + ...(seller.commertialOffer.Teasers ?? []).map((teaser) => ({ + name: teaser["k__BackingField"], + generalValues: teaser["k__BackingField"], + conditions: { + minimumQuantity: teaser["k__BackingField"][ + "k__BackingField" + ], + parameters: teaser["k__BackingField"][ + "k__BackingField" + ].map((parameter) => ({ + name: parameter["k__BackingField"], + value: parameter["k__BackingField"], + })), + }, + effects: { + parameters: teaser["k__BackingField"][ + "k__BackingField" + ].map((parameter) => ({ + name: parameter["k__BackingField"], + value: parameter["k__BackingField"], + })), + }, })), - }, - })), -}); + ], + }; +}; export const legacyFacetToFilter = ( name: string, @@ -556,24 +750,64 @@ export const legacyFacetToFilter = ( map: string, term: string, behavior: "dynamic" | "static", + ignoreCaseSelected?: boolean, + fullPath = false, ): Filter | null => { const mapSegments = map.split(",").filter((x) => x.length > 0); - const pathSegments = term - .replace(/^\//, "") - .split("/") - .slice(0, mapSegments.length); + const pathSegments = term.replace(/^\//, "").split("/").slice( + 0, + mapSegments.length, + ); + + const mapSet = new Set( + mapSegments.map((i) => ignoreCaseSelected ? i.toLowerCase() : i), + ); + const pathSet = new Set( + pathSegments.map((i) => ignoreCaseSelected ? i.toLowerCase() : i), + ); - const mapSet = new Set(mapSegments); - const pathSet = new Set(pathSegments); + // for productClusterIds, we have to use the full path + // example: + // category2/123?map=c,productClusterIds -> DO NOT WORK + // category1/category2/123?map=c,c,productClusterIds -> WORK + const hasProductClusterIds = mapSegments.includes("productClusterIds"); + const hasToBeFullpath = fullPath || + hasProductClusterIds || + mapSegments.includes("ft") || + mapSegments.includes("b"); const getLink = (facet: LegacyFacet, selected: boolean) => { - const index = pathSegments.findIndex((s) => s === facet.Value); + const index = pathSegments.findIndex((s) => { + if (ignoreCaseSelected) { + return s.toLowerCase() === facet.Value.toLowerCase(); + } + + return s === facet.Value; + }); + + const map = hasToBeFullpath + ? facet.Link.split("map=")[1].split(",") + : [facet.Map]; + const value = hasToBeFullpath + ? facet.Link.split("?")[0].slice(1).split("/") + : [facet.Value]; + + const pathSegmentsFiltered = hasProductClusterIds + ? [pathSegments[mapSegments.indexOf("productClusterIds")]] + : []; + const mapSegmentsFiltered = hasProductClusterIds + ? ["productClusterIds"] + : []; + + const _mapSegments = hasToBeFullpath ? mapSegmentsFiltered : mapSegments; + const _pathSegments = hasToBeFullpath ? pathSegmentsFiltered : pathSegments; + const newMap = selected ? [...mapSegments.filter((_, i) => i !== index)] - : [...mapSegments, facet.Map]; + : [..._mapSegments, ...map]; const newPath = selected ? [...pathSegments.filter((_, i) => i !== index)] - : [...pathSegments, facet.Value]; + : [..._pathSegments, ...value]; // Insertion-sort like algorithm. Uses the c-continuum theorem const zipped: [string, string][] = []; @@ -589,7 +823,10 @@ export const legacyFacetToFilter = ( const link = new URL(`/${zipped.map(([, s]) => s).join("/")}`, url); link.searchParams.set("map", zipped.map(([m]) => m).join(",")); if (behavior === "static") { - link.searchParams.set("fmap", url.searchParams.get("fmap") || map); + link.searchParams.set( + "fmap", + url.searchParams.get("fmap") || mapSegments.join(","), + ); } const currentQuery = url.searchParams.get("q"); if (currentQuery) { @@ -598,9 +835,10 @@ export const legacyFacetToFilter = ( return `${link.pathname}${link.search}`; }; + return { "@type": "FilterToggle", - quantity: facets.length, + quantity: facets?.length, label: name, key: name, values: facets.map((facet) => { @@ -608,8 +846,16 @@ export const legacyFacetToFilter = ( ? facet : normalizeFacet(facet); - const selected = mapSet.has(normalizedFacet.Map) && - pathSet.has(normalizedFacet.Value); + const selected = mapSet.has( + ignoreCaseSelected + ? normalizedFacet.Map.toLowerCase() + : normalizedFacet.Map, + ) && + pathSet.has( + ignoreCaseSelected + ? normalizedFacet.Value.toLowerCase() + : normalizedFacet.Value, + ); return { value: normalizedFacet.Value, @@ -617,6 +863,18 @@ export const legacyFacetToFilter = ( url: getLink(normalizedFacet, selected), label: normalizedFacet.Name, selected, + children: facet.Children?.length > 0 + ? legacyFacetToFilter( + normalizedFacet.Name, + facet.Children, + url, + map, + term, + behavior, + ignoreCaseSelected, + fullPath, + ) + : undefined, }; }), }; @@ -766,6 +1024,17 @@ export const categoryTreeToNavbar = ( tree: Category[], ): SiteNavigationElement[] => tree.map(nodeToNavbar); +export const toBrand = ( + { id, name, imageUrl, metaTagDescription }: BrandVTEX, + baseUrl: string, +): Brand => ({ + "@type": "Brand", + "@id": `${id}`, + name, + logo: imageUrl?.startsWith("http") ? imageUrl : `${baseUrl}${imageUrl}`, + description: metaTagDescription, +}); + export const normalizeFacet = (facet: LegacyFacet) => { return { ...facet, @@ -773,3 +1042,257 @@ export const normalizeFacet = (facet: LegacyFacet) => { Value: facet.Slug!, }; }; + +export const toReview = ( + products: Product[], + ratings: ProductRating[], + reviews: ProductReviewData[], +): Product[] => { + return products.map((p, index) => { + const ratingsCount = ratings[index].totalCount || 0; + const productReviews = reviews[index].data || []; + + return { + ...p, + aggregateRating: { + "@type": "AggregateRating", + reviewCount: ratingsCount, + ratingCount: ratingsCount, + ratingValue: ratings[index]?.average || 0, + }, + review: productReviews.map((_, reviewIndex) => ({ + "@type": "Review", + id: productReviews[reviewIndex]?.id?.toString(), + author: [{ + "@type": "Author", + name: productReviews[reviewIndex]?.reviewerName, + verifiedBuyer: productReviews[reviewIndex]?.verifiedPurchaser, + }], + itemReviewed: productReviews[reviewIndex]?.productId, + datePublished: productReviews[reviewIndex]?.reviewDateTime, + reviewHeadline: productReviews[reviewIndex]?.title, + reviewBody: productReviews[reviewIndex]?.text, + reviewRating: { + "@type": "AggregateRating", + ratingValue: productReviews[reviewIndex]?.rating || 0, + }, + })), + }; + }); +}; + +export const toInventories = ( + products: Product[], + inventoriesData: ProductInventoryData[], +): Product[] => { + return products.map((p, index) => { + const balance = inventoriesData[index].balance || []; + + const additionalProperty = Array.from(p.additionalProperty || []); + + const inventories: PropertyValue[] = balance.map((b) => ({ + "@type": "PropertyValue", + valueReference: "INVENTORY", + propertyID: b.warehouseId, + name: b.warehouseName, + value: b.totalQuantity?.toString(), + })); + + return { + ...p, + additionalProperty: [...additionalProperty, ...inventories], + }; + }); +}; + +type ProductMap = Record; + +export const sortProducts = ( + products: Product[], + orderOfIdsOrSkus: string[], + prop: "sku" | "inProductGroupWithID", +) => { + const productMap: ProductMap = {}; + + products.forEach((product) => { + productMap[product[prop] || product["sku"]] = product; + }); + + return orderOfIdsOrSkus.map((id) => productMap[id]); +}; + +export const parsePageType = (p: PageTypeVTEX): PageType => { + const type = p.pageType; + + // Search or Busca vazia + if (type === "FullText") { + return "Search"; + } + + // A page that vtex doesn't recognize + if (type === "NotFound") { + return "Unknown"; + } + + return type; +}; + +function dayOfWeekIndexToString(day?: number): DayOfWeek | undefined { + switch (day) { + case 0: + return "Sunday"; + case 1: + return "Monday"; + case 2: + return "Tuesday"; + case 3: + return "Wednesday"; + case 4: + return "Thursday"; + case 5: + return "Friday"; + case 6: + return "Saturday"; + default: + return undefined; + } +} + +interface Hours { + dayOfWeek?: number; + openingTime?: string; + closingTime?: string; +} + +function toHoursSpecification(hours: Hours): OpeningHoursSpecification { + return { + "@type": "OpeningHoursSpecification", + opens: hours.openingTime, + closes: hours.closingTime, + dayOfWeek: dayOfWeekIndexToString(hours.dayOfWeek), + }; +} + +function toSpecialHoursSpecification( + holiday: PickupHolidays, +): OpeningHoursSpecification { + const dateHoliday = new Date(holiday.date ?? ""); + // VTEX provide date in ISO format, at 00h on the day + const validThrough = dateHoliday.setDate(dateHoliday.getDate() + 1) + .toString(); + + return { + "@type": "OpeningHoursSpecification", + opens: holiday.hourBegin, + closes: holiday.hourEnd, + validFrom: holiday.date, + validThrough, + }; +} + +function isPickupPointVCS( + pickupPoint: PickupPoint | PickupPointVCS, +): pickupPoint is PickupPointVCS { + return "name" in pickupPoint; +} + +interface ToPlaceOptions { + isActive?: boolean; +} + +export function toPlace( + pickupPoint: PickupPoint & { distance?: number } | PickupPointVCS, + options?: ToPlaceOptions, +): Place { + const { + name, + country, + latitude, + longitude, + openingHoursSpecification, + specialOpeningHoursSpecification, + isActive, + } = isPickupPointVCS(pickupPoint) + ? { + name: pickupPoint.name, + country: pickupPoint.address?.country?.acronym, + latitude: pickupPoint.address?.location?.latitude, + longitude: pickupPoint.address?.location?.longitude, + specialOpeningHoursSpecification: pickupPoint.pickupHolidays?.map( + toSpecialHoursSpecification, + ), + openingHoursSpecification: pickupPoint.businessHours?.map( + toHoursSpecification, + ), + isActive: pickupPoint.isActive, + } + : { + name: pickupPoint.friendlyName, + country: pickupPoint.address?.country, + latitude: pickupPoint.address?.geoCoordinates?.[0], + longitude: pickupPoint.address?.geoCoordinates?.[1], + specialOpeningHoursSpecification: pickupPoint.pickupHolidays?.map( + toSpecialHoursSpecification, + ), + openingHoursSpecification: pickupPoint.businessHours?.map(( + { ClosingTime, DayOfWeek, OpeningTime }, + ) => + toHoursSpecification({ + closingTime: ClosingTime, + dayOfWeek: DayOfWeek, + openingTime: OpeningTime, + }) + ), + isActive: options?.isActive, + }; + + return { + "@id": pickupPoint.id, + "@type": "Place", + address: { + "@type": "PostalAddress", + addressCountry: country, + addressLocality: pickupPoint.address?.city, + addressRegion: pickupPoint.address?.state, + postalCode: pickupPoint.address?.postalCode, + streetAddress: pickupPoint.address?.street, + }, + latitude, + longitude, + name, + specialOpeningHoursSpecification, + openingHoursSpecification, + additionalProperty: [ + { + "@type": "PropertyValue", + name: "distance", + value: `${pickupPoint.distance}`, + }, + { + "@type": "PropertyValue", + name: "isActive", + value: typeof isActive === "boolean" ? `${isActive}` : undefined, + }, + ], + }; +} + +export const toPostalAddress = (address: Address): PostalAddress => { + return { + "@type": "PostalAddress", + "@id": address.addressId, + addressCountry: address.country, + addressLocality: address.city, + addressRegion: address.state, + areaServed: address.neighborhood || undefined, + postalCode: address.postalCode, + streetAddress: address.street, + identifier: address.number || undefined, + name: address.addressName || undefined, + alternateName: address.receiverName || undefined, + description: address.complement || undefined, + disambiguatingDescription: address.reference || undefined, + latitude: address.geoCoordinates?.[0] || undefined, + longitude: address.geoCoordinates?.[1] || undefined, + }; +}; diff --git a/vtex/utils/types.ts b/vtex/utils/types.ts index baf2d8d6f..0d41dae82 100644 --- a/vtex/utils/types.ts +++ b/vtex/utils/types.ts @@ -1,4 +1,8 @@ -/** @description Equivalent to sku ID in VTEX platform */ +/** + * @format dynamic-options + * @options vtex/loaders/options/productIdByTerm.ts + * @description Equivalent to sku ID in VTEX platform + */ export type ProductID = string; export interface OrderForm { @@ -141,7 +145,7 @@ export interface OrderFormItem { bundleItems: unknown[]; attachments: unknown[]; attachmentOfferings: AttachmentOffering[]; - offerings: unknown[]; + offerings: Offering[]; priceTags: PriceTag[]; availability: string; measurementUnit: string; @@ -232,14 +236,14 @@ export interface PriceTag { export type AvailableAssociations = Record; export interface MarketingData { - utmSource: string; - utmMedium: null; - utmCampaign: string; - utmipage: null; - utmiPart: null; - utmiCampaign: null; - coupon: null; - marketingTags: string[]; + utmSource: string | undefined; + utmMedium: string | undefined; + utmCampaign: string | undefined; + utmiPage: string | undefined; + utmiPart: string | undefined; + utmiCampaign: string | undefined; + coupon: string | undefined; + marketingTags: string[] | undefined; } export interface Message { @@ -359,20 +363,22 @@ export interface ShippingData { } export interface Address { - addressType: string; - receiverName: null; + addressType?: string; + receiverName: string | null; addressId: string; - isDisposable: boolean; - postalCode: string; - city: string; - state: string; - country: string; - street: string; - number: null | string; - neighborhood: string; - complement: null | string; - reference: null; - geoCoordinates: number[]; + isDisposable?: boolean; + postalCode?: string; + city?: string; + state?: string; + country?: string; + street?: string; + number?: string; + neighborhood?: string; + addressName?: string; + complement: string | null; + reference?: string; + geoCoordinates?: number[]; + name?: string; } export interface LogisticsInfo { @@ -445,12 +451,19 @@ export interface PickupStoreInfo { dockId: null; } +export interface PickupHolidays { + date?: string; + hourBegin?: string; + hourEnd?: string; +} + export interface PickupPoint { friendlyName: string; address: Address; additionalInfo: string; id: string; businessHours: BusinessHour[]; + pickupHolidays?: PickupHolidays[]; } export interface BusinessHour { @@ -530,7 +543,15 @@ export interface SearchArgs { } export interface SelectedFacet { + /** + * @title Key + * @description The key of the facet (e.g. "brand", "category-1", "productClusterIds") + */ key: string; + /** + * @title Value + * @description The value of the facet + */ value: string; } @@ -566,6 +587,7 @@ export interface ProductSearchResult { locale: string; query: string; operator: "and" | "or"; + redirect: string; fuzzy: string; correction?: Correction; } @@ -655,6 +677,7 @@ export type LegacyProduct = IProduct & { productTitle: string; items: LegacyItem[]; allSpecifications: string[]; + allSpecificationsGroups?: string[]; }; export type LegacyFacets = { @@ -724,8 +747,9 @@ export interface Installment { Name: string; } -export type LegacyItem = Omit & { +export type LegacyItem = Omit & { variations: string[]; + Videos: string[]; } & Record; export interface Item { @@ -734,12 +758,13 @@ export interface Item { nameComplete: string; complementName: string; ean: string; + estimatedDateArrival: string; referenceId?: Array<{ Key: string; Value: string }>; measurementUnit: string; unitMultiplier: number; - modalType: unknown | null; + modalType: string | null; images: Image[]; - Videos: string[]; + videos: string[]; variations: Array<{ name: string; values: string[]; @@ -1057,7 +1082,10 @@ export interface Segment { regionId: string | null; utm_campaign: string | null; utm_source: string | null; + utm_medium: string | null; utmi_campaign: string | null; + utmi_page: string | null; + utmi_part: string | null; /** @description BRL, USD stc */ currencyCode: string; /** @description R$, $ etc */ @@ -1106,6 +1134,29 @@ export interface SimulationItem { export type SPEvent = | { type: "session.ping"; + url: string; + } + | { + type: "page.cart"; + products: { + productId: string; + quantity: number; + }[]; + } + | { + type: "page.empty_cart"; + // Empty array is converted to a invalid json schema... so, let it be anything. + // deno-lint-ignore ban-types + products: {}; + } + | { + type: "page.confirmation"; + order: string; + products: { + productId: string; + quantity: number; + price: number; + }[]; } | { type: "search.click"; @@ -1116,6 +1167,7 @@ export type SPEvent = } | { type: "search.query"; + url: string; text: string; misspelled: boolean; match: number; @@ -1124,7 +1176,709 @@ export type SPEvent = }; export interface CreateNewDocument { - Id: string; - Href: string; - DocumentId: string; + Id?: string; + Href?: string; + DocumentId?: string; +} + +export interface Document extends Record { + additionalProperties?: string; + id?: string; + accountId?: string; + accountName?: string; + dataEntityId?: string; +} + +export interface SelectableGifts { + id: string; + selectedGifts: { + id: string; + seller: string; + index: number; + }[]; +} + +export interface Brand { + id: number; + name: string; + isActive: boolean; + title: string; + metaTagDescription: string; + imageUrl: string | null; +} + +export interface Collection { + id: number; + name: "Live influencers"; + searchable: boolean; + highlight: boolean; + dateFrom: string; + dateTo: string; + totalSku: number; + totalProducts: number; + type: "Manual" | "Automatic" | "Hybrid"; + lastModifiedBy?: string; +} + +export interface CollectionList { + paging: { + page: number; + perPage: number; + total: number; + pages: number; + limit: number; + }; + items?: Collection[]; +} + +export interface ProductRatingAndReviews { + productRating?: ProductRating; + productReviews?: ProductReviewData; +} + +export interface ProductRating { + average?: number; + totalCount?: number; +} + +export interface ProductReview { + id?: string | undefined; + productId?: string | undefined; + rating?: number | undefined; + title?: string | undefined; + text?: string | undefined; + reviewerName?: string | undefined; + shopperId?: string | undefined; + reviewDateTime?: string | undefined; + searchDate?: string | undefined; + verifiedPurchaser?: boolean | undefined; + sku?: string | null; + approved?: boolean; + location?: string | null; + locale?: string | null; + pastReviews?: string | null; +} + +export interface ProductReviewRange { + total?: number; + from?: number; + to?: number; +} + +export interface ProductReviewData { + data?: ProductReview[] | undefined; + range?: ProductReviewRange; +} + +export interface ProductBalance { + hasUnlimitedQuantity?: boolean; + leadTime?: string; + reservedQuantity?: number; + totalQuantity?: number; + warehouseId?: string; + warehouseName?: string; +} + +export interface ProductInventoryData { + skuId?: string; + balance?: ProductBalance[]; +} + +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 Order { + ShippingEstimatedDate?: Date; + ShippingEstimatedDateMax: string; + ShippingEstimatedDateMin: string; + affiliateId: string; + authorizedDate: string; + callCenterOperatorName: string; + clientName: string; + creationDate: string; + currencyCode: string; + deliveryDates: Date[]; + giftCardProviders: string[]; + hostname: string; + invoiceInput: string; + invoiceOutput: string[]; + isAllDelivered: boolean; + isAnyDelivered: boolean; + items: OrderFormItem[]; + lastChange: string; + lastMessageUnread: string; + listId: string; + listType: string; + marketPlaceOrderId: string; + orderFormId: string; + orderId: string; + orderIsComplete: boolean; + origin: string; + paymentApprovedDate: string; + paymentNames: string; + salesChannel: string; + sequence: string; + status: string; + statusDescription: string; + totalItems: number; + totalValue: number; + workflowInErrorState: boolean; + workflowInRetry: boolean; +} + +export interface Orders { + facets: Facet[]; + list: Order[]; + paging: { + total: number; + pages: number; + currentPage: number; + perPage: number; + }; + reportRecordsLimit: number; + stats: { + stats: { + totalItems: { + Count: number; + Max: number; + Mean: number; + Min: number; + Missing: number; + StdDev: number; + Sum: number; + SumOfSquares: number; + }; + totalValue: { + Count: number; + Max: number; + Mean: number; + Min: number; + Missing: number; + StdDev: number; + Sum: number; + SumOfSquares: number; + }; + }; + }; +} + +export interface SalesChannel { + Id?: number; + Name?: string; + IsActive?: boolean; + ProductClusterId?: number | null; + CountryCode?: string; + CultureInfo?: string; + TimeZone?: string; + CurrencyCode?: string; + CurrencySymbol?: string; + CurrencyLocale?: number; + CurrencyFormatInfo?: { + CurrencyDecimalDigits?: number; + CurrencyDecimalSeparator?: string; + CurrencyGroupSeparator?: string; + CurrencyGroupSize?: number; + StartsWithCurrencySymbol?: boolean; + }; + Origin?: string | null; + Position?: number | null; + ConditionRule?: string | null; + CurrencyDecimalDigits?: number; +} + +export interface Promotion { + idCalculatorConfiguration: string; + name: string; + beginDateUtc: string; + endDateUtc: string; + lastModified: string; + daysAgoOfPurchases: number; + isActive: boolean; + isArchived: boolean; + isFeatured: boolean; + disableDeal: boolean; + activeDaysOfWeek: number[]; + offset: number; + activateGiftsMultiplier: boolean; + newOffset: number; + maxPricesPerItems: string[]; + cumulative: boolean; + nominalShippingDiscountValue: number; + absoluteShippingDiscountValue: number; + nominalDiscountValue: number; + nominalDiscountType: string; + maximumUnitPriceDiscount: number; + percentualDiscountValue: number; + rebatePercentualDiscountValue: number; + percentualShippingDiscountValue: number; + percentualTax: number; + shippingPercentualTax: number; + percentualDiscountValueList1: number; + percentualDiscountValueList2: number; + skusGift: { + quantitySelectable: number; + gifts: number; + }; + nominalRewardValue: number; + percentualRewardValue: number; + orderStatusRewardValue: string; + applyToAllShippings: boolean; + nominalTax: number; + maxPackValue: number; + origin: string; + idSellerIsInclusive: boolean; + idsSalesChannel: string[]; + areSalesChannelIdsExclusive: boolean; + marketingTags: string[]; + marketingTagsAreNotInclusive: boolean; + paymentsMethods: { + id: string; + name: string; + }[]; + stores: string[]; + campaigns: string[]; + storesAreInclusive: boolean; + categories: { + id: string; + name: string; + }[]; + categoriesAreInclusive: boolean; + brands: { + id: string; + name: string; + }[]; + brandsAreInclusive: boolean; + products: { + id: string; + name: string; + }[]; + productsAreInclusive: boolean; + skus: { + id: string; + name: string; + }[]; + skusAreInclusive: boolean; + collections1BuyTogether: { + id: string; + name: string; + }[]; + collections2BuyTogether: { + id: string; + name: string; + }[]; + minimumQuantityBuyTogether: number; + quantityToAffectBuyTogether: number; + enableBuyTogetherPerSku: boolean; + listSku1BuyTogether: { + id: string; + name: string; + }[]; + listSku2BuyTogether: { + id: string; + name: string; + }[]; + coupon: string[]; + totalValueFloor: number; + totalValueCeling: number; + totalValueIncludeAllItems: boolean; + totalValueMode: string; + collections: { + id: string; + name: string; + }[]; + collectionsIsInclusive: boolean; + restrictionsBins: string[]; + cardIssuers: string[]; + totalValuePurchase: number; + slasIds: string[]; + isSlaSelected: boolean; + isFirstBuy: boolean; + firstBuyIsProfileOptimistic: boolean; + compareListPriceAndPrice: boolean; + isDifferentListPriceAndPrice: boolean; + zipCodeRanges: { + zipCodeFrom: string; + zipCodeTo: string; + inclusive: string; + }[]; + itemMaxPrice: number; + itemMinPrice: number; + installment: number; + isMinMaxInstallments: boolean; + minInstallment: number; + maxInstallment: number; + merchants: string[]; + clusterExpressions: string[]; + clusterOperator: string; + paymentsRules: string[]; + giftListTypes: string[]; + productsSpecifications: string[]; + affiliates: { + id: string; + name: string; + }[]; + maxUsage: number; + maxUsagePerClient: number; + shouldDistributeDiscountAmongMatchedItems: boolean; + multipleUsePerClient: boolean; + accumulateWithManualPrice: boolean; + type: string; + useNewProgressiveAlgorithm: boolean; + percentualDiscountValueList: number[]; + isAppliedToMostExpensive: boolean; + maxNumberOfAffectedItems: number; + maxNumberOfAffectedItemsGroupKey: string; +} + +export interface AdvancedLoaderConfig { + /** @description Specifies an array of attribute names from the original object to be directly included in the transformed object. */ + includeOriginalAttributes: string[]; + + /** @description Allow this field if you prefer to use description instead of metaTagDescription */ + preferDescription?: boolean; +} + +export type Maybe = T | null | undefined; + +export 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; +} + +export interface SavedAddress { + id: string; + cacheId: string; +} + +export type SimulationBehavior = "default" | "skip" | "only1P"; + +export enum DeviceType { + Mobile = "MOBILE", + Tablet = "TABLET", + Desktop = "DESKTOP", +} + +export interface LoginSession { + id: string; + cacheId: string; + deviceType: DeviceType; + city?: Maybe; + lastAccess: string; + browser?: Maybe; + os?: Maybe; + ip?: Maybe; + fullAddress?: Maybe; + firstAccess: string; +} + +export interface LoginSessionsInfo { + currentLoginSessionId?: Maybe; + loginSessions?: Maybe; +} + +export interface Session { + id: string; + namespaces?: { + profile: SessionProfile; + impersonate: SessionImpersonate; + authentication: Record; + public: SessionPublic; + }; +} + +export interface SessionProfile { + id?: { value: string }; + email?: { value: string }; + firstName?: { value: string }; + lastName?: { value: string }; + phone?: { value: string }; + isAuthenticated?: { value: string }; + priceTables?: { value: string }; +} + +export interface SessionImpersonate { + storeUserEmail?: { value: string }; + storeUserId?: { value: string }; +} + +export interface SessionPublic { + orderFormId?: { value: string }; + utm_source?: { value: string }; + utm_medium?: { value: string }; + utm_campaign?: { value: string }; + utm_term?: { value: string }; + utm_content?: { value: string }; + utmi_cp?: { value: string }; + utmi_pc?: { value: string }; + utmi_p?: { value: string }; +} + +export interface ProfileCustomField { + key?: Maybe; + value?: Maybe; +} + +export interface PaymentProfile { + cacheId?: Maybe; + id?: Maybe; + paymentSystem?: Maybe; + paymentSystemName?: Maybe; + cardNumber?: Maybe; + address?: Maybe

; + isExpired?: Maybe; + expirationDate?: Maybe; + accountStatus?: Maybe; +} + +export interface Profile { + cacheId?: Maybe; + firstName?: Maybe; + lastName?: Maybe; + profilePicture?: Maybe; + email?: Maybe; + document?: Maybe; + userId?: Maybe; + birthDate?: Maybe; + gender?: Maybe; + homePhone?: Maybe; + businessPhone?: Maybe; + addresses?: Maybe; + isCorporate?: Maybe; + corporateName?: Maybe; + corporateDocument?: Maybe; + stateRegistration?: Maybe; + payments?: Maybe; + customFields?: Maybe; + passwordLastUpdate?: Maybe; + pii?: Maybe; + tradeName?: Maybe; +} + +export interface ProfileInput { + email: string; + firstName?: Maybe; + lastName?: Maybe; + document?: Maybe; + phone?: Maybe; + birthDate?: Maybe; + gender?: Maybe; + homePhone?: Maybe; + businessPhone?: Maybe; + tradeName?: Maybe; + corporateName?: Maybe; + corporateDocument?: Maybe; + stateRegistration?: Maybe; + isCorporate?: Maybe; +} + +export interface AuthResponse { + authStatus: string | "WrongCredentials" | "BlockedUser" | "Success"; + promptMFA: boolean; + clientToken: string | null; + authCookie: { + Name: string; + Value: string; + } | null; + accountAuthCookie: { + Name: string; + Value: string; + } | null; + expiresIn: number; + userId: string | null; + phoneNumber: string | null; + scope: string | null; +} + +export interface AuthProvider { + providerName: string; + className: string; + expectedContext: unknown[]; +} + +export interface StartAuthentication { + authenticationToken: string | null; + oauthProviders: AuthProvider[]; + showClassicAuthentication: boolean; + showAccessKeyAuthentication: boolean; + showPasskeyAuthentication: boolean; + authCookie: string | null; + isAuthenticated: boolean; + selectedProvider: string | null; + samlProviders: unknown[]; +} + +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: OrderFormItem[]; + 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?: MarketingData | null; + 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; } diff --git a/vtex/utils/vtexId.ts b/vtex/utils/vtexId.ts index 40d3d8ecf..eae0fd27b 100644 --- a/vtex/utils/vtexId.ts +++ b/vtex/utils/vtexId.ts @@ -2,7 +2,9 @@ import { getCookies } from "std/http/mod.ts"; import { decode } from "https://deno.land/x/djwt@v2.8/mod.ts"; import { stringify } from "./cookies.ts"; -const NAME = "VtexIdclientAutCookie"; +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 @@ -14,17 +16,21 @@ interface CookiePayload { } export const parseCookie = (headers: Headers, account: string) => { - const cookies = getCookies(headers); - const cookie = cookies[NAME] || cookies[`${NAME}_${account}`]; + const cookies = Object.fromEntries( + Object.entries(getCookies(headers)).filter(([key]) => + key.startsWith(VTEX_ID_CLIENT_COOKIE) || + key.startsWith(CHECKOUT_DATA_ACCESS_COOKIE) || + key.startsWith(VTEX_CHKO_AUTH) + ), + ); + const cookie = cookies[VTEX_ID_CLIENT_COOKIE] || + cookies[`${VTEX_ID_CLIENT_COOKIE}_${account}`]; const decoded = cookie ? decode(cookie) : null; const payload = decoded?.[1] as CookiePayload | undefined; return { - cookie: stringify({ - [NAME]: cookies[NAME], - [`${NAME}_${account}`]: cookies[`${NAME}_${account}`], - }), + cookie: stringify(cookies), payload, }; }; diff --git a/vtex/workflows/events.ts b/vtex/workflows/events.ts index 926f378d0..ef556167b 100644 --- a/vtex/workflows/events.ts +++ b/vtex/workflows/events.ts @@ -1,56 +1,50 @@ -import type { Workflow } from "deco/blocks/workflow.ts"; -import type { WorkflowContext, WorkflowGen } from "deco/mod.ts"; -import type { Notification } from "../actions/trigger.ts"; +import type { Product } from "../../commerce/types.ts"; +import { waitForWorkflowCompletion } from "../../workflows/utils/awaiters.ts"; +import type { VTEXNotificationPayload } from "../actions/trigger.ts"; import type { AppManifest } from "../mod.ts"; - +import { Workflow, WorkflowContext } from "@deco/deco/blocks"; +import { type WorkflowGen } from "@deco/deco"; interface Props { product: Workflow[]; } - export default function Index(props: Props) { return function* ( ctx: WorkflowContext, - notification?: Notification, + notification?: VTEXNotificationPayload, ): WorkflowGen { - if (!notification?.idSKU) { + if (!notification?.IdSku) { throw new Error(`Missing idSKU from notification`); } - - const { - idSKU, - HasStockKeepingUnitRemovedFromAffiliate, - isActive, - } = notification; - - const action = HasStockKeepingUnitRemovedFromAffiliate || !isActive + const { IdSku, HasStockKeepingUnitRemovedFromAffiliate } = notification; + const product = yield ctx.invoke("vtex/loaders/workflow/product.ts", { + productID: IdSku, + }); + const action = HasStockKeepingUnitRemovedFromAffiliate || !product ? "DELETE" : "UPSERT"; - - const product = yield ctx.invoke("vtex/loaders/product.ts", { - productID: idSKU, - }); - - if (!product) { - throw new Error(`No product returned by Product loader ${idSKU}`); - } - /** Start each registered workflow */ const workflows = props.product || []; - for (const workflow of workflows) { + const p: Product = product || { + "@type": "Product", + sku: IdSku, + productID: IdSku, + }; yield ctx.log( "Starting worflow for", workflow.key, "with productID", - product.productID, + p.productID, ); - - yield ctx.invoke("workflows/actions/start.ts", { + const exec = yield ctx.invoke("workflows/actions/start.ts", { // @ts-expect-error type is not resolving keys somehow key: workflow.key, props: workflow.props, - args: [product, action], + args: [p, action], }); + if (exec.id && exec.status === "running") { + yield waitForWorkflowCompletion(ctx, exec.id); + } } }; } diff --git a/vtex/workflows/product/index.ts b/vtex/workflows/product/index.ts new file mode 100644 index 000000000..35f69d69d --- /dev/null +++ b/vtex/workflows/product/index.ts @@ -0,0 +1,46 @@ +import { type VTEXNotificationPayload } from "../../actions/trigger.ts"; +import { type AppManifest } from "../../mod.ts"; +import { type Product } from "../../../commerce/types.ts"; +import { waitForWorkflowCompletion } from "../../../workflows/utils/awaiters.ts"; +import { type WorkflowContext } from "@deco/deco/blocks"; +import { type WorkflowGen } from "@deco/deco"; +const PAGE_SIZE = 50; +export default function Index() { + return function* (ctx: WorkflowContext): WorkflowGen { + let products: Product[] = []; + let page = 1; + let indexed = 0; + yield ctx.log("Starting product indexing workflow"); + do { + yield ctx.log( + `Product indexing workflow status: ${indexed} products were indexed`, + ); + products = yield ctx.invoke("vtex/loaders/workflow/products.ts", { + pagesize: PAGE_SIZE, + page, + }); + if (!Array.isArray(products)) { + break; + } + page++; + indexed += products.length; + const executions = []; + for (const product of products) { + const exec = yield ctx.invoke("workflows/actions/start.ts", { + // @ts-expect-error vtex trigger is on generated type + key: "vtex-trigger", + args: [{ IdSku: product.productID }] as VTEXNotificationPayload[], + }); + executions.push(exec); + } + for (const exec of executions) { + if (exec.id && exec.status === "running") { + yield waitForWorkflowCompletion(ctx, exec.id); + } + } + } while (products.length > 0); + yield ctx.log( + `Product indexing workflow finished after indexing ${indexed} skus`, + ); + }; +} diff --git a/wake/README.md b/wake/README.md index 25e0309cd..e507e681a 100644 --- a/wake/README.md +++ b/wake/README.md @@ -1,34 +1,9 @@ -

-

- - Wake - -

-

-

- - Wake Commerce the ecommerce enterprise platform - -

-

- Loaders, actions and workflows for adding Wake Commerce Platform to your deco.cx website. -

+Loaders, actions and workflows for adding Wake Commerce Platform to your deco.cx website. -

Wake, a Locaweb Company brand, was born thinking about the entire customer journey, in a much more fluid way and with consistent integrations. Our brand is divided into three business pillars: Wake Commerce (Headless Platform, Marketplace Hub and OMS), Wake Experience (Cloud marketing tool focused on consumer behavior) and Squid by Wake (Digital influencer platform). Wake is the game changer in technology for those who think big and want to go further, with a tireless focus on high performance in every detail. This app wrapps Wake Commerce API into a comprehensive set of loaders/actions/workflows empowering non technical users to interact and act upon their headless commerce. - -

- -# Installation - -1. Install via decohub -2. Fill the necessary fields: - -🎉 Your Wake setup is complete. You should now see Wake -loaders/actions/workflows available for your sections. diff --git a/wake/actions/cart/addCoupon.ts b/wake/actions/cart/addCoupon.ts index 1904f8c2e..d4a72a879 100644 --- a/wake/actions/cart/addCoupon.ts +++ b/wake/actions/cart/addCoupon.ts @@ -7,6 +7,7 @@ import { AddCouponMutationVariables, CheckoutFragment, } from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; export interface Props { coupon: string; @@ -19,6 +20,7 @@ const action = async ( ): Promise> => { const { storefront } = ctx; const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); if (!cartId) { throw new HttpError(400, "Missing cart cookie"); @@ -30,10 +32,13 @@ const action = async ( >({ variables: { checkoutId: cartId, ...props }, ...AddCoupon, - }); + }, { headers }); const checkoutId = data.checkout?.checkoutId; - setCartCookie(ctx.response.headers, checkoutId); + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } return data.checkout ?? {}; }; diff --git a/wake/actions/cart/addItem.ts b/wake/actions/cart/addItem.ts index 12846acec..51939d286 100644 --- a/wake/actions/cart/addItem.ts +++ b/wake/actions/cart/addItem.ts @@ -1,44 +1,15 @@ -import { HttpError } from "../../../utils/http.ts"; import { AppContext } from "../../mod.ts"; -import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; -import { AddItemToCart } from "../../utils/graphql/queries.ts"; -import { - AddItemToCartMutation, - AddItemToCartMutationVariables, - CheckoutFragment, -} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { CheckoutFragment } from "../../utils/graphql/storefront.graphql.gen.ts"; +import { CartItem as Props } from "./addItems.ts"; -export interface Props { - productVariantId: number; - quantity: number; - customization: { customizationId: number; value: string }[]; - subscription: { subscriptionGroupId: number; recurringTypeId: number }; -} +export type { CartItem as Props } from "./addItems.ts"; const action = async ( props: Props, - req: Request, + _req: Request, ctx: AppContext, ): Promise> => { - const { storefront } = ctx; - const cartId = getCartCookie(req.headers); - - if (!cartId) { - throw new HttpError(400, "Missing cart cookie"); - } - - const data = await storefront.query< - AddItemToCartMutation, - AddItemToCartMutationVariables - >({ - variables: { input: { id: cartId, products: [props] } }, - ...AddItemToCart, - }); - - const checkoutId = data.checkout?.checkoutId; - setCartCookie(ctx.response.headers, checkoutId); - - return data.checkout ?? {}; + return await ctx.invoke.wake.actions.cart.addItems({ products: [props] }); }; export default action; diff --git a/wake/actions/cart/addItems.ts b/wake/actions/cart/addItems.ts new file mode 100644 index 000000000..30325ddf9 --- /dev/null +++ b/wake/actions/cart/addItems.ts @@ -0,0 +1,53 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; +import { AddItemToCart } from "../../utils/graphql/queries.ts"; +import { + AddItemToCartMutation, + AddItemToCartMutationVariables, + CheckoutFragment, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface CartItem { + productVariantId: number; + quantity: number; + customization?: { customizationId: number; value: string }[]; + subscription?: { subscriptionGroupId: number; recurringTypeId: number }; +} + +export interface Props { + products: CartItem[]; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise> => { + const { storefront } = ctx; + const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); + + if (!cartId) { + throw new HttpError(400, "Missing cart cookie"); + } + + const data = await storefront.query< + AddItemToCartMutation, + AddItemToCartMutationVariables + >({ + variables: { input: { id: cartId, products: props.products } }, + ...AddItemToCart, + }, { headers }); + + const checkoutId = data.checkout?.checkoutId; + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } + + return data.checkout ?? {}; +}; + +export default action; diff --git a/wake/actions/cart/addKit.ts b/wake/actions/cart/addKit.ts new file mode 100644 index 000000000..554f40e68 --- /dev/null +++ b/wake/actions/cart/addKit.ts @@ -0,0 +1,59 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; +import { AddKit } from "../../utils/graphql/queries.ts"; +import { + AddKitMutation, + AddKitMutationVariables, + CheckoutFragment, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface KitItemVariant { + productVariantId: number; + quantity: number; +} + +export interface KitItem { + productId: number; + variants: KitItemVariant[]; +} + +export interface Props { + products: KitItem[]; + quantity: number; + kitId: number; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise> => { + const { storefront } = ctx; + const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); + const { quantity, kitId, products } = props; + + if (!cartId) { + throw new HttpError(400, "Missing cart cookie"); + } + + const data = await storefront.query< + AddKitMutation, + AddKitMutationVariables + >({ + variables: { input: { id: cartId, quantity, kitId, products } }, + ...AddKit, + }, { headers }); + + const checkoutId = data.checkout?.checkoutId; + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } + + return data.checkout ?? {}; +}; + +export default action; diff --git a/wake/actions/cart/partnerAssociate.ts b/wake/actions/cart/partnerAssociate.ts new file mode 100644 index 000000000..409fd987c --- /dev/null +++ b/wake/actions/cart/partnerAssociate.ts @@ -0,0 +1,50 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; +import { CheckoutPartnerAssociate } from "../../utils/graphql/queries.ts"; +import { + CheckoutFragment, + CheckoutPartnerAssociateMutation, + CheckoutPartnerAssociateMutationVariables, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; +import { setPartnerCookie } from "../../utils/partner.ts"; + +export interface Props { + partnerAccessToken: string; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise> => { + const { storefront } = ctx; + const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); + const { partnerAccessToken } = props; + + if (!cartId) { + throw new HttpError(400, "Missing cart cookie"); + } + + const data = await storefront.query< + CheckoutPartnerAssociateMutation, + CheckoutPartnerAssociateMutationVariables + >({ + variables: { checkoutId: cartId, partnerAccessToken }, + ...CheckoutPartnerAssociate, + }, { headers }); + + const checkoutId = data.checkout?.checkoutId; + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } + + setPartnerCookie(ctx.response.headers, partnerAccessToken); + + return data.checkout ?? {}; +}; + +export default action; diff --git a/wake/actions/cart/partnerDisassociate.ts b/wake/actions/cart/partnerDisassociate.ts new file mode 100644 index 000000000..619417ef3 --- /dev/null +++ b/wake/actions/cart/partnerDisassociate.ts @@ -0,0 +1,45 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; +import { CheckoutPartnerDisassociate } from "../../utils/graphql/queries.ts"; +import { + CheckoutFragment, + CheckoutPartnerDisassociateMutation, + CheckoutPartnerDisassociateMutationVariables, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; +import { deletePartnerCookie } from "../../utils/partner.ts"; + +const action = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise> => { + const { storefront } = ctx; + const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); + + if (!cartId) { + throw new HttpError(400, "Missing cart cookie"); + } + + const data = await storefront.query< + CheckoutPartnerDisassociateMutation, + CheckoutPartnerDisassociateMutationVariables + >({ + variables: { checkoutId: cartId }, + ...CheckoutPartnerDisassociate, + }, { headers }); + + const checkoutId = data.checkout?.checkoutId; + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } + + deletePartnerCookie(ctx.response.headers); + + return data.checkout ?? {}; +}; + +export default action; diff --git a/wake/actions/cart/removeCoupon.ts b/wake/actions/cart/removeCoupon.ts index 74ded4d72..94d70a8e7 100644 --- a/wake/actions/cart/removeCoupon.ts +++ b/wake/actions/cart/removeCoupon.ts @@ -7,6 +7,7 @@ import { RemoveCouponMutation, RemoveCouponMutationVariables, } from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; const action = async ( _props: unknown, @@ -15,6 +16,7 @@ const action = async ( ): Promise> => { const { storefront } = ctx; const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); if (!cartId) { throw new HttpError(400, "Missing cart cookie"); @@ -26,10 +28,13 @@ const action = async ( >({ variables: { checkoutId: cartId }, ...RemoveCoupon, - }); + }, { headers }); const checkoutId = data.checkout?.checkoutId; - setCartCookie(ctx.response.headers, checkoutId); + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } return data.checkout ?? {}; }; diff --git a/wake/actions/cart/removeKit.ts b/wake/actions/cart/removeKit.ts new file mode 100644 index 000000000..928b943ee --- /dev/null +++ b/wake/actions/cart/removeKit.ts @@ -0,0 +1,58 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; +import { RemoveKit } from "../../utils/graphql/queries.ts"; +import { + CheckoutFragment, + RemoveKitMutation, + RemoveKitMutationVariables, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface KitItemVariant { + productVariantId: number; + quantity: number; +} + +export interface KitItem { + productId: number; + variants: KitItemVariant[]; +} + +export interface Props { + products: KitItem[]; + quantity: number; + kitId: number; +} +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise> => { + const { storefront } = ctx; + const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); + const { quantity, kitId, products } = props; + + if (!cartId) { + throw new HttpError(400, "Missing cart cookie"); + } + + const data = await storefront.query< + RemoveKitMutation, + RemoveKitMutationVariables + >({ + variables: { input: { id: cartId, quantity, kitId, products } }, + ...RemoveKit, + }, { headers }); + + const checkoutId = data.checkout?.checkoutId; + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } + + return data.checkout ?? {}; +}; + +export default action; diff --git a/wake/actions/cart/updateItemQuantity.ts b/wake/actions/cart/updateItemQuantity.ts index a0411a615..49c81aed3 100644 --- a/wake/actions/cart/updateItemQuantity.ts +++ b/wake/actions/cart/updateItemQuantity.ts @@ -1,54 +1,36 @@ import { HttpError } from "../../../utils/http.ts"; import { AppContext } from "../../mod.ts"; import { getCartCookie, setCartCookie } from "../../utils/cart.ts"; +import { RemoveItemFromCart } from "../../utils/graphql/queries.ts"; import { - AddItemToCart, - RemoveItemFromCart, -} from "../../utils/graphql/queries.ts"; -import { - AddItemToCartMutation, - AddItemToCartMutationVariables, CheckoutFragment, RemoveItemFromCartMutation, RemoveItemFromCartMutationVariables, } from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; export interface Props { productVariantId: number; quantity: number; - customization: { customizationId: number; value: string }[]; - subscription: { subscriptionGroupId: number; recurringTypeId: number }; + customization?: { customizationId: number; value: string }[]; + subscription?: { subscriptionGroupId: number; recurringTypeId: number }; } -const addToCart = ( - props: Props, - cartId: string, - ctx: AppContext, -) => - ctx.storefront.query< - AddItemToCartMutation, - AddItemToCartMutationVariables - >({ - variables: { - input: { id: cartId, products: [props] }, - }, - ...AddItemToCart, - }); - const removeFromCart = ( props: Props, cartId: string, ctx: AppContext, + headers: Headers, ) => ctx.storefront.query< RemoveItemFromCartMutation, RemoveItemFromCartMutationVariables >({ variables: { - input: { id: cartId, products: [{ ...props, quantity: 1e6 }] }, + input: { id: cartId, products: [props] }, }, ...RemoveItemFromCart, - }); + }, { headers }); const action = async ( props: Props, @@ -56,21 +38,50 @@ const action = async ( ctx: AppContext, ): Promise> => { const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); if (!cartId) { throw new HttpError(400, "Missing cart cookie"); } - let data = await removeFromCart(props, cartId, ctx); + /* + * get cart + * find the current product on cart + * the current amount + * calculate the difference between the current item amount and requested new amount + */ - if (props.quantity > 0) { - data = await addToCart(props, cartId, ctx); + const cart = await ctx.invoke.wake.loaders.cart(props, req); + const item = cart.products?.find((item) => + item?.productVariantId === props.productVariantId + ); + const quantityItem = item?.quantity ?? 0; + const quantity = props.quantity - quantityItem; + + let checkout; + + if (props.quantity > 0 && quantity > 0) { + checkout = await ctx.invoke.wake.actions.cart.addItem({ + ...props, + quantity, + }); + } else { + const data = await removeFromCart( + { ...props, quantity: -quantity }, + cartId, + ctx, + headers, + ); + checkout = data.checkout; } - const checkoutId = data.checkout?.checkoutId; - setCartCookie(ctx.response.headers, checkoutId); + const checkoutId = checkout?.checkoutId; + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } - return data.checkout ?? {}; + return checkout ?? {}; }; export default action; diff --git a/wake/actions/newsletter/register.ts b/wake/actions/newsletter/register.ts new file mode 100644 index 000000000..643012fe1 --- /dev/null +++ b/wake/actions/newsletter/register.ts @@ -0,0 +1,41 @@ +import { HttpError } from "../../../utils/http.ts"; +import { AppContext } from "../../mod.ts"; +import { CreateNewsletterRegister } from "../../utils/graphql/queries.ts"; +import { + CreateNewsletterRegisterMutation, + CreateNewsletterRegisterMutationVariables, + NewsletterNode, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface Props { + email: string; + name: string; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + const headers = parseHeaders(req.headers); + + const data = await storefront.query< + CreateNewsletterRegisterMutation, + CreateNewsletterRegisterMutationVariables + >({ + variables: { input: { ...props } }, + ...CreateNewsletterRegister, + }, { + headers, + }); + + if (!data.createNewsletterRegister) { + throw new HttpError(400, "Error on Register"); + } + + return data.createNewsletterRegister; +}; + +export default action; diff --git a/wake/actions/notifyme.ts b/wake/actions/notifyme.ts new file mode 100644 index 000000000..880191501 --- /dev/null +++ b/wake/actions/notifyme.ts @@ -0,0 +1,38 @@ +import { AppContext } from "../mod.ts"; +import { ProductRestockAlert } from "../utils/graphql/queries.ts"; +import { + ProductRestockAlertMutation, + ProductRestockAlertMutationVariables, + RestockAlertNode, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; + +export interface Props { + email: string; + name: string; + productVariantId: number; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + const data = await storefront.query< + ProductRestockAlertMutation, + ProductRestockAlertMutationVariables + >({ + variables: { input: props }, + ...ProductRestockAlert, + }, { + headers, + }); + + return data.productRestockAlert ?? null; +}; + +export default action; diff --git a/wake/actions/review/create.ts b/wake/actions/review/create.ts new file mode 100644 index 000000000..10f441f2a --- /dev/null +++ b/wake/actions/review/create.ts @@ -0,0 +1,40 @@ +import { AppContext } from "../../mod.ts"; +import { CreateProductReview } from "../../utils/graphql/queries.ts"; +import { + CreateProductReviewMutation, + CreateProductReviewMutationVariables, + Review, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface Props { + email: string; + name: string; + productVariantId: number; + rating: number; + review: string; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + const data = await storefront.query< + CreateProductReviewMutation, + CreateProductReviewMutationVariables + >({ + variables: props, + ...CreateProductReview, + }, { + headers, + }); + + return data.createProductReview ?? null; +}; + +export default action; diff --git a/wake/actions/shippingSimulation.ts b/wake/actions/shippingSimulation.ts new file mode 100644 index 000000000..538519511 --- /dev/null +++ b/wake/actions/shippingSimulation.ts @@ -0,0 +1,80 @@ +import { AppContext } from "../mod.ts"; +import { ShippingQuotes } from "../utils/graphql/queries.ts"; +import { + ShippingQuotesQuery, + ShippingQuotesQueryVariables, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { getCartCookie } from "../utils/cart.ts"; +import { HttpError } from "../../utils/http.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; + +export interface Props { + cep?: string; + simulateCartItems?: boolean; + productVariantId?: number; + quantity?: number; + useSelectedAddress?: boolean; +} + +const buildSimulationParams = ( + props: Props, + checkoutId?: string, +): ShippingQuotesQueryVariables => { + const { + cep, + simulateCartItems, + productVariantId, + quantity, + useSelectedAddress, + } = props; + + const defaultQueryParams = { + cep, + useSelectedAddress, + }; + + if (simulateCartItems) { + if (!checkoutId) throw new HttpError(400, "Missing cart cookie"); + + return { + ...defaultQueryParams, + checkoutId, + }; + } + + return { + ...defaultQueryParams, + productVariantId, + quantity, + }; +}; + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + const cartId = getCartCookie(req.headers); + + const simulationParams = buildSimulationParams(props, cartId); + + const data = await storefront.query< + ShippingQuotesQuery, + ShippingQuotesQueryVariables + >({ + variables: { + ...simulationParams, + }, + ...ShippingQuotes, + }, { + headers, + }); + + return data.shippingQuotes ?? []; +}; + +export default action; diff --git a/wake/actions/submmitForm.ts b/wake/actions/submmitForm.ts new file mode 100644 index 000000000..beac2c3bf --- /dev/null +++ b/wake/actions/submmitForm.ts @@ -0,0 +1,37 @@ +import { AppContext } from "../mod.ts"; +import { SendGenericForm } from "../utils/graphql/queries.ts"; +import { + SendGenericFormMutation, + SendGenericFormMutationVariables, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; + +export interface Props { + body: unknown; + // file: Upload, + recaptchaToken: string; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + const data = await storefront.query< + SendGenericFormMutation, + SendGenericFormMutationVariables + >({ + variables: props, + ...SendGenericForm, + }, { + headers, + }); + + return data.sendGenericForm!; +}; + +export default action; diff --git a/wake/actions/wishlist/addProduct.ts b/wake/actions/wishlist/addProduct.ts new file mode 100644 index 000000000..93ebf7115 --- /dev/null +++ b/wake/actions/wishlist/addProduct.ts @@ -0,0 +1,50 @@ +import { AppContext } from "../../mod.ts"; +import authenticate from "../../utils/authenticate.ts"; +import { WishlistAddProduct } from "../../utils/graphql/queries.ts"; +import { ProductFragment } from "../../utils/graphql/storefront.graphql.gen.ts"; +import { + WishlistAddProductMutation, + WishlistAddProductMutationVariables, + WishlistReducedProductFragment, +} from "../../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface Props { + productId: number; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + const { productId } = props; + const customerAccessToken = await authenticate(req, ctx); + const headers = parseHeaders(req.headers); + + if (!customerAccessToken) return []; + + const data = await storefront.query< + WishlistAddProductMutation, + WishlistAddProductMutationVariables + >({ + variables: { customerAccessToken, productId }, + ...WishlistAddProduct, + }, { headers }); + + const products = data.wishlistAddProduct; + + if (!Array.isArray(products)) { + return null; + } + + return products + .filter((node): node is ProductFragment => Boolean(node)) + .map(({ productId, productName }) => ({ + productId, + productName, + })); +}; + +export default action; diff --git a/wake/actions/wishlist/removeProduct.ts b/wake/actions/wishlist/removeProduct.ts new file mode 100644 index 000000000..3102238e6 --- /dev/null +++ b/wake/actions/wishlist/removeProduct.ts @@ -0,0 +1,53 @@ +import { AppContext } from "../../mod.ts"; +import { WishlistRemoveProduct } from "../../utils/graphql/queries.ts"; +import { + WishlistReducedProductFragment, + WishlistRemoveProductMutation, + WishlistRemoveProductMutationVariables, +} from "../../utils/graphql/storefront.graphql.gen.ts"; + +import { ProductFragment } from "../../utils/graphql/storefront.graphql.gen.ts"; +import authenticate from "../../utils/authenticate.ts"; +import { parseHeaders } from "../../utils/parseHeaders.ts"; + +export interface Props { + productId: number; +} + +const action = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + const { productId } = props; + + const headers = parseHeaders(req.headers); + + const customerAccessToken = await authenticate(req, ctx); + + if (!customerAccessToken) return []; + + const data = await storefront.query< + WishlistRemoveProductMutation, + WishlistRemoveProductMutationVariables + >({ + variables: { customerAccessToken, productId }, + ...WishlistRemoveProduct, + }, { headers }); + + const products = data.wishlistRemoveProduct; + + if (!Array.isArray(products)) { + return null; + } + + return products + .filter((node): node is ProductFragment => Boolean(node)) + .map(({ productId, productName }) => ({ + productId, + productName, + })); +}; + +export default action; diff --git a/wake/handlers/sitemap.ts b/wake/handlers/sitemap.ts new file mode 100644 index 000000000..ff2b07846 --- /dev/null +++ b/wake/handlers/sitemap.ts @@ -0,0 +1,78 @@ +import Proxy, { Header } from "../../website/handlers/proxy.ts"; +import { AppContext } from "../mod.ts"; + +type ConnInfo = Deno.ServeHandlerInfo; +const BASE_SITEMAP_URL = + "https://p-general-sitemap-public.s3.us-east-2.amazonaws.com/Sitemap"; + +const xmlHeader = + ''; + +const includeSiteMaps = ( + currentXML: string, + origin: string, + includes?: string[], +) => { + const siteMapIncludeTags = []; + + for (const include of (includes ?? [])) { + siteMapIncludeTags.push(` + + ${ + include.startsWith("/") ? `${origin}${include}` : include + } + ${new Date().toISOString().substring(0, 10)} + + `); + } + + return siteMapIncludeTags.length > 0 + ? currentXML.replace( + xmlHeader, + `${xmlHeader}\n${siteMapIncludeTags.join("\n")}`, + ) + : currentXML; +}; + +export interface Props { + include?: string[]; + customHeaders: Header[]; +} +/** + * @title Sitemap Proxy + */ +export default function Sitemap( + { include, customHeaders }: Props, + { account }: AppContext, +) { + return async ( + req: Request, + ctx: ConnInfo, + ) => { + if (!account) { + throw new Error("Missing account"); + } + + const publicUrl = `${BASE_SITEMAP_URL}/${account}/`; + + const response = await Proxy({ + url: publicUrl, + customHeaders, + })(req, ctx); + + const reqUrl = new URL(req.url); + const text = await response.text(); + + return new Response( + includeSiteMaps( + text.replaceAll(publicUrl, `${reqUrl.origin}/`), + reqUrl.origin, + include, + ), + { + headers: response.headers, + status: response.status, + }, + ); + }; +} diff --git a/wake/hooks/context.ts b/wake/hooks/context.ts index 79b62c93b..0afc46a4a 100644 --- a/wake/hooks/context.ts +++ b/wake/hooks/context.ts @@ -1,17 +1,31 @@ import { IS_BROWSER } from "$fresh/runtime.ts"; import { signal } from "@preact/signals"; import { invoke } from "../runtime.ts"; -import type { CheckoutFragment } from "../utils/graphql/storefront.graphql.gen.ts"; +import type { + CheckoutFragment, + WishlistReducedProductFragment, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { Person } from "../../commerce/types.ts"; +import { setClientCookie } from "../utils/cart.ts"; +import { ShopQuery } from "../utils/graphql/storefront.graphql.gen.ts"; export interface Context { cart: Partial; + user: Person | null; + wishlist: WishlistReducedProductFragment[] | null; } const loading = signal(true); const context = { cart: signal>({}), + user: signal(null), + wishlist: signal(null), + shop: signal(null), }; +let queue2 = Promise.resolve(); +let abort2 = () => {}; + let queue = Promise.resolve(); let abort = () => {}; const enqueue = ( @@ -24,13 +38,15 @@ const enqueue = ( queue = queue.then(async () => { try { - const { cart } = await cb(controller.signal); + const { cart, user, wishlist } = await cb(controller.signal); if (controller.signal.aborted) { throw { name: "AbortError" }; } context.cart.value = { ...context.cart.value, ...cart }; + context.user.value = user || context.user.value; + context.wishlist.value = wishlist || context.wishlist.value; loading.value = false; } catch (error) { @@ -46,12 +62,73 @@ const enqueue = ( return queue; }; +const enqueue2 = ( + cb: ( + signal: AbortSignal, + ) => + | Promise<{ shop: ShopQuery["shop"] }> + | Partial<{ shop: ShopQuery["shop"] }>, +) => { + abort2(); + + loading.value = true; + const controller = new AbortController(); + + queue2 = queue2.then(async () => { + try { + const { shop } = await cb(controller.signal); + + if (!shop || !shop?.checkoutUrl) { + console.error("Erro on get shop checkoutUrl"); + return; + } + + const isLocalhost = globalThis.location.hostname === "localhost"; + + if (!isLocalhost) { + const url = new URL("/api/carrinho", shop.checkoutUrl); + + const { Id } = await fetch(url, { credentials: "include" }).then((r) => + r.json() + ); + + if (controller.signal.aborted) { + throw { name: "AbortError" }; + } + + setClientCookie(Id); + } + + enqueue(load); + + loading.value = false; + } catch (error) { + if (error.name === "AbortError") return; + + console.error(error); + loading.value = false; + } + }); + + abort2 = () => controller.abort(); + + return queue2; +}; + +const load2 = (signal: AbortSignal) => + invoke({ + shop: invoke.wake.loaders.shop(), + }, { signal }); + const load = (signal: AbortSignal) => invoke({ cart: invoke.wake.loaders.cart(), + user: invoke.wake.loaders.user(), + wishlist: invoke.wake.loaders.wishlist(), }, { signal }); if (IS_BROWSER) { + enqueue2(load2); enqueue(load); document.addEventListener( diff --git a/wake/hooks/useCart.ts b/wake/hooks/useCart.ts index e207aaad9..d5f077a3f 100644 --- a/wake/hooks/useCart.ts +++ b/wake/hooks/useCart.ts @@ -12,18 +12,20 @@ export const itemToAnalyticsItem = ( coupon?: string; }, index: number, -): AnalyticsItem => ({ - item_id: `${item.productId}_${item.productVariantId}`, - item_name: item.name!, - discount: item.price - item.ajustedPrice, - item_variant: item.productVariantId, - // TODO: check - price: item.price, - coupon: item.coupon, - item_brand: item.brand!, - index, - quantity: item.quantity, -}); +): AnalyticsItem => { + return { + item_id: item.productVariantId, + item_group_id: item.productId, + quantity: item.quantity, + coupon: item.coupon, + price: item.price, + index, + discount: item.price - item.ajustedPrice, + item_name: item.name!, + item_variant: item.productVariantId, + item_brand: item.brand ?? "", + }; +}; type EnqueuableActions< K extends keyof Manifest["actions"], @@ -42,9 +44,14 @@ const state = { cart, loading, addItem: enqueue("wake/actions/cart/addItem.ts"), + addKit: enqueue("wake/actions/cart/addKit.ts"), + removeKit: enqueue("wake/actions/cart/removeKit.ts"), + addItems: enqueue("wake/actions/cart/addItems.ts"), updateItem: enqueue("wake/actions/cart/updateItemQuantity.ts"), addCoupon: enqueue("wake/actions/cart/addCoupon.ts"), removeCoupon: enqueue("wake/actions/cart/removeCoupon.ts"), + partnerAssociate: enqueue("wake/actions/cart/partnerAssociate.ts"), + partnerDisassociate: enqueue("wake/actions/cart/partnerDisassociate.ts"), }; export const useCart = () => state; diff --git a/wake/hooks/useUser.ts b/wake/hooks/useUser.ts new file mode 100644 index 000000000..ef405c564 --- /dev/null +++ b/wake/hooks/useUser.ts @@ -0,0 +1,7 @@ +import { state as storeState } from "./context.ts"; + +const { user, loading } = storeState; + +const state = { user, loading }; + +export const useUser = () => state; diff --git a/wake/hooks/useWishlist.ts b/wake/hooks/useWishlist.ts new file mode 100644 index 000000000..460df6379 --- /dev/null +++ b/wake/hooks/useWishlist.ts @@ -0,0 +1,34 @@ +// deno-lint-ignore-file no-explicit-any +import { Product } from "../../commerce/types.ts"; +import { Manifest } from "../manifest.gen.ts"; +import { invoke } from "../runtime.ts"; +import { WishlistReducedProductFragment } from "../utils/graphql/storefront.graphql.gen.ts"; +import { state as storeState } from "./context.ts"; + +const { wishlist, loading } = storeState; + +type EnqueuableActions< + K extends keyof Manifest["actions"], +> = Manifest["actions"][K]["default"] extends + (...args: any[]) => Promise ? K : never; + +const enqueue = < + K extends keyof Manifest["actions"], +>(key: EnqueuableActions) => +(props: Parameters[0]) => + storeState.enqueue((signal) => + invoke({ wishlist: { key, props } } as any, { signal }) as any + ); + +const getItem = (item: Omit) => + wishlist.value?.find((id) => id.productId == item.productId); + +const state = { + wishlist, + loading, + getItem, + addItem: enqueue("wake/actions/wishlist/addProduct.ts"), + removeItem: enqueue("wake/actions/wishlist/removeProduct.ts"), +}; + +export const useWishlist = () => state; diff --git a/wake/loaders/cart.ts b/wake/loaders/cart.ts index 0b31ef8a5..4acf29dc5 100644 --- a/wake/loaders/cart.ts +++ b/wake/loaders/cart.ts @@ -8,6 +8,8 @@ import { GetCartQuery, GetCartQueryVariables, } from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { handleAuthError } from "../utils/authError.ts"; /** * @title VNDA Integration @@ -20,20 +22,39 @@ const loader = async ( ): Promise> => { const { storefront } = ctx; const cartId = getCartCookie(req.headers); + const headers = parseHeaders(req.headers); - const data = cartId - ? await storefront.query({ - variables: { checkoutId: cartId }, - ...GetCart, - }) - : await storefront.query({ - ...CreateCart, - }); + let data: GetCartQuery | CreateCartMutation | undefined; + try { + data = cartId + ? await storefront.query({ + variables: { checkoutId: cartId }, + ...GetCart, + }, { + headers, + }) + : await storefront.query( + { + ...CreateCart, + }, + { + headers, + }, + ); + } catch (error: unknown) { + handleAuthError(error, "load cart"); + } const checkoutId = data.checkout?.checkoutId; - setCartCookie(ctx.response.headers, checkoutId); + + if (cartId !== checkoutId) { + setCartCookie(ctx.response.headers, checkoutId); + } return data.checkout ?? {}; }; export default loader; + +// User-specific cart data; must not be cached/shared. +export const cache = "no-store"; diff --git a/wake/loaders/partners.ts b/wake/loaders/partners.ts new file mode 100644 index 000000000..e4c511e6b --- /dev/null +++ b/wake/loaders/partners.ts @@ -0,0 +1,84 @@ +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { handleAuthError } from "../utils/authError.ts"; +import type { AppContext } from "../mod.ts"; +import { GetPartners } from "../utils/graphql/queries.ts"; +import { + GetPartnersQuery, + GetPartnersQueryVariables, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; + +export interface Props { + slug: RequestURLParam; +} + +/** + * @title Wake Integration - Partners + * @description Partners loader + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + const { slug } = props; + + const headers = parseHeaders(req.headers); + + // Guard against missing slug to prevent querying with [undefined] + if (!slug) { + return undefined; + } + + let data: GetPartnersQuery | undefined; + try { + data = await storefront.query< + GetPartnersQuery, + GetPartnersQueryVariables + >({ + variables: { first: 1, alias: [slug] }, + ...GetPartners, + }, { headers }); + } catch (error: unknown) { + handleAuthError(error, "load partner information"); + } + + return data?.partners ?? undefined; +}; + +export const cache = "stale-while-revalidate"; + +export const cacheKey = (props: Props, req: Request, _ctx: AppContext) => { + // Don't cache if no slug is provided + if (!props.slug) { + return null; + } + + // Don't cache if partner cookie is present - partner-specific content should not be cached + const partnerCookie = getPartnerCookie(req.headers); + if (partnerCookie) { + return null; + } + + // Use the slug for cache uniqueness - each partner has a unique slug + const params = new URLSearchParams([ + ["slug", String(props.slug)], + ["first", "1"], // Always fetch exactly 1 partner + ]); + + const url = new URL(req.url); + url.search = params.toString(); + + // Sort parameters for consistent cache keys + const sortedParams = new URLSearchParams(); + Array.from(params.entries()) + .sort(([a], [b]) => a.localeCompare(b)) + .forEach(([key, value]) => sortedParams.set(key, value)); + + url.search = sortedParams.toString(); + return url.href; +}; + +export default loader; diff --git a/wake/loaders/productDetailsPage.ts b/wake/loaders/productDetailsPage.ts index 58ecc197e..16b3d53c9 100644 --- a/wake/loaders/productDetailsPage.ts +++ b/wake/loaders/productDetailsPage.ts @@ -1,15 +1,23 @@ -import type { ProductDetailsPage } from "../../commerce/types.ts"; +import type { Product, ProductDetailsPage } from "../../commerce/types.ts"; +import { handleAuthError } from "../utils/authError.ts"; import type { RequestURLParam } from "../../website/functions/requestToParam.ts"; import { AppContext } from "../mod.ts"; -import { GetProduct } from "../utils/graphql/queries.ts"; +import { MAXIMUM_REQUEST_QUANTITY } from "../utils/getVariations.ts"; +import { GetBuyList, GetProduct } from "../utils/graphql/queries.ts"; import { + BuyListQuery, + BuyListQueryVariables, GetProductQuery, GetProductQueryVariables, } from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; import { parseSlug, toBreadcrumbList, toProduct } from "../utils/transform.ts"; export interface Props { slug: RequestURLParam; + buyTogether?: boolean; + includeSameParent?: boolean; } /** @@ -22,45 +30,176 @@ async function loader( ctx: AppContext, ): Promise { const url = new URL(req.url); - const { slug } = props; + const { slug, buyTogether, includeSameParent } = props; const { storefront } = ctx; + const partnerAccessToken = getPartnerCookie(req.headers); + + const headers = parseHeaders(req.headers); + if (!slug) return null; - // const variantId = Number(url.searchParams.get("skuId")) || null; + const variantId = Number(url.searchParams.get("skuId")) || null; const { id: productId } = parseSlug(slug); if (!productId) { throw new Error("Missing product id"); } - const { product: wakeProduct } = await storefront.query< - GetProductQuery, - GetProductQueryVariables - >({ - variables: { productId }, - ...GetProduct, - }); + let wakeBuyList: BuyListQuery["buyList"] | undefined; + try { + const buyListResult = await storefront.query< + BuyListQuery, + BuyListQueryVariables + >( + { + variables: { id: productId, partnerAccessToken }, + ...GetBuyList, + }, + { + headers, + }, + ); + wakeBuyList = buyListResult.buyList; + } catch (error: unknown) { + handleAuthError(error, "load buy list"); + } + + const buyListProducts = await Promise.all( + wakeBuyList?.buyListProducts?.map(async (buyListProduct) => { + if (!buyListProduct) return; + + const { productId, includeSameParent, quantity } = buyListProduct; + + const buyListProductPage = await ctx.invoke.wake.loaders + .productDetailsPage({ + // 'slug' its just to fit the parse function of loader + slug: `slug-${productId}`, + includeSameParent, + }); + + if (!buyListProductPage) return; + + buyListProductPage.product.additionalProperty?.push({ + "@type": "PropertyValue", + name: "SuggestedQuantity", + value: String(quantity), + alternateName: "Buy List Suggested Quantity", + }); + + return buyListProductPage.product; + }) ?? [], + ).then((maybeProductList) => + maybeProductList.filter((node): node is Product => Boolean(node)) + ); + + let wakeProduct: GetProductQuery["product"] | undefined; + try { + const productResult = await storefront.query< + GetProductQuery, + GetProductQueryVariables + >( + { + variables: { + productId, + includeParentIdVariants: includeSameParent, + partnerAccessToken, + }, + ...GetProduct, + }, + { + headers, + }, + ); + wakeProduct = productResult.product; + } catch (error: unknown) { + handleAuthError(error, "load product details"); + } + + const wakeProductOrBuyList = wakeProduct || wakeBuyList; - if (!wakeProduct) { + if (!wakeProductOrBuyList) { return null; } - const product = toProduct(wakeProduct, { base: url }); + const variantsItems = (await ctx.invoke.wake.loaders.productList({ + first: MAXIMUM_REQUEST_QUANTITY, + sortDirection: "ASC", + sortKey: "RANDOM", + filters: { productId: [productId] }, + })) ?? []; + + const buyTogetherItens = + buyTogether && !!wakeProductOrBuyList.buyTogether?.length + ? (await ctx.invoke.wake.loaders.productList({ + first: MAXIMUM_REQUEST_QUANTITY, + sortDirection: "ASC", + sortKey: "RANDOM", + filters: { + productId: wakeProductOrBuyList.buyTogether?.map( + (bt) => bt!.productId, + ), + mainVariant: true, + }, + getVariations: true, + })) ?? [] + : []; + const product = toProduct( + wakeProductOrBuyList, + { base: url }, + variantsItems, + variantId, + ); return { "@type": "ProductDetailsPage", - breadcrumbList: toBreadcrumbList(product, wakeProduct.productCategories, { - base: url, - }), - product, + breadcrumbList: toBreadcrumbList( + wakeProductOrBuyList.breadcrumbs ?? [], + { + base: url, + }, + product, + ), + product: { + ...product, + isAccessoryOrSparePartFor: buyListProducts, + isRelatedTo: buyTogetherItens?.map((buyItem) => { + return { + ...buyItem, + additionalType: "BuyTogether", + }; + }) ?? [], + }, seo: { canonical: product.isVariantOf?.url ?? "", - title: wakeProduct.productName ?? "", + title: wakeProductOrBuyList.productName ?? "", description: - wakeProduct.seo?.find((m) => m?.name === "description")?.content ?? "", + wakeProductOrBuyList.seo?.find((m) => m?.name === "description") + ?.content ?? "", }, }; } +export const cache = "stale-while-revalidate"; + +export const cacheKey = (props: Props, req: Request, _ctx: AppContext) => { + const url = new URL(req.url); + const skuId = url.searchParams.get("skuId") ?? ""; + + // Avoid cross-tenant cache bleed when a partner token is present + if (getPartnerCookie(req.headers)) { + return null; + } + + const params = new URLSearchParams([ + ["slug", String(props.slug)], + ["buyTogether", String(props.buyTogether ?? false)], + ["includeSameParent", String(props.includeSameParent ?? false)], + ["skuId", skuId], + ]); + + url.search = params.toString(); + return url.href; +}; + export default loader; diff --git a/wake/loaders/productList.ts b/wake/loaders/productList.ts index 45dce8d3d..db47564e8 100644 --- a/wake/loaders/productList.ts +++ b/wake/loaders/productList.ts @@ -1,17 +1,119 @@ import type { Product } from "../../commerce/types.ts"; import type { AppContext } from "../mod.ts"; +import { getVariations } from "../utils/getVariations.ts"; import { GetProducts } from "../utils/graphql/queries.ts"; import { GetProductsQuery, GetProductsQueryVariables, ProductFragment, } from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; import { toProduct } from "../utils/transform.ts"; +import { handleAuthError } from "../utils/authError.ts"; + +export interface StockFilter { + dcId?: number[]; + /** @description The distribution center names to match. */ + dcName?: string[]; + /** + * @title Stock greater than or equal + * @description The product stock must be greater than or equal to. + */ + stock_gte?: number; + /** + * @title Stock less than or equal + * @description The product stock must be lesser than or equal to. + */ + stock_lte?: number; +} + +export interface PriceFilter { + /** + * @title Discount greater than + * @description The product discount must be greater than or equal to. + */ + discount_gte?: number; + /** + * @title Discount lesser than + * @description The product discount must be lesser than or equal to. + */ + discount_lte?: number; + /** @description Return only products where the listed price is more than the price. */ + discounted?: boolean; + /** + * @title Price greater than + * @description The product price must be greater than or equal to. + */ + price_gte?: number; + /** + * @title Price lesser than + * @description The product price must be lesser than or equal to. */ + price_lte?: number; +} + +export interface Filters { + /** @description The set of attributes to filter. */ + attributes?: { + id?: string[]; + name?: string[]; + type?: string[]; + value?: string[]; + }; + /** @description Choose if you want to retrieve only the available products in stock. */ + available?: boolean; + /** @description The set of brand IDs which the result item brand ID must be included in. */ + brandId?: number[]; + /** @description The set of category IDs which the result item category ID must be included in. */ + categoryId?: number[]; + /** @description The set of EANs which the result item EAN must be included. */ + ean?: string[]; + /** @description Retrieve the product variant only if it contains images. */ + hasImages?: boolean; + /** @description Retrieve the product variant only if it is the main product variant. */ + mainVariant?: boolean; + + /** @description The set of prices to filter. */ + prices?: PriceFilter; + + /** @description The product unique identifier (you may provide a list of IDs if needed). */ + productId?: number[]; + /** @description The product variant unique identifier (you may provide a list of IDs if needed). */ + productVariantId?: number[]; + /** @description A product ID or a list of IDs to search for other products with the same parent ID. */ + sameParentAs?: number[]; + /** @description The set of SKUs which the result item SKU must be included. */ + sku?: string[]; + /** + * @title Stock greater than + * @description Show products with a quantity of available products in stock greater than or equal to the given number. */ + stock_gte?: number; + /** + * @title Stock lesser than + * @description Show products with a quantity of available products in stock less than or equal to the given number. */ + stock_lte?: number; + /** @description The set of stocks to filter. */ + stocks?: StockFilter; + /** + * @title Upated after + * @format date + * @description Retrieve products which the last update date is greater than or equal to the given date. + */ + updatedAt_gte?: string; + /** + * @title Upated before + * @format date + * @description Retrieve products which the last update date is less than or equal to the given date. + */ + updatedAt_lte?: string; +} export interface Props { /** * @title Count * @description Number of products to return + * @maximum 50 + * @default 12 */ first: number; sortDirection: "ASC" | "DESC"; @@ -23,66 +125,11 @@ export interface Props { | "RELEASE_DATE" | "SALES" | "STOCK"; - filters: { - /** @description The set of attributes to filter. */ - attributes?: { - id?: string[]; - name?: string[]; - type?: string[]; - value?: string[]; - }; - /** @description Choose if you want to retrieve only the available products in stock. */ - available?: boolean; - /** @description The set of brand IDs which the result item brand ID must be included in. */ - brandId?: string[]; - /** @description The set of category IDs which the result item category ID must be included in. */ - categoryId?: string[]; - /** @description The set of EANs which the result item EAN must be included. */ - ean?: string[]; - /** @description Retrieve the product variant only if it contains images. */ - hasImages?: boolean; - /** @description Retrieve the product variant only if it is the main product variant. */ - mainVariant?: boolean; - /** @description The set of prices to filter. */ - prices?: { - /** @description The product discount must be greater than or equal to. */ - discount_gte?: number; - /** @description The product discount must be lesser than or equal to. */ - discount_lte?: number; - /** @description Return only products where the listed price is more than the price. */ - discounted?: boolean; - /** @description The product price must be greater than or equal to. */ - price_gte?: number; - /** @description The product price must be lesser than or equal to. */ - price_lte?: number; - }; - /** @description The product unique identifier (you may provide a list of IDs if needed). */ - productId?: number[]; - /** @description The product variant unique identifier (you may provide a list of IDs if needed). */ - productVariantId?: number[]; - /** @description A product ID or a list of IDs to search for other products with the same parent ID. */ - sameParentAs?: number[]; - /** @description The set of SKUs which the result item SKU must be included. */ - sku?: string[]; - /** @description Show products with a quantity of available products in stock greater than or equal to the given number. */ - stock_gte?: number; - /** @description Show products with a quantity of available products in stock less than or equal to the given number. */ - stock_lte?: number; - /** @description The set of stocks to filter. */ - stocks?: { - dcId?: number[]; - /** @description The distribution center names to match. */ - dcName?: string[]; - /** @description The product stock must be greater than or equal to. */ - stock_gte?: number; - /** @description The product stock must be lesser than or equal to. */ - stock_lte?: number; - }; - /** @description Retrieve products which the last update date is greater than or equal to the given date. */ - updatedAt_gte?: string; - /** @description Retrieve products which the last update date is less than or equal to the given date. */ - updatedAt_lte?: string; - }; + + filters: Filters; + + /** @description Retrieve variantions for each product. */ + getVariations?: boolean; } /** @@ -96,24 +143,98 @@ const productListLoader = async ( ): Promise => { const url = new URL(req.url); const { storefront } = ctx; + const partnerAccessToken = getPartnerCookie(req.headers); - const data = await storefront.query< - GetProductsQuery, - GetProductsQueryVariables - >({ - variables: props, - ...GetProducts, - }); + const headers = parseHeaders(req.headers); - const products = data.products?.nodes; + let data: GetProductsQuery | undefined; + try { + data = await storefront.query< + GetProductsQuery, + GetProductsQueryVariables + >({ + variables: { ...props, partnerAccessToken }, + ...GetProducts, + }, { + headers, + }); + } catch (error: unknown) { + handleAuthError(error, "load product list"); + } + + const products = data?.products?.nodes; if (!Array.isArray(products)) { return null; } + const productIDs = products.map((i) => i?.productId); + + const variations = props.getVariations + ? await getVariations(storefront, productIDs, headers, url) + : []; + return products .filter((node): node is ProductFragment => Boolean(node)) - .map((node) => toProduct(node, { base: url })); + .map((node) => { + const productVariations = variations?.filter((v) => + v.inProductGroupWithID === node.productId + ); + + return toProduct(node, { base: url }, productVariations); + }); +}; + +export const cache = "stale-while-revalidate"; + +// Helper function for deterministic filter serialization +function stableStringify(value: unknown): string { + const seen = new WeakSet(); + const replacer = (_k: string, v: unknown) => { + if (v && typeof v === "object") { + if (seen.has(v as object)) return "[Circular]"; + seen.add(v as object); + if (Array.isArray(v)) return v; // keep array order + const obj = v as Record; + return Object.keys(obj).sort().reduce((acc, key) => { + acc[key] = obj[key]; + return acc; + }, {} as Record); + } + return v; + }; + return JSON.stringify(value, replacer); +} + +export const cacheKey = (props: Props, req: Request, _ctx: AppContext) => { + const url = new URL(req.url); + + // Avoid cross-tenant cache bleed when a partner token is present + if (getPartnerCookie(req.headers)) { + return null; + } + + // Don't cache dynamic/random sorts + if (props.sortKey === "RANDOM") { + return null; + } + + const params = new URLSearchParams([ + ["first", String(props.first ?? 12)], + ["sortKey", props.sortKey ?? "NAME"], + ["sortDirection", props.sortDirection ?? "ASC"], + ["getVariations", String(Boolean(props.getVariations ?? false))], + ]); + + // Add filters to cache key with deterministic serialization + if (props.filters) { + const filtersStr = stableStringify(props.filters); + params.append("filters", filtersStr); + } + + params.sort(); + url.search = params.toString(); + return url.href; }; export default productListLoader; diff --git a/wake/loaders/productListingPage.ts b/wake/loaders/productListingPage.ts index 990f59b53..e94246fd3 100644 --- a/wake/loaders/productListingPage.ts +++ b/wake/loaders/productListingPage.ts @@ -1,52 +1,143 @@ +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 { handleAuthError } from "../utils/authError.ts"; +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { safeJsonSerialize } from "../../website/utils/html.ts"; import type { AppContext } from "../mod.ts"; -import { Search } from "../utils/graphql/queries.ts"; import { + getVariations, + MAXIMUM_REQUEST_QUANTITY, +} from "../utils/getVariations.ts"; +import { + GetPartners, + GetURL, + Hotsite, + Search, +} from "../utils/graphql/queries.ts"; +import { + GetPartnersQuery, + GetPartnersQueryVariables, + GetUrlQuery, + GetUrlQueryVariables, + HotsiteQuery, + HotsiteQueryVariables, ProductFragment, ProductSortKeys, SearchQuery, SearchQueryVariables, SortDirection, } from "../utils/graphql/storefront.graphql.gen.ts"; -import { FILTER_PARAM, toFilters, toProduct } from "../utils/transform.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; +import { + FILTER_PARAM, + toBreadcrumbList, + toFilters, + toProduct, +} from "../utils/transform.ts"; +import { Filters } from "./productList.ts"; + +export type Sort = + | "NAME:ASC" + | "NAME:DESC" + | "RELEASE_DATE:DESC" + | "PRICE:ASC" + | "PRICE:DESC" + | "DISCOUNT:DESC" + | "SALES:DESC"; export const SORT_OPTIONS: SortOption[] = [ - { value: "ASC:NAME", label: "Nome A-Z" }, - { value: "DESC:NAME", label: "Nome Z-A" }, - { value: "DESC:RELEASE_DATE", label: "Lançamentos" }, - { value: "ASC:PRICE", label: "Menores Preços" }, - { value: "DESC:PRICE", label: "Maiores Preços" }, - { value: "DESC:DISCOUNT", label: "Maiores Descontos" }, - { value: "DESC:SALES", label: "Mais Vendidos" }, + { value: "NAME:ASC", label: "Nome A-Z" }, + { value: "NAME:DESC", label: "Nome Z-A" }, + { value: "RELEASE_DATE:DESC", label: "Lançamentos" }, + { value: "PRICE:ASC", label: "Menores Preços" }, + { value: "PRICE:DESC", label: "Maiores Preços" }, + { value: "DISCOUNT:DESC", label: "Maiores Descontos" }, + { value: "SALES:DESC", label: "Mais Vendidos" }, ]; -type SortValue = `${SortDirection}:${ProductSortKeys}`; - +type SortValue = `${ProductSortKeys}:${SortDirection}`; export interface Props { /** * @title Count * @description Number of products to display + * @maximum 50 + * @default 12 */ - first?: number; + limit?: number; /** @description Types of operations to perform between query terms */ operation?: "AND" | "OR"; + + /** + * @ignore + */ + page: number; + + /** + * @title Sorting + */ + sort?: Sort; + + /** + * @description overides the query term + */ + query?: string; + + /** + * @title Only Main Variant + * @description Toggle the return of only main variants or all variations separeted. + */ + onlyMainVariant?: boolean; + + filters?: Filters; + + /** @description Retrieve variantions for each product. */ + getVariations?: boolean; + + /** + * @title Starting page query parameter offset. + * @description Set the starting page offset. Default to 1. + */ + pageOffset?: 0 | 1; + + /** + * @hide true + * @description The URL of the page, used to override URL from request + */ + pageHref?: string; + + /** + * @title Partner Param + * @description page param to partners page + * @deprecated + */ + slug?: RequestURLParam; + + /** + * @title Partner Param + * @description page param to partners page + */ + partnerAlias?: RequestURLParam; } -const filtersFromParams = (searchParams: URLSearchParams) => { - const mapped = searchParams.getAll(FILTER_PARAM) - .reduce((acc, value) => { - const [field, val] = value.split(":"); - if (!acc.has(field)) acc.set(field, []); - acc.get(field)?.push(val); - return acc; - }, new Map()); +const OUTSIDE_ATTRIBUTES_FILTERS = ["precoPor"]; +const filtersFromParams = (searchParams: URLSearchParams) => { const filters: Array<{ field: string; values: string[] }> = []; - for (const [field, values] of mapped.entries()) { - filters.push({ field, values }); - } + + searchParams.getAll(FILTER_PARAM).forEach((value) => { + const test = /.*:.*/; + const [field, val] = test.test(value) + ? value.split(":") + : value.split("__"); + + if (!OUTSIDE_ATTRIBUTES_FILTERS.includes(field)) { + filters.push({ field, values: [val] }); + } + }); return filters; }; @@ -61,67 +152,241 @@ const searchLoader = async ( ctx: AppContext, ): Promise => { // get url from params - const url = new URL(req.url); + const url = new URL(req.url).pathname === "/live/invoke" + ? new URL(props.pageHref || req.headers.get("referer") || req.url) + : new URL(props.pageHref || req.url); + const { storefront } = ctx; - const first = props.first ?? 12; - const filters = filtersFromParams(url.searchParams); - const sort = url.searchParams.get("sort") as SortValue | null ?? - "DESC:SALES"; - const page = Number(url.searchParams.get("page")) || 0; - const query = url.searchParams.get("busca"); + const partnerAlias = props.partnerAlias ?? props.slug; + + const partnerAccessTokenCookie = getPartnerCookie(req.headers); + + const headers = parseHeaders(req.headers); + + const limit = Number(url.searchParams.get("tamanho") ?? props.limit ?? 12); + + const filters = filtersFromParams(url.searchParams) ?? props.filters; + const sort = (url.searchParams.get("sort") as SortValue | null) ?? + (url.searchParams.get("ordenacao") as SortValue | null) ?? + props.sort ?? + "SALES:DESC"; + const page = props.page ?? + Number(url.searchParams.get("page")) ?? + Number(url.searchParams.get("pagina")) ?? + 0; + const query = props.query ?? url.searchParams.get("busca"); const operation = props.operation ?? "AND"; - const [sortDirection, sortKey] = sort.split(":") as [ - SortDirection, + + const [sortKey, sortDirection] = sort.split(":") as [ ProductSortKeys, + SortDirection, ]; - const data = await storefront.query({ - variables: { query, operation, first, sortDirection, sortKey, filters }, - ...Search, - }); + const onlyMainVariant = props.onlyMainVariant ?? true; + const [minimumPrice, maximumPrice] = url.searchParams + .getAll("filtro") + ?.find((i) => i.startsWith("precoPor")) + ?.split(":")[1] + ?.split(";") + .map(Number) ?? + url.searchParams.get("precoPor")?.split(";").map(Number) ?? + []; + + const offset = page <= 1 ? 0 : (page - 1) * limit; - const products = data.search?.products?.nodes ?? []; - const pageInfo = data.search?.products?.pageInfo; + const partnerData = partnerAlias + ? await storefront.query( + { + variables: { first: 1, alias: [partnerAlias] }, + ...GetPartners, + }, + { headers }, + ) + : null; + + const partnerAccessToken = + partnerData?.partners?.edges?.[0]?.node?.partnerAccessToken ?? + partnerAccessTokenCookie; + + if (partnerAccessToken) { + try { + await ctx.invoke.wake.actions.cart.partnerAssociate({ + partnerAccessToken, + }); + } catch (e) { + logger.error(e); + } + } + + const urlData = await storefront.query( + { + variables: { + url: url.pathname, + }, + ...GetURL, + }, + { + headers, + }, + ); + + const isHotsite = urlData.uri?.kind === "HOTSITE"; + + const commonParams = { + sortDirection, + sortKey, + filters, + limit: Math.min(limit, MAXIMUM_REQUEST_QUANTITY), + offset, + onlyMainVariant, + minimumPrice, + maximumPrice, + partnerAccessToken, + }; + + if (!query && !isHotsite && !partnerAccessToken) { + console.warn( + "ProductListingPage: No search query, hotsite, or partner token provided - returning null", + ); + return null; + } + + let data: SearchQuery | HotsiteQuery | undefined; + try { + data = isHotsite + ? await storefront.query({ + variables: { + ...commonParams, + url: url.pathname, + }, + ...Hotsite, + }, { headers }) + : await storefront.query({ + variables: { + ...commonParams, + query, + operation, + }, + ...Search, + }, { headers }); + } catch (error: unknown) { + handleAuthError(error, "load products"); + } + + const products = data?.result?.productsByOffset?.items ?? []; const nextPage = new URLSearchParams(url.searchParams); const previousPage = new URLSearchParams(url.searchParams); - if (pageInfo?.hasNextPage) { - nextPage.set("page", (page + 1).toString()); + const hasNextPage = Boolean( + (data?.result?.productsByOffset?.totalCount ?? 0) / limit > + (data?.result?.productsByOffset?.page ?? 0), + ); + + const hasPreviousPage = page > 1; + + const pageOffset = props.pageOffset ?? 0; + + if (hasNextPage) { + nextPage.set("page", (page + pageOffset + 1).toString()); } - if (pageInfo?.hasPreviousPage) { - previousPage.set("page", (page - 1).toString()); + + if (hasPreviousPage) { + previousPage.set("page", (page + pageOffset - 1).toString()); } - const itemListElement: ProductListingPage["breadcrumb"]["itemListElement"] = - data.search?.breadcrumbs?.map((b, i) => ({ - "@type": "ListItem", - position: i + 1, - item: b!.link!, - name: b!.text!, - })) ?? []; + const productIDs = products.map((i) => i?.productId); + + const variations = props.getVariations + ? await getVariations(storefront, productIDs, headers, url) + : []; + + const breadcrumb = toBreadcrumbList(data?.result?.breadcrumbs, { + base: url, + }); + + const title = isHotsite + ? (data as HotsiteQuery)?.result?.seo?.find((i) => i?.type === "TITLE") + ?.content + : capitalize(query || ""); + const description = isHotsite + ? (data as HotsiteQuery)?.result?.seo?.find( + (i) => i?.name === "description", + )?.content + : capitalize(query || ""); + const canonical = new URL( + isHotsite ? `/${(data as HotsiteQuery)?.result?.url}` : url, + url, + ).href; return { "@type": "ProductListingPage", - filters: toFilters(data.search?.aggregations, { base: url }), + filters: toFilters(data?.result?.aggregations, { base: url }), pageInfo: { - nextPage: pageInfo?.hasNextPage ? `?${nextPage}` : undefined, - previousPage: pageInfo?.hasPreviousPage ? `?${previousPage}` : undefined, - currentPage: page, - records: data.search?.products?.totalCount, - recordPerPage: first, + nextPage: hasNextPage ? `?${nextPage}` : undefined, + previousPage: hasPreviousPage ? `?${previousPage}` : undefined, + currentPage: data?.result?.productsByOffset?.page ?? 1, + records: data?.result?.productsByOffset?.totalCount, + recordPerPage: limit, }, sortOptions: SORT_OPTIONS, - breadcrumb: { - "@type": "BreadcrumbList", - itemListElement, - numberOfItems: itemListElement.length, - }, + breadcrumb, + seo: safeJsonSerialize({ + description: description || "", + title: title || "", + canonical, + }), products: products ?.filter((p): p is ProductFragment => Boolean(p)) - .map((variant) => toProduct(variant, { base: url })), + .map((variant) => { + const productVariations = variations?.filter( + (v) => v.inProductGroupWithID === variant.productId, + ); + + return toProduct(variant, { base: url }, productVariations); + }), }; }; +export const cache = "stale-while-revalidate"; + +export const cacheKey = (props: Props, req: Request, _ctx: AppContext) => { + const url = new URL(props.pageHref || req.url); + + // Don't cache search queries to ensure freshness + if ( + url.searchParams.get("q") || url.searchParams.get("query") || + url.searchParams.get("busca") + ) { + return null; + } + + // Avoid cross-tenant cache bleed when a partner token is present + if (getPartnerCookie(req.headers)) { + return null; + } + + const params = new URLSearchParams([ + ["limit", (props.limit || 12).toString()], + ["page", (props.page || 0).toString()], + ["sort", props.sort || ""], + ["pageOffset", (props.pageOffset || 0).toString()], + ]); + + // Add any filter parameters + url.searchParams.forEach((value, key) => { + if ( + key === "filtro" || key === "q" || key === "sort" || + key === "page" + ) { + params.append(key, value); + } + }); + + params.sort(); + url.search = params.toString(); + return url.href; +}; + export default searchLoader; diff --git a/wake/loaders/proxy.ts b/wake/loaders/proxy.ts index 09110258f..ea43fee76 100644 --- a/wake/loaders/proxy.ts +++ b/wake/loaders/proxy.ts @@ -1,35 +1,98 @@ import { Route } from "../../website/flags/audience.ts"; import { AppContext } from "../mod.ts"; +const PATHS_TO_PROXY = [ + ["/checkout", "/checkout"], + ["/Fechamento"], + ["/Fechamento/*"], + ["/Login"], + ["/Login/*"], + ["/login/*"], + ["/Login/Authenticate"], + ["/Carrinho/*"], + ["/api/*"], + ["/MinhaConta"], + ["/MinhaConta/*"], +]; + +const decoSiteMapUrl = "/sitemap/deco.xml"; + +export interface Props { + extraPathsToProxy?: string[]; + /** + * @title If deco site map should be exposed at /deco-sitemap.xml + */ + generateDecoSiteMap?: boolean; + /** + * @title Exclude paths from /deco-sitemap.xml + */ + excludePathsFromDecoSiteMap?: string[]; + /** + * @title Other site maps to include + */ + includeSiteMap?: string[]; +} + /** * @title Wake Proxy Routes */ function loader( - _props: unknown, + props: Props, _req: Request, - { account }: AppContext, + { checkoutUrl }: AppContext, ): Route[] { - const checkout = [ - ["/checkout", "/checkout"], - ["/Fechamento"], - ["/Login"], - ["/login/*"], - ["/api/*"], - ].map(([pathTemplate, basePath]) => ({ + const { + generateDecoSiteMap = true, + excludePathsFromDecoSiteMap = [], + includeSiteMap, + extraPathsToProxy = [], + } = props as Props; + + const extraPathsToProxyAsArray = extraPathsToProxy.map((path) => [path]); + + const checkout = [...PATHS_TO_PROXY, ...extraPathsToProxyAsArray].map(( + [pathTemplate, basePath], + ) => ({ pathTemplate, handler: { value: { __resolveType: "website/handlers/proxy.ts", - url: `https://${account}.checkout.fbits.store`, + url: checkoutUrl, basePath, - customHeaders: { - Host: "erploja2.checkout.fbits.store", - }, + customHeaders: [{ + Host: checkoutUrl, + }], }, }, })); - return checkout; + const [include, routes] = generateDecoSiteMap + ? [[...(includeSiteMap ?? []), decoSiteMapUrl], [{ + pathTemplate: decoSiteMapUrl, + handler: { + value: { + excludePaths: excludePathsFromDecoSiteMap, + __resolveType: "website/handlers/sitemap.ts", + }, + }, + }]] + : [includeSiteMap, []]; + + // TODO: include is not working, because wake return all urls directly at /Sitemap.xml + const sitemap = { + pathTemplate: "/Sitemap.xml", + handler: { + value: { + __resolveType: "wake/handlers/sitemap.ts", + include, + customHeaders: [{ + Host: checkoutUrl, + }], + }, + }, + }; + + return [...routes, ...checkout, sitemap]; } export default loader; diff --git a/wake/loaders/recommendations.ts b/wake/loaders/recommendations.ts new file mode 100644 index 000000000..511aa123d --- /dev/null +++ b/wake/loaders/recommendations.ts @@ -0,0 +1,102 @@ +import type { Product } from "../../commerce/types.ts"; +import { handleAuthError } from "../utils/authError.ts"; +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import type { AppContext } from "../mod.ts"; +import { ProductRecommendations } from "../utils/graphql/queries.ts"; +import { + ProductFragment, + ProductRecommendationsQuery, + ProductRecommendationsQueryVariables, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseSlug, toProduct } from "../utils/transform.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getVariations } from "../utils/getVariations.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; + +export interface Props { + /** + * @default DEFAULT + * @description Algorithm type + */ + algorithm: "DEFAULT" | "DEFAULT"; + quantity: number; + slug: RequestURLParam; + /** @description Retrieve variantions for each product. */ + getVariations?: boolean; +} + +/** + * @title Wake Integration - Product Recommendations + * @description Product Recommendations loader + */ +const productRecommendationsLoader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const url = new URL(req.url); + const { storefront } = ctx; + const { slug, quantity, algorithm = "DEFAULT" } = props; + const partnerAccessToken = getPartnerCookie(req.headers); + + const headers = parseHeaders(req.headers); + + const { id: productId } = parseSlug(slug); + + let data: ProductRecommendationsQuery | undefined; + try { + data = await storefront.query< + ProductRecommendationsQuery, + ProductRecommendationsQueryVariables + >({ + variables: { quantity, productId, algorithm, partnerAccessToken }, + ...ProductRecommendations, + }, { headers }); + } catch (error: unknown) { + handleAuthError(error, "load product recommendations"); + } + + const products = data?.productRecommendations; + + if (!Array.isArray(products)) { + return null; + } + + const productIDs = products.map((i) => i?.productId); + + const variations = props.getVariations + ? await getVariations(storefront, productIDs, headers, url) + : []; + + return products + ?.filter((p): p is ProductFragment => Boolean(p)) + .map((variant) => { + const productVariations = variations?.filter((v) => + v.inProductGroupWithID === variant.productId + ); + + return toProduct(variant, { base: url }, productVariations); + }); +}; + +export const cache = "stale-while-revalidate"; + +export const cacheKey = (props: Props, req: Request, _ctx: AppContext) => { + // Avoid cross-tenant cache bleed when a partner token is present + if (getPartnerCookie(req.headers)) { + return null; + } + + const params = new URLSearchParams([ + ["slug", String(props.slug)], + ["quantity", String(props.quantity)], + ["algorithm", props.algorithm], + ["getVariations", String(props.getVariations ?? false)], + ]); + + const url = new URL(req.url); + url.search = params.toString(); + return url.href; +}; + +export default productRecommendationsLoader; diff --git a/wake/loaders/shop.ts b/wake/loaders/shop.ts new file mode 100644 index 000000000..814d64234 --- /dev/null +++ b/wake/loaders/shop.ts @@ -0,0 +1,51 @@ +import type { AppContext } from "../mod.ts"; +import { handleAuthError } from "../utils/authError.ts"; +import { Shop } from "../utils/graphql/queries.ts"; +import { + ShopQuery, + ShopQueryVariables, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; + +/** + * @title Wake Integration - Shop Infos + * @description Shop Infos loader + */ +const shopInfos = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + let data: ShopQuery | undefined; + try { + data = await storefront.query< + ShopQuery, + ShopQueryVariables + >({ + ...Shop, + }, { headers }); + } catch (error: unknown) { + handleAuthError(error, "load shop information"); + } + + return data?.shop ?? undefined; +}; + +export const cache = "stale-while-revalidate"; + +export const cacheKey = (_props: unknown, req: Request): string | null => { + // Avoid cross-tenant cache bleed when a partner token is present + if (getPartnerCookie(req.headers)) { + return null; + } + + // Shop information is generally static, so we can use the URL as the cache key + return req.url; +}; + +export default shopInfos; diff --git a/wake/loaders/suggestion.ts b/wake/loaders/suggestion.ts new file mode 100644 index 000000000..c0c9be9ec --- /dev/null +++ b/wake/loaders/suggestion.ts @@ -0,0 +1,85 @@ +import { Suggestion } from "../../commerce/types.ts"; +import { handleAuthError } from "../utils/authError.ts"; +import { AppContext } from "../mod.ts"; +import { Autocomplete } from "../utils/graphql/queries.ts"; +import { + AutocompleteQuery, + AutocompleteQueryVariables, + ProductFragment, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { getPartnerCookie } from "../utils/partner.ts"; +import { toProduct } from "../utils/transform.ts"; + +export interface Props { + query: string; + limit?: number; +} + +/** + * @title Wake Integration + * @description Product Suggestion loader + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + const { query, limit = 10 } = props; + + const partnerAccessToken = getPartnerCookie(req.headers); + const headers = parseHeaders(req.headers); + + if (!query) return null; + + let data: AutocompleteQuery | undefined; + try { + data = await storefront.query< + AutocompleteQuery, + AutocompleteQueryVariables + >({ + variables: { query, limit, partnerAccessToken }, + ...Autocomplete, + }, { + headers, + }); + } catch (error: unknown) { + handleAuthError(error, "load product suggestions"); + } + + const { products: wakeProducts, suggestions = [] } = data?.autocomplete ?? {}; + + if (!wakeProducts?.length && !suggestions?.length) return null; + + const products = wakeProducts?.filter((node): node is ProductFragment => + Boolean(node) + ).map((node) => toProduct(node, { base: req.url })); + + return { + products: products, + searches: suggestions?.filter(Boolean)?.map((suggestion) => ({ + term: suggestion!, + })), + }; +}; + +export const cache = "no-cache"; + +export const cacheKey = (props: Props, req: Request): string | null => { + // Avoid cross-tenant cache bleed when a partner token is present + if (getPartnerCookie(req.headers)) { + return null; + } + + const params = new URLSearchParams([ + ["query", props.query], + ["limit", String(props.limit ?? 10)], + ]); + + const url = new URL(req.url); + url.search = params.toString(); + return url.href; +}; + +export default loader; diff --git a/wake/loaders/user.ts b/wake/loaders/user.ts new file mode 100644 index 000000000..42c42116e --- /dev/null +++ b/wake/loaders/user.ts @@ -0,0 +1,63 @@ +import { Person } from "../../commerce/types.ts"; +import type { AppContext } from "../mod.ts"; +import authenticate from "../utils/authenticate.ts"; +import { GetUser } from "../utils/graphql/queries.ts"; +import { + GetUserQuery, + GetUserQueryVariables, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { handleAuthError } from "../utils/authError.ts"; + +/** + * @title Wake Integration + * @description User loader + */ +const userLoader = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + const customerAccessToken = await authenticate(req, ctx); + + if (!customerAccessToken) return null; + + let data: GetUserQuery | undefined; + try { + data = await storefront.query< + GetUserQuery, + GetUserQueryVariables + >({ + variables: { customerAccessToken }, + ...GetUser, + }, { + headers, + }); + } catch (error: unknown) { + handleAuthError(error, "load user data"); + } + + const customer = data?.customer; + + if (!customer) return null; + + return { + "@id": String(customer.id ?? customer.customerId), + email: customer.email ?? undefined, + givenName: customer.customerName ?? undefined, + gender: customer.gender === "Masculino" + ? "https://schema.org/Male" + : customer.gender === "Feminino" + ? "https://schema.org/Female" + : undefined, + }; +}; + +export default userLoader; + +// User-specific response; must not be cached/shared. +export const cache = "no-store"; diff --git a/wake/loaders/wishlist.ts b/wake/loaders/wishlist.ts new file mode 100644 index 000000000..85e81734f --- /dev/null +++ b/wake/loaders/wishlist.ts @@ -0,0 +1,52 @@ +import { AppContext } from "../mod.ts"; +import authenticate from "../utils/authenticate.ts"; +import { GetWishlist } from "../utils/graphql/queries.ts"; +import { + GetWishlistQuery, + GetWishlistQueryVariables, + WishlistReducedProductFragment, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import { parseHeaders } from "../utils/parseHeaders.ts"; +import { handleAuthError } from "../utils/authError.ts"; + +/** + * @title Wake Integration + * @description Product Wishlist loader + */ +const loader = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise => { + const { storefront } = ctx; + + const headers = parseHeaders(req.headers); + + const customerAccessToken = await authenticate(req, ctx); + + if (!customerAccessToken) return []; + + let data: GetWishlistQuery | undefined; + try { + data = await storefront.query< + GetWishlistQuery, + GetWishlistQueryVariables + >({ + variables: { customerAccessToken }, + ...GetWishlist, + }, { + headers, + }); + } catch (error: unknown) { + handleAuthError(error, "load wishlist"); + } + + return data?.customer?.wishlist?.products?.filter(( + p, + ): p is WishlistReducedProductFragment => Boolean(p)) ?? []; +}; + +export default loader; + +// User-specific wishlist data; must not be cached/shared. +export const cache = "no-store"; diff --git a/wake/logo.png b/wake/logo.png new file mode 100644 index 000000000..8c58e0a61 Binary files /dev/null and b/wake/logo.png differ diff --git a/wake/manifest.gen.ts b/wake/manifest.gen.ts index 6894a7e83..70b56ddad 100644 --- a/wake/manifest.gen.ts +++ b/wake/manifest.gen.ts @@ -2,29 +2,69 @@ // This file SHOULD be checked into source version control. // This file is automatically updated during development when running `dev.ts`. -import * as $$$0 from "./loaders/productList.ts"; -import * as $$$1 from "./loaders/productDetailsPage.ts"; -import * as $$$2 from "./loaders/productListingPage.ts"; -import * as $$$3 from "./loaders/proxy.ts"; -import * as $$$4 from "./loaders/cart.ts"; import * as $$$$$$$$$0 from "./actions/cart/addCoupon.ts"; import * as $$$$$$$$$1 from "./actions/cart/addItem.ts"; -import * as $$$$$$$$$2 from "./actions/cart/updateItemQuantity.ts"; -import * as $$$$$$$$$3 from "./actions/cart/removeCoupon.ts"; +import * as $$$$$$$$$2 from "./actions/cart/addItems.ts"; +import * as $$$$$$$$$3 from "./actions/cart/addKit.ts"; +import * as $$$$$$$$$4 from "./actions/cart/partnerAssociate.ts"; +import * as $$$$$$$$$5 from "./actions/cart/partnerDisassociate.ts"; +import * as $$$$$$$$$6 from "./actions/cart/removeCoupon.ts"; +import * as $$$$$$$$$7 from "./actions/cart/removeKit.ts"; +import * as $$$$$$$$$8 from "./actions/cart/updateItemQuantity.ts"; +import * as $$$$$$$$$9 from "./actions/newsletter/register.ts"; +import * as $$$$$$$$$10 from "./actions/notifyme.ts"; +import * as $$$$$$$$$11 from "./actions/review/create.ts"; +import * as $$$$$$$$$12 from "./actions/shippingSimulation.ts"; +import * as $$$$$$$$$13 from "./actions/submmitForm.ts"; +import * as $$$$$$$$$14 from "./actions/wishlist/addProduct.ts"; +import * as $$$$$$$$$15 from "./actions/wishlist/removeProduct.ts"; +import * as $$$$0 from "./handlers/sitemap.ts"; +import * as $$$0 from "./loaders/cart.ts"; +import * as $$$1 from "./loaders/partners.ts"; +import * as $$$2 from "./loaders/productDetailsPage.ts"; +import * as $$$3 from "./loaders/productList.ts"; +import * as $$$4 from "./loaders/productListingPage.ts"; +import * as $$$5 from "./loaders/proxy.ts"; +import * as $$$6 from "./loaders/recommendations.ts"; +import * as $$$7 from "./loaders/shop.ts"; +import * as $$$8 from "./loaders/suggestion.ts"; +import * as $$$9 from "./loaders/user.ts"; +import * as $$$10 from "./loaders/wishlist.ts"; const manifest = { "loaders": { - "wake/loaders/cart.ts": $$$4, - "wake/loaders/productDetailsPage.ts": $$$1, - "wake/loaders/productList.ts": $$$0, - "wake/loaders/productListingPage.ts": $$$2, - "wake/loaders/proxy.ts": $$$3, + "wake/loaders/cart.ts": $$$0, + "wake/loaders/partners.ts": $$$1, + "wake/loaders/productDetailsPage.ts": $$$2, + "wake/loaders/productList.ts": $$$3, + "wake/loaders/productListingPage.ts": $$$4, + "wake/loaders/proxy.ts": $$$5, + "wake/loaders/recommendations.ts": $$$6, + "wake/loaders/shop.ts": $$$7, + "wake/loaders/suggestion.ts": $$$8, + "wake/loaders/user.ts": $$$9, + "wake/loaders/wishlist.ts": $$$10, + }, + "handlers": { + "wake/handlers/sitemap.ts": $$$$0, }, "actions": { "wake/actions/cart/addCoupon.ts": $$$$$$$$$0, "wake/actions/cart/addItem.ts": $$$$$$$$$1, - "wake/actions/cart/removeCoupon.ts": $$$$$$$$$3, - "wake/actions/cart/updateItemQuantity.ts": $$$$$$$$$2, + "wake/actions/cart/addItems.ts": $$$$$$$$$2, + "wake/actions/cart/addKit.ts": $$$$$$$$$3, + "wake/actions/cart/partnerAssociate.ts": $$$$$$$$$4, + "wake/actions/cart/partnerDisassociate.ts": $$$$$$$$$5, + "wake/actions/cart/removeCoupon.ts": $$$$$$$$$6, + "wake/actions/cart/removeKit.ts": $$$$$$$$$7, + "wake/actions/cart/updateItemQuantity.ts": $$$$$$$$$8, + "wake/actions/newsletter/register.ts": $$$$$$$$$9, + "wake/actions/notifyme.ts": $$$$$$$$$10, + "wake/actions/review/create.ts": $$$$$$$$$11, + "wake/actions/shippingSimulation.ts": $$$$$$$$$12, + "wake/actions/submmitForm.ts": $$$$$$$$$13, + "wake/actions/wishlist/addProduct.ts": $$$$$$$$$14, + "wake/actions/wishlist/removeProduct.ts": $$$$$$$$$15, }, "name": "wake", "baseUrl": import.meta.url, diff --git a/wake/mod.ts b/wake/mod.ts index e9d124a7c..bcf1e3a2e 100644 --- a/wake/mod.ts +++ b/wake/mod.ts @@ -1,11 +1,18 @@ -import type { App, FnContext } from "deco/mod.ts"; +import { Markdown } from "../decohub/components/Markdown.tsx"; +import { fetchSafe } from "../utils/fetch.ts"; +import { createGraphqlClient } from "../utils/graphql.ts"; import { createHttpClient } from "../utils/http.ts"; +import { PreviewContainer } from "../utils/preview.tsx"; +import type { Secret } from "../website/loaders/secret.ts"; import manifest, { Manifest } from "./manifest.gen.ts"; +import { CheckoutApi } from "./utils/client.ts"; import { OpenAPI } from "./utils/openapi/wake.openapi.gen.ts"; -import { fetchSafe } from "../utils/fetch.ts"; -import { createGraphqlClient } from "../utils/graphql.ts"; - +import { type App, context, type FnContext } from "@deco/deco"; export type AppContext = FnContext; +export let state: null | State = null; + +// Track app initialization calls to skip logging on first call (manifest generation) +let appCallCount = 0; /** @title Wake */ export interface Props { @@ -14,52 +21,129 @@ export interface Props { * @description erploja2 etc */ account: string; - + /** + * @title Checkout Url + * @description https://checkout.erploja2.com.br + */ + checkoutUrl: string; /** * @title Wake Storefront Token * @description https://wakecommerce.readme.io/docs/storefront-api-criacao-e-autenticacao-do-token */ - storefrontToken: string; - + storefrontToken: Secret; /** * @title Wake API token * @description The token for accessing wake commerce - * @default deco */ - token?: string; - + token?: Secret; /** * @description Use Wake as backend platform + * @hide true */ platform: "wake"; } - export interface State extends Props { api: ReturnType>; + checkoutApi: ReturnType>; storefront: ReturnType; } - export const color = 0xB600EE; - /** * @title Wake + * @description Loaders, actions and workflows for adding Wake Commerce Platform to your website. + * @category Ecommmerce + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png */ export default function App(props: Props): App { - const { token, storefrontToken } = props; + const { token, storefrontToken, account, checkoutUrl } = props; + + // Increment call counter + appCallCount++; + + // Check if we're in development mode using Deco's context + const isDev = !context.isDeploy; + + // Resolve token values first + const stringToken = typeof token === "string" ? token : token?.get?.() ?? ""; + const stringStorefrontToken = typeof storefrontToken === "string" + ? storefrontToken + : storefrontToken?.get?.() ?? ""; + + // Only log on the second call and beyond (skip first call during manifest generation) + if (appCallCount > 1) { + if (!stringToken || !stringStorefrontToken) { + const message = + "Missing Wake API tokens. Add them in the Wake app config in deco.cx admin. Some functionalities may not work."; + console.warn(message); + + if (isDev) { + console.error(` +🚨 Wake API Configuration Missing 🚨 + +You are running in development mode without Wake API tokens configured. + +To fix this: +1. Create a .env file in your project root +2. Add the following environment variables: + - WAKE_TOKEN=your_storefront_token_here + - WAKE_KEY=your_api_token_here + +For production: +1. Go to deco.cx admin +2. Find the Wake app in your site configuration +3. Set up secrets for Storefront Token and API Token + +Without these tokens, product loading and e-commerce features will fail with authentication errors. + +For help: https://wakecommerce.readme.io/docs/storefront-api-criacao-e-autenticacao-do-token + `); + } + } else if (isDev) { + console.info("✅ Wake API tokens configured successfully"); + } + } const api = createHttpClient({ base: "https://api.fbits.net", - headers: new Headers({ "Authorization": `Basic ${token}` }), + headers: new Headers({ "Authorization": `Basic ${stringToken}` }), fetcher: fetchSafe, }); - + //22e714b360b7ef187fe4bdb93385dd0a85686e2a const storefront = createGraphqlClient({ endpoint: "https://storefront-api.fbits.net/graphql", - headers: new Headers({ "TCS-Access-Token": storefrontToken }), + headers: new Headers({ "TCS-Access-Token": `${stringStorefrontToken}` }), fetcher: fetchSafe, }); - + const checkoutApi = createHttpClient({ + base: checkoutUrl ?? `https://${account}.checkout.fbits.store`, + fetcher: fetchSafe, + }); + state = { ...props, api, storefront, checkoutApi }; return { - state: { ...props, api, storefront }, + state, manifest, }; } +export const preview = async () => { + const markdownContent = await Markdown( + new URL("./README.md", import.meta.url).href, + ); + return { + Component: PreviewContainer, + props: { + name: "Wake", + owner: "deco.cx", + description: + "Loaders, actions and workflows for adding Wake Commerce Platform to your website.", + logo: "https://raw.githubusercontent.com/deco-cx/apps/main/wake/logo.png", + images: [ + "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/starting/6ffea061-09f2-4063-a1f0-8ad2a37a148d/Screenshot-2024-09-05-at-12.57.10.png", + ], + tabs: [ + { + title: "About", + content: markdownContent(), + }, + ], + }, + }; +}; diff --git a/wake/runtime.ts b/wake/runtime.ts index 41d65a98d..da42a2435 100644 --- a/wake/runtime.ts +++ b/wake/runtime.ts @@ -1,4 +1,3 @@ -import { proxy } from "deco/clients/withManifest.ts"; import { Manifest } from "./manifest.gen.ts"; - +import { proxy } from "@deco/deco/web"; export const invoke = proxy(); diff --git a/wake/utils/authError.ts b/wake/utils/authError.ts new file mode 100644 index 000000000..1be685a04 --- /dev/null +++ b/wake/utils/authError.ts @@ -0,0 +1,100 @@ +import { context as decoContext } from "@deco/deco"; + +/** + * Checks if an error is an authentication error and throws a user-friendly error + * with development guidance if in development mode. + */ +export function handleAuthError( + error: unknown, + operationContext: string = "operation", +): never { + const errorObj = error as { + message?: string; + extensions?: { code?: string }; + }; + + if ( + errorObj?.message?.includes("AUTH_NOT_AUTHENTICATED") || + errorObj?.extensions?.code === "AUTH_NOT_AUTHENTICATED" || + errorObj?.message?.includes("unauthorized") + ) { + const isDev = !decoContext.isDeploy; + if (isDev) { + console.error(` +🔐 Wake API Authentication Error 🔐 + +Failed to ${operationContext} due to missing or invalid Wake API tokens. + +This error occurs when: +- Wake Storefront Token is missing or invalid +- Wake API Token is missing or invalid +- Tokens are configured but expired + +To fix (Development): +1. Create a .env file in your project root +2. Add these environment variables: + WAKE_TOKEN=your_storefront_token_here + WAKE_KEY=your_api_token_here + +To fix (Production): +1. Go to deco.cx admin +2. Find the Wake app configuration +3. Set up secrets for Storefront Token and API Token + +For help: https://wakecommerce.readme.io/docs/storefront-api-criacao-e-autenticacao-do-token + `); + } + + // Throw a more user-friendly error for the frontend + const authError = new Error( + `Authentication failed (while trying to ${operationContext}) — Wake API tokens are missing or invalid`, + ); + authError.cause = error; + throw authError; + } + + // Re-throw if not an auth error + throw error; +} + +/** + * Checks if an error is an authentication error without throwing + */ +export function isAuthError(error: unknown): boolean { + const errorObj = error as { + message?: string; + extensions?: { code?: string }; + status?: number; + response?: { status?: number }; + errors?: Array<{ message?: string; extensions?: { code?: string } }>; + }; + + // Normalize text for case-insensitive comparison + const msg = (errorObj?.message ?? "").toLowerCase(); + const code = (errorObj?.extensions?.code ?? "").toUpperCase(); + + // Check HTTP status codes + const httpStatus = errorObj?.status ?? errorObj?.response?.status; + + // Check for aggregate errors (multiple errors in an array) + const isAggregate = Array.isArray(errorObj?.errors) && + errorObj.errors.some((e) => + String(e?.message ?? "").toLowerCase().includes("unauthorized") || + String(e?.extensions?.code ?? "").toUpperCase() === "UNAUTHENTICATED" || + String(e?.extensions?.code ?? "").toUpperCase() === + "AUTH_NOT_AUTHENTICATED" || + String(e?.extensions?.code ?? "").toUpperCase() === "FORBIDDEN" + ); + + return !!( + msg.includes("auth_not_authenticated") || + msg.includes("unauthorized") || + msg.includes("forbidden") || + code === "AUTH_NOT_AUTHENTICATED" || + code === "UNAUTHENTICATED" || + code === "FORBIDDEN" || + httpStatus === 401 || + httpStatus === 403 || + isAggregate + ); +} diff --git a/wake/utils/authenticate.ts b/wake/utils/authenticate.ts new file mode 100644 index 000000000..f5d3a9d08 --- /dev/null +++ b/wake/utils/authenticate.ts @@ -0,0 +1,25 @@ +import type { AppContext } from "../mod.ts"; +import { getUserCookie } from "../utils/user.ts"; + +const authenticate = async ( + req: Request, + ctx: AppContext, +): Promise => { + const { checkoutApi } = ctx; + + const loginCookie = getUserCookie(req.headers); + + if (!loginCookie) return null; + + const data = await checkoutApi + ["GET /api/Login/Get"]( + {}, + { headers: req.headers }, + ).then((r) => r.json()); + + if (!data?.CustomerAccessToken) return null; + + return data?.CustomerAccessToken; +}; + +export default authenticate; diff --git a/wake/utils/cart.ts b/wake/utils/cart.ts index 1a3985c2e..812220e9b 100644 --- a/wake/utils/cart.ts +++ b/wake/utils/cart.ts @@ -2,7 +2,7 @@ import { getCookies, setCookie } from "std/http/cookie.ts"; const CART_COOKIE = "carrinho-id"; -const ONE_WEEK_MS = 7 * 24 * 3600 * 1_000; +const TEN_DAYS_MS = 10 * 24 * 3600 * 1_000; export const getCartCookie = (headers: Headers): string | undefined => { const cookies = getCookies(headers); @@ -15,8 +15,14 @@ export const setCartCookie = (headers: Headers, cartId: string) => name: CART_COOKIE, value: cartId, path: "/", - expires: new Date(Date.now() + ONE_WEEK_MS), - httpOnly: true, - secure: true, - sameSite: "Lax", + expires: new Date(Date.now() + TEN_DAYS_MS), }); + +export const setClientCookie = (value: string) => { + let expires = ""; + + const date = new Date(Date.now() + TEN_DAYS_MS); + expires = "; expires=" + date.toUTCString(); + + document.cookie = CART_COOKIE + "=" + (value || "") + expires + "; path=/"; +}; diff --git a/wake/utils/client.ts b/wake/utils/client.ts new file mode 100644 index 000000000..72ccc033d --- /dev/null +++ b/wake/utils/client.ts @@ -0,0 +1,16 @@ +type UserAuthenticate = { + Cpf: string; + CustomerAccessToken: string; + Email: string; + HasFirstPurchase: boolean; + Id: string; + Name: string; + PhoneNumber: string; + Type: number; +}; + +export interface CheckoutApi { + "GET /api/Login/Get": { + response: UserAuthenticate; + }; +} diff --git a/wake/utils/getVariations.ts b/wake/utils/getVariations.ts new file mode 100644 index 000000000..7c228c9ba --- /dev/null +++ b/wake/utils/getVariations.ts @@ -0,0 +1,53 @@ +import { GetProducts } from "../utils/graphql/queries.ts"; +import { + GetProductsQuery, + GetProductsQueryVariables, + ProductFragment, +} from "../utils/graphql/storefront.graphql.gen.ts"; +import type { AppContext } from "../mod.ts"; +import { toProduct } from "./transform.ts"; + +export const MAXIMUM_REQUEST_QUANTITY = 50; + +export const getVariations = async ( + storefront: AppContext["storefront"], + productIds: number[], + headers: Headers, + base: URL, +) => { + const variations: ProductFragment[] = []; + + const fetchData = async (cursor?: string) => { + const data = await storefront.query< + GetProductsQuery, + GetProductsQueryVariables + >({ + variables: { + first: MAXIMUM_REQUEST_QUANTITY, + filters: { productId: productIds }, + sortDirection: "ASC", + sortKey: "RANDOM", + after: cursor, + }, + ...GetProducts, + }, { + headers, + }); + + if (data.products?.nodes?.length) { + variations.push( + ...data.products.nodes.filter((v): v is ProductFragment => Boolean(v)), + ); + } + + if ( + data.products?.pageInfo.hasNextPage && data.products.pageInfo.endCursor + ) { + await fetchData(data.products.pageInfo.endCursor); + } + }; + + await fetchData(); + + return variations.map((i) => toProduct(i, { base })); +}; diff --git a/wake/utils/graphql/queries.ts b/wake/utils/graphql/queries.ts index fb5eec84d..bc36961c7 100644 --- a/wake/utils/graphql/queries.ts +++ b/wake/utils/graphql/queries.ts @@ -2,25 +2,281 @@ import { gql } from "../../../utils/graphql.ts"; const Checkout = gql` fragment Checkout on Checkout { - checkoutId - shippingFee - subtotal - total - completed - coupon - products { - imageUrl - brand - ajustedPrice - listPrice - price - name - productId - productVariantId - quantity - sku - url + checkoutId + shippingFee + subtotal + total + completed + coupon + customer { + customerId } + products { + imageUrl + brand + ajustedPrice + listPrice + totalListPrice + totalAdjustedPrice + seller { + sellerName + distributionCenterId + } + productAttributes { + name + type + value + } + adjustments { + observation + type + value + } + price + name + productId + productVariantId + quantity + sku + url + category + kit + gift + subscription { + availableSubscriptions { + name + recurringDays + recurringTypeId + selected + subscriptionGroupDiscount + subscriptionGroupId + } + selected { + selected + name + recurringDays + recurringTypeId + subscriptionGroupDiscount + subscriptionGroupId + } + } + customization { + availableCustomizations { + cost + customizationId + groupName + id + maxLength + name + order + type + values + } + id + values { + cost + name + value + } + } + attributeSelections { + selectedVariant { + id + alias + available + images { + fileName + url + } + prices { + listPrice + price + discountPercentage + installmentPlans { + displayName + name + installments { + discount + fees + number + value + } + } + bestInstallment { + name + displayName + discount + fees + number + value + } + wholesalePrices { + price + quantity + } + } + productId + productVariantId + stock + } + selections { + attributeId + displayType + name + varyByParent + values { + alias + available + printUrl + selected + value + } + } + } + } + selectedAddress { + addressNumber + cep + city + complement + id + neighborhood + referencePoint + state + street + } + selectedShipping { + deadline + deadlineInHours + deliverySchedule { + date + endDateTime + endTime + startDateTime + startTime + } + name + shippingQuoteId + type + value + } + selectedPaymentMethod { + html + id + installments { + adjustment + number + total + value + } + paymentMethodId + scripts + selectedInstallment { + adjustment + number + total + value + } + suggestedCards { + brand + key + name + number + } + } + orders { + adjustments { + name + type + value + } + date + delivery { + address { + address + cep + city + complement + isPickupStore + name + neighborhood + pickupStoreText + } + cost + deliveryTime + deliveryTimeInHours + name + } + discountValue + dispatchTimeText + interestValue + orderId + orderStatus + payment { + card { + brand + cardInterest + installments + name + number + } + invoice { + digitableLine + paymentLink + } + name + pix { + qrCode + qrCodeExpirationDate + qrCodeUrl + } + } + products { + adjustments { + additionalInformation + name + type + value + } + attributes { + name + value + } + imageUrl + name + productVariantId + quantity + unitValue + value + } + shippingValue + totalValue + + } + kits { + kitId + kitGroupId + alias + imageUrl + listPrice + price + totalListPrice + totalAdjustedPrice + name + quantity + products { + productId + productVariantId + imageUrl + name + url + quantity + productAttributes { + name + value + } + } + } } `; @@ -31,10 +287,13 @@ fragment Product on Product { productId alias attributes { + id + type value name } productCategories { + id name url hierarchy @@ -103,23 +362,142 @@ fragment Product on Product { seller { name } + parentId sku + numberOfVotes stock variantName + variantStock + collection + urlVideo + similarProducts { + alias + image + imageUrl + name + } + promotions { + content + disclosureType + id + fullStampUrl + stamp + title + } + # parallelOptions } `; -const SingleProduct = gql` -fragment SingleProduct on SingleProduct { - mainVariant +const ProductVariant = gql` +fragment ProductVariant on ProductVariant { + + aggregatedStock + alias + available + attributes { + attributeId + displayType + id + name + type + value + } + ean + id + images { + fileName + mini + order + print + url + } + productId + productVariantId + productVariantName + sku + stock + prices { + discountPercentage + discounted + installmentPlans { + displayName + name + installments { + discount + fees + number + value + } + } + listPrice + multiplicationFactor + price + priceTables { + discountPercentage + id + listPrice + price + } + wholesalePrices { + price + quantity + } + bestInstallment { + discount + displayName + fees + name + number + value + } + } + offers { + name + prices { + installmentPlans { + displayName + installments { + discount + fees + number + value + } + } + listPrice + price + } + productVariantId + } + promotions { + content + disclosureType + id + fullStampUrl + stamp + title + } +}`; + +const BuyList = gql` +fragment BuyList on BuyList { + + mainVariant productName productId alias + collection + kit attributes { - value name + type + value + attributeId + displayType + id } + numberOfVotes productCategories { + id name url hierarchy @@ -189,6 +567,21 @@ fragment SingleProduct on SingleProduct { alias } productVariantId + seller { + name + } + seo { + name + scheme + type + httpEquiv + content + } + sku + stock + variantName + parallelOptions + urlVideo reviews { rating review @@ -196,6 +589,205 @@ fragment SingleProduct on SingleProduct { email customer } + similarProducts { + alias + image + imageUrl + name + } + attributeSelections { + selections { + attributeId + displayType + name + varyByParent + values { + alias + available + value + selected + printUrl + } + } + canBeMatrix + matrix { + column { + displayType + name + values { + value + } + } + data { + available + productVariantId + stock + } + row { + displayType + name + values { + value + printUrl + } + } + } + }, + buyTogether { + productId + } + promotions { + content + disclosureType + id + fullStampUrl + stamp + title + } + alias + buyListId + kit + available + variantName + buyListProducts { + productId + quantity + includeSameParent + } + images{ + url + fileName + print + } + informations{ + id + title + type + value + } + promotions{ + content + id + stamp + fullStampUrl + title + disclosureType + } + productName + prices { + listPrice + price + discountPercentage + installmentPlans{ + displayName + name + installments{ + discount + fees + number + value + } + } + bestInstallment { + name + displayName + discount + fees + number + value + } + } + +} +`; + +const SingleProductPart = gql` +fragment SingleProductPart on SingleProduct { + mainVariant + productName + productId + alias + collection + attributes { + name + type + value + attributeId + displayType + id + } + numberOfVotes + productCategories { + id + name + url + hierarchy + main + googleCategories + } + informations { + title + value + type + } + available + averageRating + breadcrumbs { + text + link + } + condition + createdAt + ean + id + images { + url + fileName + print + } + minimumOrderQuantity + prices { + bestInstallment { + discount + displayName + fees + name + number + value + } + discountPercentage + discounted + installmentPlans { + displayName + installments { + discount + fees + number + value + } + name + } + listPrice + multiplicationFactor + price + priceTables { + discountPercentage + id + listPrice + price + } + wholesalePrices { + price + quantity + } + } + productBrand { + fullUrlLogo + logoUrl + name + alias + } + productVariantId seller { name } @@ -209,13 +801,159 @@ fragment SingleProduct on SingleProduct { sku stock variantName + parallelOptions + urlVideo + reviews { + rating + review + reviewDate + email + customer + } + similarProducts { + alias + image + imageUrl + name + } + attributeSelections(includeParentIdVariants: $includeParentIdVariants) { + selections { + attributeId + displayType + name + varyByParent + values { + alias + available + value + selected + printUrl + } + } + canBeMatrix + matrix { + column { + displayType + name + values { + value + } + } + data { + available + productVariantId + stock + } + row { + displayType + name + values { + value + printUrl + } + } + } + selectedVariant { + ...ProductVariant + } + candidateVariant { + ...ProductVariant + } + }, + promotions { + content + disclosureType + id + fullStampUrl + stamp + title + } + } `; +const SingleProduct = gql` +fragment SingleProduct on SingleProduct { + ...SingleProductPart, + buyTogether { + productId + } +} + +`; + +const RestockAlertNode = gql` + fragment RestockAlertNode on RestockAlertNode { + email, + name, + productVariantId, + requestDate + } +`; + +const NewsletterNode = gql` + fragment NewsletterNode on NewsletterNode { + email, + name, + createDate, + updateDate + } +`; + +const ShippingQuote = gql` + fragment ShippingQuote on ShippingQuote { + id + type + name + value + deadline + shippingQuoteId + deliverySchedules { + date + periods { + end + id + start + } + } + products { + productVariantId + value + } + } +`; + +export const Customer = gql` + fragment Customer on Customer { + id + email + gender + customerId + companyName + customerName + customerType + responsibleName + informationGroups { + exibitionName + name + } + } +`; + +export const WishlistReducedProduct = gql` + fragment WishlistReducedProduct on Product { + productId + productName + } +`; + export const GetProduct = { - fragments: [SingleProduct], - query: gql`query GetProduct($productId: Long!) { - product(productId: $productId) { ...SingleProduct } + fragments: [SingleProductPart, SingleProduct, ProductVariant], + query: + gql`query GetProduct($productId: Long!, $includeParentIdVariants: Boolean, $partnerAccessToken: String) { + product(productId: $productId , partnerAccessToken: $partnerAccessToken) { + ...SingleProduct + } }`, }; @@ -234,15 +972,30 @@ export const CreateCart = { export const GetProducts = { fragments: [Product], query: - gql`query GetProducts($filters: ProductExplicitFiltersInput!, $first: Int!, $sortDirection: SortDirection!, $sortKey: ProductSortKeys) { products(filters: $filters, first: $first, sortDirection: $sortDirection, sortKey: $sortKey) { nodes { ...Product } }}`, + gql`query GetProducts($filters: ProductExplicitFiltersInput!, $first: Int!, $sortDirection: SortDirection!, $sortKey: ProductSortKeys, $after: String, $partnerAccessToken: String) { products(filters: $filters, first: $first, sortDirection: $sortDirection, sortKey: $sortKey, after: $after, partnerAccessToken: $partnerAccessToken) { + nodes { ...Product } + totalCount + pageInfo{ + hasNextPage, + endCursor, + hasPreviousPage, + startCursor + } + }}`, }; export const Search = { fragments: [Product], query: - gql`query Search($operation: Operation!, $query: String, $first: Int!, $sortDirection: SortDirection, $sortKey: ProductSearchSortKeys, $filters: [ProductFilterInput]) { - search(query: $query, operation: $operation) { + gql`query Search($operation: Operation!, $query: String, $onlyMainVariant: Boolean, $minimumPrice: Decimal, $maximumPrice: Decimal , $limit: Int, $offset: Int, $sortDirection: SortDirection, $sortKey: ProductSearchSortKeys, $filters: [ProductFilterInput], $partnerAccessToken: String) { + result: search(query: $query, operation: $operation, partnerAccessToken: $partnerAccessToken) { aggregations { + maximumPrice + minimumPrice + priceRanges { + quantity + range + } filters { field origin @@ -263,16 +1016,24 @@ export const Search = { pageSize redirectUrl searchTime - products(first: $first, sortDirection: $sortDirection, sortKey: $sortKey, filters: $filters) { - nodes { + productsByOffset( + filters: $filters, + limit: $limit, + maximumPrice: $maximumPrice, + minimumPrice: $minimumPrice, + onlyMainVariant: $onlyMainVariant + offset: $offset, + sortDirection: $sortDirection, + sortKey: $sortKey + ) { + items { ...Product } - pageInfo { - hasNextPage - hasPreviousPage - } + page + pageSize totalCount } + } }`, }; @@ -309,3 +1070,308 @@ export const RemoveItemFromCart = { checkout: checkoutRemoveProduct(input: $input) { ...Checkout } }`, }; + +export const ProductRestockAlert = { + fragments: [RestockAlertNode], + query: gql`mutation ProductRestockAlert($input: RestockAlertInput!) { + productRestockAlert(input: $input) { ...RestockAlertNode } + }`, +}; + +export const WishlistAddProduct = { + fragments: [Product], + query: + gql`mutation WishlistAddProduct($customerAccessToken: String!, $productId: Long!) { + wishlistAddProduct(customerAccessToken: $customerAccessToken, productId: $productId) { ...Product } + }`, +}; + +export const WishlistRemoveProduct = { + fragments: [Product], + query: + gql`mutation WishlistRemoveProduct($customerAccessToken: String!, $productId: Long!) { + wishlistRemoveProduct(customerAccessToken: $customerAccessToken, productId: $productId) { ...Product } + }`, +}; + +export const CreateNewsletterRegister = { + fragments: [NewsletterNode], + query: gql`mutation CreateNewsletterRegister($input: NewsletterInput!) { + createNewsletterRegister(input: $input) { ...NewsletterNode } + }`, +}; + +export const Autocomplete = { + fragments: [Product], + query: + gql`query Autocomplete($limit: Int, $query: String, $partnerAccessToken: String) { + autocomplete(limit: $limit, query: $query , partnerAccessToken: $partnerAccessToken ) { + suggestions, + products { + ...Product + } + } + }`, +}; + +export const ProductRecommendations = { + fragments: [Product], + query: gql`query ProductRecommendations( + $productId: Long!, + $algorithm: ProductRecommendationAlgorithm!, + $partnerAccessToken: String, + $quantity: Int! + ) { + productRecommendations(productId: $productId, algorithm: $algorithm, partnerAccessToken: $partnerAccessToken, quantity: $quantity) { + ...Product + } + }`, +}; + +export const ShippingQuotes = { + fragments: [ShippingQuote], + query: + gql`query ShippingQuotes($cep: CEP,$checkoutId: Uuid, $productVariantId: Long,$quantity: Int = 1, $useSelectedAddress: Boolean){ + shippingQuotes(cep: $cep,checkoutId: $checkoutId,productVariantId: $productVariantId,quantity: $quantity, useSelectedAddress: $useSelectedAddress){ + ...ShippingQuote + } + }`, +}; + +export const GetUser = { + fragments: [Customer], + query: gql`query getUser($customerAccessToken: String){ + customer(customerAccessToken: $customerAccessToken) { + ...Customer + } + }`, +}; + +export const GetWishlist = { + fragments: [WishlistReducedProduct], + query: gql`query getWishlist($customerAccessToken: String){ + customer(customerAccessToken: $customerAccessToken) { + wishlist { + products { + ...WishlistReducedProduct + } + } + } + }`, +}; + +export const GetURL = { + query: gql`query getURL($url: String!) { + uri(url: $url) { + hotsiteSubtype + kind + partnerSubtype + productAlias + productCategoriesIds + redirectCode + redirectUrl + } + }`, +}; + +export const CreateProductReview = { + query: + gql`mutation createProductReview ($email: String!, $name: String!, $productVariantId: Long!, $rating: Int!, $review: String!){ + createProductReview(input: {email: $email, name: $name, productVariantId: $productVariantId, rating: $rating, review: $review}) { + customer + email + rating + review + reviewDate + }}`, +}; + +export const SendGenericForm = { + query: + gql`mutation sendGenericForm ($body: Any, $file: Upload, $recaptchaToken: String){ + sendGenericForm(body: $body, file: $file, recaptchaToken: $recaptchaToken) { + isSuccess + }}`, +}; + +export const Hotsite = { + fragments: [Product], + query: gql`query Hotsite($url: String, + $filters: [ProductFilterInput], + $limit: Int, + $maximumPrice: Decimal, + $minimumPrice: Decimal, + $onlyMainVariant: Boolean + $offset: Int, + $sortDirection: SortDirection, + $sortKey: ProductSortKeys, + $partnerAccessToken: String) { + result: hotsite(url: $url, partnerAccessToken: $partnerAccessToken) { + aggregations { + filters { + field + origin + values { + name + quantity + } + } + maximumPrice + minimumPrice + priceRanges { + quantity + range + } + } + productsByOffset( + filters: $filters, + limit: $limit, + maximumPrice: $maximumPrice, + minimumPrice: $minimumPrice, + onlyMainVariant: $onlyMainVariant + offset: $offset, + sortDirection: $sortDirection, + sortKey: $sortKey + ) { + items { + ...Product + } + page + pageSize + totalCount + } + breadcrumbs { + link + text + } + endDate + expression + id + name + pageSize + seo { + content + httpEquiv + name + scheme + type + } + sorting { + direction + field + } + startDate + subtype + template + url + hotsiteId + } + } + `, +}; + +export const productOptions = { + query: gql`query productOptions ($productId: Long!){ + productOptions(productId: $productId) { + attributes { + attributeId + displayType + id + name + type + values { + productVariants { + ...ProductVariant + } + value + } + } + id + } + }`, +}; + +export const Shop = { + query: gql`query shop{ + shop { + checkoutUrl + mainUrl + mobileCheckoutUrl + mobileUrl + modifiedName + name + } + }`, +}; + +export const GetBuyList = { + fragments: [BuyList], + query: gql`query BuyList($id: Long!, $partnerAccessToken: String) { + buyList(id: $id, partnerAccessToken: $partnerAccessToken){ + ...BuyList + } + }`, +}; + +export const AddKit = { + fragments: [Checkout], + query: + gql`mutation AddKit($input: CheckoutKitInput!, $customerAccessToken: String, $recaptchaToken: String) { + checkout: checkoutAddKit(input: $input, customerAccessToken: $customerAccessToken, recaptchaToken: $recaptchaToken) { + ...Checkout + } + }`, +}; + +export const RemoveKit = { + fragments: [Checkout], + query: + gql`mutation RemoveKit($input: CheckoutKitInput!, $customerAccessToken: String, $recaptchaToken: String) { + checkout: checkoutRemoveKit(input: $input, customerAccessToken: $customerAccessToken, recaptchaToken: $recaptchaToken) { + ...Checkout + } + }`, +}; + +export const GetPartners = { + query: + gql`query GetPartners($first: Int,$last: Int,$names: [String],$priceTableIds: [Int!],$sortDirection: SortDirection! = ASC,$sortKey: PartnerSortKeys! = ID,$before: String,$alias: [String],$after: String) { + partners(first:$first,last:$last,names:$names,priceTableIds:$priceTableIds,sortDirection:$sortDirection,sortKey:$sortKey ,before:$before,alias:$alias,after:$after){ + edges{ + node{ + partnerId + priceTableId + portfolioId + type + startDate + endDate + name + alias + fullUrlLogo + origin + partnerAccessToken + } + } + } + }`, +}; + +export const CheckoutPartnerAssociate = { + fragments: [Checkout], + query: + gql`mutation CheckoutPartnerAssociate($checkoutId: Uuid!,$customerAccessToken: String, $partnerAccessToken: String!){ + checkout: checkoutPartnerAssociate(checkoutId: $checkoutId ,customerAccessToken: $customerAccessToken ,partnerAccessToken: $partnerAccessToken ){ + ...Checkout + } + }`, +}; + +export const CheckoutPartnerDisassociate = { + fragments: [Checkout], + query: + gql`mutation CheckoutPartnerDisassociate($checkoutId: Uuid!, $customerAccessToken: String){ + checkout: checkoutPartnerDisassociate(checkoutId: $checkoutId , customerAccessToken: $customerAccessToken ){ + ...Checkout + } + }`, +}; diff --git a/wake/utils/graphql/storefront.graphql.gen.ts b/wake/utils/graphql/storefront.graphql.gen.ts index acc743578..e195900cb 100644 --- a/wake/utils/graphql/storefront.graphql.gen.ts +++ b/wake/utils/graphql/storefront.graphql.gen.ts @@ -1,115 +1,106 @@ + +// deno-fmt-ignore-file // deno-lint-ignore-file no-explicit-any ban-types ban-unused-ignore // // DO NOT EDIT. This file is generated by deco. // This file SHOULD be checked into source version control. // To generate this file: deno task start -// +// export type Maybe = T | null; export type InputMaybe = Maybe; -export type Exact = { - [K in keyof T]: T[K]; -}; -export type MakeOptional = - & Omit - & { [SubKey in K]?: Maybe }; -export type MakeMaybe = - & Omit - & { [SubKey in K]: Maybe }; -export type MakeEmpty = - { [_ in K]?: never }; -export type Incremental = - | T - | { - [P in keyof T]?: P extends " $fragmentName" | "__typename" ? T[P] : never; - }; +export type Exact = { [K in keyof T]: T[K] }; +export type MakeOptional = Omit & { [SubKey in K]?: Maybe }; +export type MakeMaybe = Omit & { [SubKey in K]: Maybe }; +export type MakeEmpty = { [_ in K]?: never }; +export type Incremental = T | { [P in keyof T]?: P extends ' $fragmentName' | '__typename' ? T[P] : never }; /** All built-in and custom scalars, mapped to their actual values */ export type Scalars = { - ID: { input: string; output: string }; - String: { input: string; output: string }; - Boolean: { input: boolean; output: boolean }; - Int: { input: number; output: number }; - Float: { input: number; output: number }; - Any: { input: any; output: any }; - CEP: { input: any; output: any }; - CountryCode: { input: any; output: any }; - DateTime: { input: any; output: any }; - Decimal: { input: any; output: any }; - EmailAddress: { input: any; output: any }; - Long: { input: any; output: any }; - Upload: { input: any; output: any }; - Uuid: { input: any; output: any }; + ID: { input: string; output: string; } + String: { input: string; output: string; } + Boolean: { input: boolean; output: boolean; } + Int: { input: number; output: number; } + Float: { input: number; output: number; } + Any: { input: any; output: any; } + CEP: { input: any; output: any; } + CountryCode: { input: any; output: any; } + DateTime: { input: any; output: any; } + Decimal: { input: any; output: any; } + EmailAddress: { input: any; output: any; } + Long: { input: any; output: any; } + Upload: { input: any; output: any; } + Uuid: { input: any; output: any; } }; /** Price alert input parameters. */ export type AddPriceAlertInput = { /** The alerted's email. */ - email: Scalars["String"]["input"]; + email: Scalars['String']['input']; /** The alerted's name. */ - name: Scalars["String"]["input"]; + name: Scalars['String']['input']; /** The product variant id to create the price alert. */ - productVariantId: Scalars["Long"]["input"]; - /** The google recaptcha token. */ - recaptchaToken?: InputMaybe; + productVariantId: Scalars['Long']['input']; + /** [Deprecated: use the root field] The google recaptcha token. */ + recaptchaToken?: InputMaybe; /** The target price to alert. */ - targetPrice: Scalars["Decimal"]["input"]; + targetPrice: Scalars['Decimal']['input']; }; export type AddressNode = { /** Zip code. */ - cep?: Maybe; + cep?: Maybe; /** Address city. */ - city?: Maybe; + city?: Maybe; /** Address country. */ - country?: Maybe; + country?: Maybe; /** Address neighborhood. */ - neighborhood?: Maybe; + neighborhood?: Maybe; /** Address state. */ - state?: Maybe; + state?: Maybe; /** Address street. */ - street?: Maybe; + street?: Maybe; }; export type Answer = { - id?: Maybe; - value?: Maybe; + id?: Maybe; + value?: Maybe; }; export type ApplyPolicy = - | "AFTER_RESOLVER" - | "BEFORE_RESOLVER"; + | 'AFTER_RESOLVER' + | 'BEFORE_RESOLVER'; /** Attributes available for the variant products from the given productId. */ export type Attribute = Node & { /** The id of the attribute. */ - attributeId: Scalars["Long"]["output"]; + attributeId: Scalars['Long']['output']; /** The display type of the attribute. */ - displayType?: Maybe; + displayType?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The name of the attribute. */ - name?: Maybe; + name?: Maybe; /** The type of the attribute. */ - type?: Maybe; + type?: Maybe; /** The values of the attribute. */ values?: Maybe>>; }; export type AttributeFilterInput = { - attributeId: Scalars["Long"]["input"]; - value: Scalars["String"]["input"]; + attributeId: Scalars['Long']['input']; + value: Scalars['String']['input']; }; /** Input to specify which attributes to match. */ export type AttributeInput = { /** The attribute Ids to match. */ - id?: InputMaybe>; + id?: InputMaybe>; /** The attribute name to match. */ - name?: InputMaybe>>; + name?: InputMaybe>>; /** The attribute type to match. */ - type?: InputMaybe>>; + type?: InputMaybe>>; /** The attribute value to match */ - value?: InputMaybe>>; + value?: InputMaybe>>; }; export type AttributeMatrix = { @@ -122,31 +113,32 @@ export type AttributeMatrix = { }; export type AttributeMatrixInfo = { - displayType?: Maybe; - name?: Maybe; + displayType?: Maybe; + name?: Maybe; values?: Maybe>>; }; export type AttributeMatrixProduct = { - available: Scalars["Boolean"]["output"]; - productVariantId: Scalars["Long"]["output"]; - stock: Scalars["Long"]["output"]; + available: Scalars['Boolean']['output']; + productVariantId: Scalars['Long']['output']; + stock: Scalars['Long']['output']; }; export type AttributeMatrixRowColumnInfoValue = { - printUrl?: Maybe; - value?: Maybe; + printUrl?: Maybe; + value?: Maybe; }; + export type AttributeMatrixRowColumnInfoValuePrintUrlArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Attributes available for the variant products from the given productId. */ export type AttributeSelection = { /** Check if the current product attributes can be rendered as a matrix. */ - canBeMatrix: Scalars["Boolean"]["output"]; + canBeMatrix: Scalars['Boolean']['output']; /** The candidate variant given the current input filters. Variant may be from brother product Id. */ candidateVariant?: Maybe; /** Informations about the attribute matrix. */ @@ -160,29 +152,30 @@ export type AttributeSelection = { /** Attributes available for the variant products from the given productId. */ export type AttributeSelectionOption = { /** The id of the attribute. */ - attributeId: Scalars["Long"]["output"]; + attributeId: Scalars['Long']['output']; /** The display type of the attribute. */ - displayType?: Maybe; + displayType?: Maybe; /** The name of the attribute. */ - name?: Maybe; + name?: Maybe; /** The values of the attribute. */ values?: Maybe>>; /** If the attributes varies by parent. */ - varyByParent: Scalars["Boolean"]["output"]; + varyByParent: Scalars['Boolean']['output']; }; export type AttributeSelectionOptionValue = { - alias?: Maybe; - available: Scalars["Boolean"]["output"]; - printUrl?: Maybe; - selected: Scalars["Boolean"]["output"]; + alias?: Maybe; + available: Scalars['Boolean']['output']; + printUrl?: Maybe; + selected: Scalars['Boolean']['output']; /** The value of the attribute. */ - value?: Maybe; + value?: Maybe; }; + export type AttributeSelectionOptionValuePrintUrlArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Attributes values with variants */ @@ -190,7 +183,7 @@ export type AttributeValue = { /** Product variants that have the attribute. */ productVariants?: Maybe>>; /** The value of the attribute. */ - value?: Maybe; + value?: Maybe; }; /** Get query completion suggestion. */ @@ -198,57 +191,57 @@ export type Autocomplete = { /** Suggested products based on the current query. */ products?: Maybe>>; /** List of possible query completions. */ - suggestions?: Maybe>>; + suggestions?: Maybe>>; }; /** A banner is usually an image used to show sales, highlight products, announcements or to redirect to another page or hotsite on click. */ export type Banner = Node & { /** Banner's alternative text. */ - altText?: Maybe; + altText?: Maybe; /** Banner unique identifier. */ - bannerId: Scalars["Long"]["output"]; + bannerId: Scalars['Long']['output']; /** Banner's name. */ - bannerName?: Maybe; + bannerName?: Maybe; /** URL where the banner is stored. */ - bannerUrl?: Maybe; + bannerUrl?: Maybe; /** The date the banner was created. */ - creationDate?: Maybe; + creationDate?: Maybe; /** Field to check if the banner should be displayed on all pages. */ - displayOnAllPages: Scalars["Boolean"]["output"]; + displayOnAllPages: Scalars['Boolean']['output']; /** Field to check if the banner should be displayed on category pages. */ - displayOnCategories: Scalars["Boolean"]["output"]; + displayOnCategories: Scalars['Boolean']['output']; /** Field to check if the banner should be displayed on search pages. */ - displayOnSearches: Scalars["Boolean"]["output"]; + displayOnSearches: Scalars['Boolean']['output']; /** Field to check if the banner should be displayed on the website. */ - displayOnWebsite: Scalars["Boolean"]["output"]; + displayOnWebsite: Scalars['Boolean']['output']; /** Field to check if the banner should be displayed to partners. */ - displayToPartners: Scalars["Boolean"]["output"]; + displayToPartners: Scalars['Boolean']['output']; /** The banner's height in px. */ - height?: Maybe; + height?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** Field to check if the banner URL should open in another tab on click. */ - openNewTab: Scalars["Boolean"]["output"]; + openNewTab: Scalars['Boolean']['output']; /** The displaying order of the banner. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; /** The displaying position of the banner. */ - position?: Maybe; + position?: Maybe; /** A list of terms to display the banner on search. */ - searchTerms?: Maybe>>; + searchTerms?: Maybe>>; /** The banner's title. */ - title?: Maybe; + title?: Maybe; /** URL to be redirected on click. */ - urlOnClick?: Maybe; + urlOnClick?: Maybe; /** The banner's width in px. */ - width?: Maybe; + width?: Maybe; }; /** Define the banner attribute which the result set will be sorted on. */ export type BannerSortKeys = /** The banner's creation date. */ - | "CREATION_DATE" + | 'CREATION_DATE' /** The banner's unique identifier. */ - | "ID"; + | 'ID'; /** A connection to a list of items. */ export type BannersConnection = { @@ -263,67 +256,69 @@ export type BannersConnection = { /** An edge in a connection. */ export type BannersEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; export type BestInstallment = { /** Wether the installment has discount. */ - discount: Scalars["Boolean"]["output"]; + discount: Scalars['Boolean']['output']; /** The custom display name of the best installment plan option. */ - displayName?: Maybe; + displayName?: Maybe; /** Wether the installment has fees. */ - fees: Scalars["Boolean"]["output"]; + fees: Scalars['Boolean']['output']; /** The name of the best installment plan option. */ - name?: Maybe; + name?: Maybe; /** The number of installments. */ - number: Scalars["Int"]["output"]; + number: Scalars['Int']['output']; /** The value of the installment. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; }; /** Informations about brands and its products. */ export type Brand = Node & { /** If the brand is active at the platform. */ - active: Scalars["Boolean"]["output"]; + active: Scalars['Boolean']['output']; /** The alias for the brand's hotsite. */ - alias?: Maybe; + alias?: Maybe; /** Brand unique identifier. */ - brandId: Scalars["Long"]["output"]; + brandId: Scalars['Long']['output']; /** The date the brand was created in the database. */ - createdAt: Scalars["DateTime"]["output"]; + createdAt: Scalars['DateTime']['output']; /** The full brand logo URL. */ - fullUrlLogo?: Maybe; + fullUrlLogo?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The brand's name. */ - name?: Maybe; + name?: Maybe; /** A list of products from the brand. */ products?: Maybe; /** The last update date. */ - updatedAt: Scalars["DateTime"]["output"]; + updatedAt: Scalars['DateTime']['output']; /** A web address to be redirected. */ - urlCarrossel?: Maybe; + urlCarrossel?: Maybe; /** A web address linked to the brand. */ - urlLink?: Maybe; + urlLink?: Maybe; /** The url of the brand's logo. */ - urlLogo?: Maybe; + urlLogo?: Maybe; }; + /** Informations about brands and its products. */ export type BrandFullUrlLogoArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; + /** Informations about brands and its products. */ export type BrandProductsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - partnerAccessToken?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: SortDirection; sortKey?: ProductSortKeys; }; @@ -331,21 +326,21 @@ export type BrandProductsArgs = { /** Filter brand results based on giving attributes. */ export type BrandFilterInput = { /** Its unique identifier (you may provide a list of IDs if needed). */ - brandIds?: InputMaybe>; + brandIds?: InputMaybe>; /** Its brand group unique identifier (you may provide a list of IDs if needed). */ - groupIds?: InputMaybe>; + groupIds?: InputMaybe>; /** The set of group brand names which the result item name must be included in. */ - groupNames?: InputMaybe>>; + groupNames?: InputMaybe>>; /** The set of brand names which the result item name must be included in. */ - names?: InputMaybe>>; + names?: InputMaybe>>; }; /** Define the brand attribute which the result set will be sorted on. */ export type BrandSortKeys = /** The brand unique identifier. */ - | "ID" + | 'ID' /** The brand name. */ - | "NAME"; + | 'NAME'; /** A connection to a list of items. */ export type BrandsConnection = { @@ -355,13 +350,13 @@ export type BrandsConnection = { nodes?: Maybe>>; /** Information to aid in pagination. */ pageInfo: PageInfo; - totalCount: Scalars["Int"]["output"]; + totalCount: Scalars['Int']['output']; }; /** An edge in a connection. */ export type BrandsEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; @@ -369,9 +364,9 @@ export type BrandsEdge = { /** Informations about breadcrumb. */ export type Breadcrumb = { /** Breadcrumb link. */ - link?: Maybe; + link?: Maybe; /** Breadcrumb text. */ - text?: Maybe; + text?: Maybe; }; /** BuyBox informations. */ @@ -379,11 +374,11 @@ export type BuyBox = { /** List of the possibles installment plans. */ installmentPlans?: Maybe>>; /** Maximum price among sellers. */ - maximumPrice?: Maybe; + maximumPrice?: Maybe; /** Minimum price among sellers. */ - minimumPrice?: Maybe; + minimumPrice?: Maybe; /** Quantity of offers. */ - quantityOffers?: Maybe; + quantityOffers?: Maybe; /** List of sellers. */ sellers?: Maybe>>; }; @@ -391,61 +386,82 @@ export type BuyBox = { /** A buy list represents a list of items for sale in the store. */ export type BuyList = Node & { /** Check if the product can be added to cart directly from spot. */ - addToCartFromSpot?: Maybe; + addToCartFromSpot?: Maybe; /** The product url alias. */ - alias?: Maybe; + alias?: Maybe; + /** The complete product url alias. */ + aliasComplete?: Maybe; /** Information about the possible selection attributes. */ attributeSelections?: Maybe; /** List of the product attributes. */ attributes?: Maybe>>; + /** The product author. */ + author?: Maybe; /** Field to check if the product is available in stock. */ - available?: Maybe; + available?: Maybe; /** The product average rating. From 0 to 5. */ - averageRating?: Maybe; + averageRating?: Maybe; /** List of product breadcrumbs. */ breadcrumbs?: Maybe>>; /** BuyBox informations. */ buyBox?: Maybe; - buyListId: Scalars["Int"]["output"]; + buyListId: Scalars['Int']['output']; buyListProducts?: Maybe>>; /** Buy together products. */ buyTogether?: Maybe>>; + /** Buy together groups products. */ + buyTogetherGroups?: Maybe>>; + /** The product collection. */ + collection?: Maybe; /** The product condition. */ - condition?: Maybe; + condition?: Maybe; + /** Checks if the product allows counteroffers. */ + counterOffer?: Maybe; /** The product creation date. */ - createdAt?: Maybe; + createdAt?: Maybe; /** A list of customizations available for the given products. */ customizations?: Maybe>>; /** The product delivery deadline. */ - deadline?: Maybe; + deadline?: Maybe; + /** Product deadline alert informations. */ + deadlineAlert?: Maybe; /** Check if the product should be displayed. */ - display?: Maybe; + display?: Maybe; /** Check if the product should be displayed only for partners. */ - displayOnlyPartner?: Maybe; + displayOnlyPartner?: Maybe; /** Check if the product should be displayed on search. */ - displaySearch?: Maybe; + displaySearch?: Maybe; /** The product's unique EAN. */ - ean?: Maybe; + ean?: Maybe; /** Check if the product offers free shipping. */ - freeShipping?: Maybe; + freeShipping?: Maybe; + /** The product gender. */ + gender?: Maybe; + /** The height of the product. */ + height?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** List of the product images. */ images?: Maybe>>; /** List of the product insformations. */ informations?: Maybe>>; + kit: Scalars['Boolean']['output']; + /** The length of the product. */ + length?: Maybe; /** Check if its the main variant. */ - mainVariant?: Maybe; + mainVariant?: Maybe; + /** The product maximum quantity for an order. */ + maximumOrderQuantity?: Maybe; /** The product minimum quantity for an order. */ - minimumOrderQuantity?: Maybe; + minimumOrderQuantity?: Maybe; /** Check if the product is a new release. */ - newRelease?: Maybe; + newRelease?: Maybe; /** The number of votes that the average rating consists of. */ - numberOfVotes?: Maybe; + numberOfVotes?: Maybe; /** Product parallel options information. */ - parallelOptions?: Maybe>>; + parallelOptions?: Maybe>>; /** Parent product unique identifier. */ - parentId?: Maybe; + parentId?: Maybe; /** The product prices. */ prices?: Maybe; /** Summarized informations about the brand of the product. */ @@ -453,15 +469,20 @@ export type BuyList = Node & { /** Summarized informations about the categories of the product. */ productCategories?: Maybe>>; /** Product unique identifier. */ - productId?: Maybe; + productId?: Maybe; /** The product name. */ - productName?: Maybe; - /** Summarized informations about the subscription of the product. */ + productName?: Maybe; + /** + * Summarized informations about the subscription of the product. + * @deprecated Use subscriptionGroups to get subscription information. + */ productSubscription?: Maybe; /** Variant unique identifier. */ - productVariantId?: Maybe; + productVariantId?: Maybe; /** List of promotions this product belongs to. */ promotions?: Maybe>>; + /** The product publisher */ + publisher?: Maybe; /** List of customer reviews for this product. */ reviews?: Maybe>>; /** The product seller. */ @@ -471,45 +492,68 @@ export type BuyList = Node & { /** List of similar products. */ similarProducts?: Maybe>>; /** The product's unique SKU. */ - sku?: Maybe; + sku?: Maybe; /** The values of the spot attribute. */ - spotAttributes?: Maybe>>; + spotAttributes?: Maybe>>; /** The product spot information. */ - spotInformation?: Maybe; + spotInformation?: Maybe; /** Check if the product is on spotlight. */ - spotlight?: Maybe; - /** The available stock at the default distribution center. */ - stock?: Maybe; + spotlight?: Maybe; + /** The available aggregated product stock (all variants) at the default distribution center. */ + stock?: Maybe; /** List of the product stocks on different distribution centers. */ stocks?: Maybe>>; /** List of subscription groups this product belongs to. */ subscriptionGroups?: Maybe>>; /** Check if the product is a telesale. */ - telesales?: Maybe; + telesales?: Maybe; /** The product last update date. */ - updatedAt?: Maybe; + updatedAt?: Maybe; /** The product video url. */ - urlVideo?: Maybe; + urlVideo?: Maybe; /** The variant name. */ - variantName?: Maybe; + variantName?: Maybe; + /** The available aggregated variant stock at the default distribution center. */ + variantStock?: Maybe; + /** The weight of the product. */ + weight?: Maybe; + /** The width of the product. */ + width?: Maybe; }; + /** A buy list represents a list of items for sale in the store. */ export type BuyListImagesArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Contains the id and quantity of a product in the buy list. */ export type BuyListProduct = { - productId: Scalars["Long"]["output"]; - quantity: Scalars["Int"]["output"]; + includeSameParent: Scalars['Boolean']['output']; + price?: Maybe; + productId: Scalars['Long']['output']; + quantity: Scalars['Int']['output']; +}; + +/** BuyTogetherGroups informations. */ +export type BuyTogetherGroup = { + /** BuyTogether name */ + name?: Maybe; + /** BuyTogether products */ + products?: Maybe>>; + /** BuyTogether type */ + type: BuyTogetherType; }; +export type BuyTogetherType = + | 'CAROUSEL' + | 'PRODUCT'; + /** The products to calculate prices. */ export type CalculatePricesProductsInput = { - productVariantId: Scalars["Long"]["input"]; - quantity: Scalars["Int"]["input"]; + productVariantId: Scalars['Long']['input']; + quantity: Scalars['Int']['input']; }; /** A connection to a list of items. */ @@ -525,7 +569,7 @@ export type CategoriesConnection = { /** An edge in a connection. */ export type CategoriesEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; @@ -533,44 +577,45 @@ export type CategoriesEdge = { /** Categories are used to arrange your products into different sections by similarity. */ export type Category = Node & { /** Category unique identifier. */ - categoryId: Scalars["Long"]["output"]; + categoryId: Scalars['Long']['output']; /** A list of child categories, if it exists. */ children?: Maybe>>; /** A description to the category. */ - description?: Maybe; + description?: Maybe; /** Field to check if the category is displayed in the store's menu. */ - displayMenu: Scalars["Boolean"]["output"]; + displayMenu: Scalars['Boolean']['output']; /** The hotsite alias. */ - hotsiteAlias?: Maybe; + hotsiteAlias?: Maybe; /** The URL path for the category. */ - hotsiteUrl?: Maybe; + hotsiteUrl?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The url to access the image linked to the category. */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** The web address to access the image linked to the category. */ - imageUrlLink?: Maybe; + imageUrlLink?: Maybe; /** The category's name. */ - name?: Maybe; + name?: Maybe; /** The parent category, if it exists. */ parent?: Maybe; /** The parent category unique identifier. */ - parentCategoryId: Scalars["Long"]["output"]; + parentCategoryId: Scalars['Long']['output']; /** The position the category will be displayed. */ - position: Scalars["Int"]["output"]; + position: Scalars['Int']['output']; /** A list of products associated with the category. */ products?: Maybe; /** A web address linked to the category. */ - urlLink?: Maybe; + urlLink?: Maybe; }; + /** Categories are used to arrange your products into different sections by similarity. */ export type CategoryProductsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - partnerAccessToken?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: SortDirection; sortKey?: ProductSortKeys; }; @@ -578,28 +623,42 @@ export type CategoryProductsArgs = { /** Define the category attribute which the result set will be sorted on. */ export type CategorySortKeys = /** The category unique identifier. */ - | "ID" + | 'ID' /** The category name. */ - | "NAME"; + | 'NAME'; export type Checkout = Node & { /** The CEP. */ - cep?: Maybe; + cep?: Maybe; + /** Indicates if the checking account is being used. */ + checkingAccountActive: Scalars['Boolean']['output']; + /** Total used from checking account. */ + checkingAccountValue?: Maybe; /** The checkout unique identifier. */ - checkoutId: Scalars["Uuid"]["output"]; + checkoutId: Scalars['Uuid']['output']; /** Indicates if the checkout is completed. */ - completed: Scalars["Boolean"]["output"]; + completed: Scalars['Boolean']['output']; /** The coupon for discounts. */ - coupon?: Maybe; + coupon?: Maybe; + /** The total coupon discount applied at checkout. */ + couponDiscount: Scalars['Decimal']['output']; /** The customer associated with the checkout. */ customer?: Maybe; + /** The total value of customizations added to the products. */ + customizationValue: Scalars['Decimal']['output']; + /** The discount applied at checkout excluding any coupons. */ + discount: Scalars['Decimal']['output']; /** The node unique identifier. */ - id?: Maybe; - login?: Maybe; + id?: Maybe; + /** A list of kits associated with the checkout. */ + kits?: Maybe>>; + login?: Maybe; /** The metadata related to this checkout. */ metadata?: Maybe>>; /** The checkout orders informations. */ orders?: Maybe>>; + /** The additional fees applied based on the payment method. */ + paymentFees: Scalars['Decimal']['output']; /** A list of products associated with the checkout. */ products?: Maybe>>; /** The selected delivery address for the checkout. */ @@ -608,68 +667,130 @@ export type Checkout = Node & { selectedPaymentMethod?: Maybe; /** Selected Shipping. */ selectedShipping?: Maybe; + /** Selected shipping quote groups. */ + selectedShippingGroups?: Maybe>>; /** The shipping fee. */ - shippingFee: Scalars["Decimal"]["output"]; + shippingFee: Scalars['Decimal']['output']; /** The subtotal value. */ - subtotal: Scalars["Decimal"]["output"]; + subtotal: Scalars['Decimal']['output']; /** The total value. */ - total: Scalars["Decimal"]["output"]; + total: Scalars['Decimal']['output']; + /** The total discount applied at checkout. */ + totalDiscount: Scalars['Decimal']['output']; /** The last update date. */ - updateDate: Scalars["DateTime"]["output"]; + updateDate: Scalars['DateTime']['output']; /** Url for the current checkout id. */ - url?: Maybe; + url?: Maybe; }; /** Represents an address node in the checkout. */ export type CheckoutAddress = { /** The street number of the address. */ - addressNumber?: Maybe; + addressNumber?: Maybe; /** The ZIP code of the address. */ - cep: Scalars["Int"]["output"]; + cep: Scalars['Int']['output']; /** The city of the address. */ - city?: Maybe; + city?: Maybe; /** The additional address information. */ - complement?: Maybe; + complement?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The neighborhood of the address. */ - neighborhood?: Maybe; + neighborhood?: Maybe; + /** Receiver's name */ + receiverName?: Maybe; /** The reference point for the address. */ - referencePoint?: Maybe; + referencePoint?: Maybe; /** The state of the address. */ - state?: Maybe; + state?: Maybe; /** The street name of the address. */ - street?: Maybe; + street?: Maybe; }; /** Represents a customer node in the checkout. */ export type CheckoutCustomer = { + /** Customer's checking account balance. */ + checkingAccountBalance?: Maybe; /** Taxpayer identification number for businesses. */ - cnpj?: Maybe; + cnpj?: Maybe; /** Brazilian individual taxpayer registry identification. */ - cpf?: Maybe; - /** The credit limit of the customer. */ - creditLimit: Scalars["Decimal"]["output"]; - /** The credit limit balance of the customer. */ - creditLimitBalance: Scalars["Decimal"]["output"]; + cpf?: Maybe; + /** Customer's credit limit. */ + creditLimit: Scalars['Decimal']['output']; + /** Customer's credit balance. */ + creditLimitBalance: Scalars['Decimal']['output']; /** Customer's unique identifier. */ - customerId: Scalars["Long"]["output"]; + customerId: Scalars['Long']['output']; /** Customer's name. */ - customerName?: Maybe; + customerName?: Maybe; /** The email address of the customer. */ - email?: Maybe; + email?: Maybe; /** Customer's phone number. */ - phoneNumber?: Maybe; + phoneNumber?: Maybe; }; export type CheckoutCustomizationInput = { - customizationId: Scalars["Long"]["input"]; - value?: InputMaybe; + /** The ID of a customization type related to the product. */ + customizationId: Scalars['Long']['input']; + /** The value of the applied customization. */ + value?: InputMaybe; +}; + +export type CheckoutKit = { + /** The price adjusted with promotions and other price changes */ + ajustedPrice: Scalars['Decimal']['output']; + /** The kit alias */ + alias?: Maybe; + /** The kit URL image */ + imageUrl?: Maybe; + /** The kit unique identifier */ + kitGroupId?: Maybe; + /** The kit identifier */ + kitId: Scalars['Long']['output']; + /** The kit list price */ + listPrice: Scalars['Decimal']['output']; + /** The kit name */ + name?: Maybe; + /** The kit price */ + price: Scalars['Decimal']['output']; + /** The products contained in this kit */ + products?: Maybe>>; + /** The kit quantity */ + quantity: Scalars['Int']['output']; + /** The total price adjusted with promotions and other price changes */ + totalAdjustedPrice: Scalars['Decimal']['output']; + /** The total list price */ + totalListPrice: Scalars['Decimal']['output']; +}; + +export type CheckoutKitInput = { + id: Scalars['Uuid']['input']; + kitGroupId?: InputMaybe; + kitId: Scalars['Long']['input']; + products?: InputMaybe>>; + quantity: Scalars['Int']['input']; +}; + +export type CheckoutKitProductInput = { + productId: Scalars['Long']['input']; + variants?: InputMaybe>>; +}; + +export type CheckoutKitVariantInput = { + productVariantId: Scalars['Long']['input']; + quantity: Scalars['Int']['input']; +}; + +export type CheckoutLite = { + /** Indicates if the checkout is completed. */ + completed: Scalars['Boolean']['output']; + /** The customer ID associated with the checkout. */ + customerId?: Maybe; }; export type CheckoutMetadataInput = { - key?: InputMaybe; - value?: InputMaybe; + key?: InputMaybe; + value?: InputMaybe; }; /** Represents a node in the checkout order. */ @@ -677,17 +798,17 @@ export type CheckoutOrder = { /** The list of adjustments applied to the order. */ adjustments?: Maybe>>; /** The date of the order. */ - date: Scalars["DateTime"]["output"]; + date: Scalars['DateTime']['output']; /** Details of the delivery or store pickup. */ delivery?: Maybe; /** The discount value of the order. */ - discountValue: Scalars["Decimal"]["output"]; + discountValue: Scalars['Decimal']['output']; /** The dispatch time text from the shop settings. */ - dispatchTimeText?: Maybe; + dispatchTimeText?: Maybe; /** The interest value of the order. */ - interestValue: Scalars["Decimal"]["output"]; + interestValue: Scalars['Decimal']['output']; /** The ID of the order. */ - orderId: Scalars["Long"]["output"]; + orderId: Scalars['Long']['output']; /** The order status. */ orderStatus: OrderStatus; /** The payment information. */ @@ -695,39 +816,53 @@ export type CheckoutOrder = { /** The list of products in the order. */ products?: Maybe>>; /** The shipping value of the order. */ - shippingValue: Scalars["Decimal"]["output"]; + shippingValue: Scalars['Decimal']['output']; /** The total value of the order. */ - totalValue: Scalars["Decimal"]["output"]; + totalValue: Scalars['Decimal']['output']; }; /** The delivery or store Pickup Address. */ export type CheckoutOrderAddress = { /** The street address. */ - address?: Maybe; + address?: Maybe; /** The ZIP code. */ - cep?: Maybe; + cep?: Maybe; /** The city. */ - city?: Maybe; + city?: Maybe; /** Additional information or details about the address. */ - complement?: Maybe; + complement?: Maybe; /** Indicates whether the order is for store pickup. */ - isPickupStore: Scalars["Boolean"]["output"]; + isPickupStore: Scalars['Boolean']['output']; /** The name. */ - name?: Maybe; + name?: Maybe; /** The neighborhood. */ - neighborhood?: Maybe; + neighborhood?: Maybe; /** . */ - pickupStoreText?: Maybe; + pickupStoreText?: Maybe; }; /** Represents an adjustment applied to checkout. */ export type CheckoutOrderAdjustment = { /** The name of the adjustment. */ - name?: Maybe; + name?: Maybe; /** The type of the adjustment. */ - type?: Maybe; + type?: Maybe; /** The value of the adjustment. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; +}; + +/** This represents a Card payment node in the checkout order. */ +export type CheckoutOrderCardPayment = { + /** The brand card. */ + brand?: Maybe; + /** The interest generated by the card. */ + cardInterest: Scalars['Decimal']['output']; + /** The installments generated for the card. */ + installments: Scalars['Int']['output']; + /** The cardholder name. */ + name?: Maybe; + /** The final four numbers on the card. */ + number?: Maybe; }; /** The delivery or store pickup details. */ @@ -735,27 +870,31 @@ export type CheckoutOrderDelivery = { /** The delivery or store pickup address. */ address?: Maybe; /** The cost of delivery or pickup. */ - cost: Scalars["Decimal"]["output"]; + cost: Scalars['Decimal']['output']; /** The estimated delivery or pickup time, in days. */ - deliveryTime: Scalars["Int"]["output"]; + deliveryTime: Scalars['Int']['output']; + /** The estimated delivery or pickup time, in hours. */ + deliveryTimeInHours?: Maybe; /** The name of the recipient. */ - name?: Maybe; + name?: Maybe; }; /** The invoice payment information. */ export type CheckoutOrderInvoicePayment = { /** The digitable line. */ - digitableLine?: Maybe; + digitableLine?: Maybe; /** The payment link. */ - paymentLink?: Maybe; + paymentLink?: Maybe; }; /** The checkout order payment. */ export type CheckoutOrderPayment = { + /** The card payment information. */ + card?: Maybe; /** The bank invoice payment information. */ invoice?: Maybe; /** The name of the payment method. */ - name?: Maybe; + name?: Maybe; /** The Pix payment information. */ pix?: Maybe; }; @@ -763,11 +902,11 @@ export type CheckoutOrderPayment = { /** This represents a Pix payment node in the checkout order. */ export type CheckoutOrderPixPayment = { /** The QR code. */ - qrCode?: Maybe; + qrCode?: Maybe; /** The expiration date of the QR code. */ - qrCodeExpirationDate?: Maybe; + qrCodeExpirationDate?: Maybe; /** The image URL of the QR code. */ - qrCodeUrl?: Maybe; + qrCodeUrl?: Maybe; }; /** Represents a node in the checkout order products. */ @@ -777,156 +916,275 @@ export type CheckoutOrderProduct = { /** The list of attributes of the product. */ attributes?: Maybe>>; /** The image URL of the product. */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** The name of the product. */ - name?: Maybe; + name?: Maybe; /** The ID of the product variant. */ - productVariantId: Scalars["Long"]["output"]; + productVariantId: Scalars['Long']['output']; /** The quantity of the product. */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; + /** The unit value of the product. */ + unitValue: Scalars['Decimal']['output']; /** The value of the product. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; }; /** Represents an adjustment applied to a product in the checkout order. */ export type CheckoutOrderProductAdjustment = { /** Additional information about the adjustment. */ - additionalInformation?: Maybe; + additionalInformation?: Maybe; /** The name of the adjustment. */ - name?: Maybe; + name?: Maybe; /** The type of the adjustment. */ - type?: Maybe; + type?: Maybe; /** The value of the adjustment. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; }; /** Represents an attribute of a product. */ export type CheckoutOrderProductAttribute = { /** The name of the attribute. */ - name?: Maybe; + name?: Maybe; /** The value of the attribute. */ - value?: Maybe; + value?: Maybe; +}; + +export type CheckoutProductAdjustmentNode = { + /** The observation referent adjustment in Product */ + observation?: Maybe; + /** The type that was applied in product adjustment */ + type?: Maybe; + /** The value that was applied to the product adjustment */ + value: Scalars['Decimal']['output']; }; export type CheckoutProductAttributeNode = { /** The attribute name */ - name?: Maybe; + name?: Maybe; /** The attribute type */ - type: Scalars["Int"]["output"]; + type: Scalars['Int']['output']; /** The attribute value */ - value?: Maybe; + value?: Maybe; +}; + +export type CheckoutProductCustomizationNode = { + /** The available product customizations. */ + availableCustomizations?: Maybe>>; + /** The product customization unique identifier. */ + id?: Maybe; + /** The product customization values. */ + values?: Maybe>>; +}; + +export type CheckoutProductCustomizationValueNode = { + /** The product customization cost. */ + cost: Scalars['Decimal']['output']; + /** The product customization name. */ + name?: Maybe; + /** The product customization value. */ + value?: Maybe; }; export type CheckoutProductInput = { - id: Scalars["Uuid"]["input"]; + /** The checkout unique identifier. */ + id: Scalars['Uuid']['input']; + /** The checkout products. */ products: Array>; }; export type CheckoutProductItemInput = { + /** The customizations of the product. */ customization?: InputMaybe>>; + /** The ID represents all customizations applied to the product. */ + customizationId?: InputMaybe; + /** The metadata of the product. */ metadata?: InputMaybe>>; - productVariantId: Scalars["Long"]["input"]; - quantity: Scalars["Int"]["input"]; + /** The ID of the product variant. */ + productVariantId: Scalars['Long']['input']; + /** The quantity of the product. */ + quantity: Scalars['Int']['input']; + /** Product subscriptions related to checkout. */ + subscription?: InputMaybe; +}; + +export type CheckoutProductItemUpdateInput = { + /** The customizations of the product. */ + customization?: InputMaybe>>; + /** The ID represents all customizations applied to the product. If it is a new customization, this field must be null, otherwise it must be inserted and must have the value. */ + customizationId?: InputMaybe; + /** The ID of the product variant. */ + productVariantId: Scalars['Long']['input']; + /** The quantity of the product. */ + quantity?: InputMaybe; + /** The checkout subscription. */ subscription?: InputMaybe; }; export type CheckoutProductNode = { - /** The product adjusted price */ - ajustedPrice: Scalars["Decimal"]["output"]; + /** The product adjustment information */ + adjustments?: Maybe>>; + /** The price adjusted with promotions and other price changes */ + ajustedPrice: Scalars['Decimal']['output']; /** Information about the possible selection attributes. */ attributeSelections?: Maybe; /** The product brand */ - brand?: Maybe; + brand?: Maybe; /** The product category */ - category?: Maybe; + category?: Maybe; + /** The product customization. */ + customization?: Maybe; /** If the product is a gift */ - gift: Scalars["Boolean"]["output"]; + gift: Scalars['Boolean']['output']; /** The product Google category */ - googleCategory?: Maybe>>; + googleCategory?: Maybe>>; /** The product URL image */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** The product informations */ - informations?: Maybe>>; + informations?: Maybe>>; /** The product installment fee */ - installmentFee: Scalars["Boolean"]["output"]; + installmentFee: Scalars['Boolean']['output']; /** The product installment value */ - installmentValue: Scalars["Decimal"]["output"]; + installmentValue: Scalars['Decimal']['output']; + /** The product has a kit */ + kit: Scalars['Boolean']['output']; /** The product list price */ - listPrice: Scalars["Decimal"]["output"]; + listPrice: Scalars['Decimal']['output']; /** The metadata related to this checkout. */ metadata?: Maybe>>; /** The product name */ - name?: Maybe; + name?: Maybe; /** The product number of installments */ - numberOfInstallments: Scalars["Int"]["output"]; + numberOfInstallments: Scalars['Int']['output']; /** The product price */ - price: Scalars["Decimal"]["output"]; + price: Scalars['Decimal']['output']; /** The product attributes */ productAttributes?: Maybe>>; /** The product unique identifier */ - productId: Scalars["Long"]["output"]; + productId: Scalars['Long']['output']; /** The product variant unique identifier */ - productVariantId: Scalars["Long"]["output"]; + productVariantId: Scalars['Long']['output']; /** The product quantity */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; + /** The product seller. */ + seller?: Maybe; /** The product shipping deadline */ shippingDeadline?: Maybe; /** The product SKU */ - sku?: Maybe; + sku?: Maybe; + /** The product subscription information */ + subscription?: Maybe; + /** The total price adjusted with promotions and other price changes */ + totalAdjustedPrice: Scalars['Decimal']['output']; + /** The total list price */ + totalListPrice: Scalars['Decimal']['output']; /** The product URL */ - url?: Maybe; + url?: Maybe; }; + export type CheckoutProductNodeAttributeSelectionsArgs = { + includeParentIdVariants?: InputMaybe; selected?: InputMaybe>>; }; +export type CheckoutProductSellerNode = { + /** The distribution center ID. */ + distributionCenterId?: Maybe; + /** The seller name. */ + sellerName?: Maybe; +}; + +/** Information for the subscription of a product in checkout. */ +export type CheckoutProductSubscription = { + /** The available subscriptions. */ + availableSubscriptions?: Maybe>>; + /** The selected subscription. */ + selected?: Maybe; +}; + +export type CheckoutProductSubscriptionItemNode = { + /** Display text. */ + name?: Maybe; + /** The number of days of the recurring type. */ + recurringDays: Scalars['Int']['output']; + /** The recurring type id. */ + recurringTypeId: Scalars['Long']['output']; + /** If selected. */ + selected: Scalars['Boolean']['output']; + /** Subscription group discount value. */ + subscriptionGroupDiscount: Scalars['Decimal']['output']; + /** The subscription group id. */ + subscriptionGroupId: Scalars['Long']['output']; +}; + +export type CheckoutProductUpdateInput = { + /** The checkout unique identifier. */ + id: Scalars['Uuid']['input']; + /** The checkout product. */ + product: CheckoutProductItemUpdateInput; +}; + +/** The checkout areas available to reset */ +export type CheckoutResetType = + | 'PAYMENT'; + export type CheckoutShippingDeadlineNode = { /** The shipping deadline */ - deadline: Scalars["Int"]["output"]; + deadline: Scalars['Int']['output']; /** The shipping description */ - description?: Maybe; + description?: Maybe; /** The shipping second description */ - secondDescription?: Maybe; + secondDescription?: Maybe; /** The shipping second title */ - secondTitle?: Maybe; + secondTitle?: Maybe; /** The shipping title */ - title?: Maybe; + title?: Maybe; +}; + +export type CheckoutShippingQuoteGroupNode = { + /** The distribution center. */ + distributionCenter?: Maybe; + /** The products related to the shipping quote group. */ + products?: Maybe>>; + /** Selected Shipping. */ + selectedShipping?: Maybe; }; export type CheckoutSubscriptionInput = { - recurringTypeId: Scalars["Int"]["input"]; - subscriptionGroupId: Scalars["Long"]["input"]; + /** The recurring type id. */ + recurringTypeId: Scalars['Int']['input']; + /** The subscription group id. */ + subscriptionGroupId: Scalars['Long']['input']; }; /** Contents are used to show things to the user. */ export type Content = Node & { /** The content in html to be displayed. */ - content?: Maybe; + content?: Maybe; /** Content unique identifier. */ - contentId: Scalars["Long"]["output"]; + contentId: Scalars['Long']['output']; /** The date the content was created. */ - creationDate?: Maybe; + creationDate?: Maybe; /** The content's height in px. */ - height?: Maybe; + height?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The content's position. */ - position?: Maybe; + position?: Maybe; /** A list of terms to display the content on search. */ - searchTerms?: Maybe>>; + searchTerms?: Maybe>>; /** The content's title. */ - title?: Maybe; + title?: Maybe; /** The content's width in px. */ - width?: Maybe; + width?: Maybe; }; /** Define the content attribute which the result set will be sorted on. */ export type ContentSortKeys = /** The content's creation date. */ - | "CreationDate" + | 'CreationDate' /** The content's unique identifier. */ - | "ID"; + | 'ID'; /** A connection to a list of items. */ export type ContentsConnection = { @@ -941,393 +1199,675 @@ export type ContentsConnection = { /** An edge in a connection. */ export type ContentsEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; +/** Input data for submitting a counter offer for a product. */ +export type CounterOfferInput = { + /** Any additional information or comments provided by the user regarding the counter offer. */ + additionalInfo?: InputMaybe; + /** The email address of the user submitting the counter offer. */ + email?: InputMaybe; + /** The proposed price by the user for the product. */ + price: Scalars['Decimal']['input']; + /** The unique identifier of the product variant for which the counter offer is made. */ + productVariantId: Scalars['Long']['input']; + /** URL linking to the page or the location where the product is listed. */ + url?: InputMaybe; +}; + export type CreateCustomerAddressInput = { - addressDetails?: InputMaybe; - addressNumber: Scalars["String"]["input"]; - cep: Scalars["CEP"]["input"]; - city: Scalars["String"]["input"]; - country: Scalars["CountryCode"]["input"]; - email: Scalars["EmailAddress"]["input"]; - name: Scalars["String"]["input"]; - neighborhood: Scalars["String"]["input"]; - phone: Scalars["String"]["input"]; - referencePoint?: InputMaybe; - state: Scalars["String"]["input"]; - street: Scalars["String"]["input"]; + address?: InputMaybe; + address2?: InputMaybe; + addressDetails?: InputMaybe; + addressNumber?: InputMaybe; + cep: Scalars['CEP']['input']; + city: Scalars['String']['input']; + country: Scalars['CountryCode']['input']; + email?: InputMaybe; + name?: InputMaybe; + neighborhood?: InputMaybe; + phone?: InputMaybe; + receiverName?: InputMaybe; + referencePoint?: InputMaybe; + state: Scalars['String']['input']; + street?: InputMaybe; }; /** A customer from the store. */ export type Customer = Node & { + /** A specific customer's address. */ + address?: Maybe; /** Customer's addresses. */ addresses?: Maybe>>; /** Customer's birth date. */ - birthDate: Scalars["DateTime"]["output"]; + birthDate: Scalars['DateTime']['output']; /** Customer's business phone number. */ - businessPhoneNumber?: Maybe; + businessPhoneNumber?: Maybe; + /** Customer's checking account balance. */ + checkingAccountBalance?: Maybe; + /** Customer's checking account History. */ + checkingAccountHistory?: Maybe>>; /** Taxpayer identification number for businesses. */ - cnpj?: Maybe; + cnpj?: Maybe; /** Entities legal name. */ - companyName?: Maybe; + companyName?: Maybe; /** Brazilian individual taxpayer registry identification. */ - cpf?: Maybe; + cpf?: Maybe; /** Creation Date. */ - creationDate: Scalars["DateTime"]["output"]; + creationDate: Scalars['DateTime']['output']; /** Customer's unique identifier. */ - customerId: Scalars["Long"]["output"]; + customerId: Scalars['Long']['output']; /** Customer's name. */ - customerName?: Maybe; + customerName?: Maybe; /** Indicates if it is a natural person or company profile. */ - customerType?: Maybe; + customerType?: Maybe; /** Customer's delivery address. */ deliveryAddress?: Maybe; + /** Customer's digital products. */ + digitalProducts?: Maybe>>; /** Customer's email address. */ - email?: Maybe; + email?: Maybe; /** Customer's gender. */ - gender?: Maybe; + gender?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** Customer information groups. */ informationGroups?: Maybe>>; /** Customer's mobile phone number. */ - mobilePhoneNumber?: Maybe; + mobilePhoneNumber?: Maybe; + /** A specific order placed by the customer. */ + order?: Maybe; /** List of orders placed by the customer. */ orders?: Maybe; /** Statistics about the orders the customer made in a specific timeframe. */ ordersStatistics?: Maybe; /** Get info about the associated partners. */ - partners?: Maybe>>; + partners?: Maybe>>; /** Customer's phone number. */ - phoneNumber?: Maybe; + phoneNumber?: Maybe; /** Customer's residential address. */ residentialAddress?: Maybe; /** Responsible's name. */ - responsibleName?: Maybe; + responsibleName?: Maybe; /** Registration number Id. */ - rg?: Maybe; + rg?: Maybe; /** State registration number. */ - stateRegistration?: Maybe; + stateRegistration?: Maybe; + /** Customer's subscriptions. */ + subscriptions?: Maybe>>; /** Date of the last update. */ - updateDate: Scalars["DateTime"]["output"]; + updateDate: Scalars['DateTime']['output']; /** Customer wishlist. */ wishlist?: Maybe; }; + +/** A customer from the store. */ +export type CustomerAddressArgs = { + addressId: Scalars['ID']['input']; +}; + + +/** A customer from the store. */ +export type CustomerOrderArgs = { + orderId?: Scalars['Long']['input']; +}; + + /** A customer from the store. */ export type CustomerOrdersArgs = { - offset?: InputMaybe; + offset?: InputMaybe; + pageSize?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; }; + /** A customer from the store. */ export type CustomerOrdersStatisticsArgs = { - dateGte?: InputMaybe; - dateLt?: InputMaybe; - onlyPaidOrders?: Scalars["Boolean"]["input"]; - partnerId?: InputMaybe; + dateGte?: InputMaybe; + dateLt?: InputMaybe; + onlyPaidOrders?: Scalars['Boolean']['input']; + partnerId?: InputMaybe; }; + /** A customer from the store. */ export type CustomerWishlistArgs = { - productsIds?: InputMaybe>>; + productsIds?: InputMaybe>>; }; export type CustomerAccessToken = { - isMaster: Scalars["Boolean"]["output"]; - token?: Maybe; + isMaster: Scalars['Boolean']['output']; + legacyToken?: Maybe; + token?: Maybe; /** The user login type */ type?: Maybe; - validUntil: Scalars["DateTime"]["output"]; + validUntil: Scalars['DateTime']['output']; +}; + +export type CustomerAccessTokenDetails = { + /** The customer id */ + customerId: Scalars['Long']['output']; + /** The identifier linked to the access token */ + identifier?: Maybe; + /** Specifies whether the user is a master user */ + isMaster: Scalars['Boolean']['output']; + /** The user login origin */ + origin?: Maybe; + /** The user login type */ + type?: Maybe; + validUntil: Scalars['DateTime']['output']; }; /** The input to authenticate a user. */ export type CustomerAccessTokenInput = { - email: Scalars["String"]["input"]; - password: Scalars["String"]["input"]; + email: Scalars['String']['input']; + password: Scalars['String']['input']; }; export type CustomerAddressNode = Node & { + /** Address street. */ + address?: Maybe; + /** Address street 2. */ + address2?: Maybe; /** Address details. */ - addressDetails?: Maybe; + addressDetails?: Maybe; /** Address number. */ - addressNumber?: Maybe; + addressNumber?: Maybe; /** zip code. */ - cep?: Maybe; + cep?: Maybe; /** address city. */ - city?: Maybe; + city?: Maybe; /** Country. */ - country?: Maybe; + country?: Maybe; /** The email of the customer address. */ - email?: Maybe; + email?: Maybe; /** The node unique identifier. */ - id?: Maybe; - /** The name of the customer address. */ - name?: Maybe; + id?: Maybe; + /** + * The name of the customer address. + * @deprecated Use the 'receiverName' field to get the receiver name. + */ + name?: Maybe; /** Address neighborhood. */ - neighborhood?: Maybe; + neighborhood?: Maybe; /** The phone of the customer address. */ - phone?: Maybe; + phone?: Maybe; + /** The name of the customer address. */ + receiverName?: Maybe; /** Address reference point. */ - referencePoint?: Maybe; + referencePoint?: Maybe; /** State. */ - state?: Maybe; - /** Address street. */ - street?: Maybe; + state?: Maybe; + /** + * Address street. + * @deprecated Use the 'address' field to get the address. + */ + street?: Maybe; +}; + +/** The input to authenticate a user. */ +export type CustomerAuthenticateInput = { + input: Scalars['String']['input']; + password: Scalars['String']['input']; +}; + +export type CustomerCheckingAccountHistoryNode = { + /** Customer's checking account history date. */ + date: Scalars['DateTime']['output']; + /** Description of the customer's checking account history. */ + historic?: Maybe; + /** Type of customer's checking account history. */ + type: TypeCheckingAccount; + /** Value of customer's checking account history. */ + value: Scalars['Decimal']['output']; }; export type CustomerCreateInput = { /** The street address for the registered address. */ - address?: InputMaybe; + address?: InputMaybe; /** The street address for the registered address. */ - address2?: InputMaybe; + address2?: InputMaybe; /** Any additional information related to the registered address. */ - addressComplement?: InputMaybe; + addressComplement?: InputMaybe; /** The building number for the registered address. */ - addressNumber?: InputMaybe; + addressNumber?: InputMaybe; /** The date of birth of the customer. */ - birthDate?: InputMaybe; + birthDate?: InputMaybe; /** The CEP for the registered address. */ - cep?: InputMaybe; + cep?: InputMaybe; /** The city for the registered address. */ - city?: InputMaybe; + city?: InputMaybe; /** The Brazilian tax identification number for corporations. */ - cnpj?: InputMaybe; + cnpj?: InputMaybe; /** The legal name of the corporate customer. */ - corporateName?: InputMaybe; + corporateName?: InputMaybe; /** The country for the registered address. */ - country?: InputMaybe; + country?: InputMaybe; /** The Brazilian tax identification number for individuals. */ - cpf?: InputMaybe; + cpf?: InputMaybe; /** Indicates if it is a natural person or company profile. */ customerType: EntityType; /** The email of the customer. */ - email?: InputMaybe; + email?: InputMaybe; /** The full name of the customer. */ - fullName?: InputMaybe; + fullName?: InputMaybe; /** The gender of the customer. */ gender?: InputMaybe; + /** The customer information group values. */ + informationGroupValues?: InputMaybe>>; /** Indicates if the customer is state registration exempt. */ - isStateRegistrationExempt?: InputMaybe; + isStateRegistrationExempt?: InputMaybe; /** The neighborhood for the registered address. */ - neighborhood?: InputMaybe; + neighborhood?: InputMaybe; /** Indicates if the customer has subscribed to the newsletter. */ - newsletter?: InputMaybe; + newsletter?: InputMaybe; /** The password for the customer's account. */ - password?: InputMaybe; + password?: InputMaybe; /** The password confirmation for the customer's account. */ - passwordConfirmation?: InputMaybe; + passwordConfirmation?: InputMaybe; /** The area code for the customer's primary phone number. */ - primaryPhoneAreaCode?: InputMaybe; + primaryPhoneAreaCode?: InputMaybe; /** The customer's primary phone number. */ - primaryPhoneNumber?: InputMaybe; + primaryPhoneNumber?: InputMaybe; /** The name of the receiver for the registered address. */ - receiverName?: InputMaybe; + receiverName?: InputMaybe; /** A reference point or description to help locate the registered address. */ - reference?: InputMaybe; + reference?: InputMaybe; /** Indicates if the customer is a reseller. */ - reseller?: InputMaybe; + reseller?: InputMaybe; /** The area code for the customer's secondary phone number. */ - secondaryPhoneAreaCode?: InputMaybe; + secondaryPhoneAreaCode?: InputMaybe; /** The customer's secondary phone number. */ - secondaryPhoneNumber?: InputMaybe; + secondaryPhoneNumber?: InputMaybe; /** The state for the registered address. */ - state?: InputMaybe; + state?: InputMaybe; /** The state registration number for businesses. */ - stateRegistration?: InputMaybe; + stateRegistration?: InputMaybe; }; /** The input to change the user email. */ export type CustomerEmailChangeInput = { /** The new email. */ - newEmail: Scalars["String"]["input"]; + newEmail: Scalars['String']['input']; }; export type CustomerInformationGroupFieldNode = { /** The field name. */ - name?: Maybe; + name?: Maybe; /** The field order. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; /** If the field is required. */ - required: Scalars["Boolean"]["output"]; + required: Scalars['Boolean']['output']; /** The field value. */ - value?: Maybe; + value?: Maybe; }; export type CustomerInformationGroupNode = { /** The group exibition name. */ - exibitionName?: Maybe; + exibitionName?: Maybe; /** The group fields. */ fields?: Maybe>>; /** The group name. */ - name?: Maybe; + name?: Maybe; }; export type CustomerOrderCollectionSegment = { items?: Maybe>>; - page: Scalars["Int"]["output"]; - pageSize: Scalars["Int"]["output"]; - totalCount: Scalars["Int"]["output"]; + page: Scalars['Int']['output']; + pageSize: Scalars['Int']['output']; + totalCount: Scalars['Int']['output']; }; /** Define the order attribute which the result set will be sorted on. */ export type CustomerOrderSortKeys = /** The total order value. */ - | "AMOUNT" + | 'AMOUNT' /** The date the order was placed. */ - | "DATE" + | 'DATE' /** The order ID. */ - | "ID" + | 'ID' /** The order current status. */ - | "STATUS"; + | 'STATUS'; export type CustomerOrdersStatistics = { /** The number of products the customer made from the number of orders. */ - productsQuantity: Scalars["Int"]["output"]; + productsQuantity: Scalars['Int']['output']; /** The number of orders the customer made. */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; }; -export type CustomerPartnerNode = { - /** The partner alias. */ - alias?: Maybe; - /** The partner's name. */ - name?: Maybe; - /** The partner's access token. */ - partnerAccessToken?: Maybe; +/** The input to change the user password by recovery. */ +export type CustomerPasswordChangeByRecoveryInput = { + /** Key generated for password recovery. */ + key: Scalars['String']['input']; + /** The new password. */ + newPassword: Scalars['String']['input']; + /** New password confirmation. */ + newPasswordConfirmation: Scalars['String']['input']; }; /** The input to change the user password. */ -export type CustomerPasswordChangeInputGraphInput = { +export type CustomerPasswordChangeInput = { /** The current password. */ - currentPassword: Scalars["String"]["input"]; + currentPassword: Scalars['String']['input']; /** The new password. */ - newPassword: Scalars["String"]["input"]; + newPassword: Scalars['String']['input']; + /** New password confirmation. */ + newPasswordConfirmation: Scalars['String']['input']; }; export type CustomerSimpleCreateInputGraphInput = { /** The date of birth of the customer. */ - birthDate?: InputMaybe; + birthDate?: InputMaybe; /** The Brazilian tax identification number for corporations. */ - cnpj?: InputMaybe; + cnpj?: InputMaybe; /** The legal name of the corporate customer. */ - corporateName?: InputMaybe; + corporateName?: InputMaybe; /** The Brazilian tax identification number for individuals. */ - cpf?: InputMaybe; + cpf?: InputMaybe; /** Indicates if it is a natural person or company profile. */ customerType: EntityType; /** The email of the customer. */ - email?: InputMaybe; + email?: InputMaybe; /** The full name of the customer. */ - fullName?: InputMaybe; + fullName?: InputMaybe; /** Indicates if the customer is state registration exempt. */ - isStateRegistrationExempt?: InputMaybe; + isStateRegistrationExempt?: InputMaybe; /** The area code for the customer's primary phone number. */ - primaryPhoneAreaCode?: InputMaybe; + primaryPhoneAreaCode?: InputMaybe; /** The customer's primary phone number. */ - primaryPhoneNumber?: InputMaybe; + primaryPhoneNumber?: InputMaybe; /** The state registration number for businesses. */ - stateRegistration?: InputMaybe; + stateRegistration?: InputMaybe; +}; + +export type CustomerSubscription = { + /** Subscription billing address. */ + billingAddress?: Maybe; + /** The date when the subscription was cancelled. */ + cancellationDate?: Maybe; + /** The coupon code applied to the subscription. */ + coupon?: Maybe; + /** The date of the subscription. */ + date: Scalars['DateTime']['output']; + /** Subscription delivery address. */ + deliveryAddress?: Maybe; + /** The date of intercalated recurring payments. */ + intercalatedRecurrenceDate?: Maybe; + /** The date of the next recurring payment. */ + nextRecurrenceDate?: Maybe; + /** Subscription orders. */ + orders?: Maybe>>; + /** The date when the subscription was paused. */ + pauseDate?: Maybe; + /** The payment details for the subscription. */ + payment?: Maybe; + /** The list of products associated with the subscription. */ + products?: Maybe>>; + /** The details of the recurring subscription. */ + recurring?: Maybe; + /** The subscription status. */ + status?: Maybe; + /** The subscription group id. */ + subscriptionGroupId: Scalars['Long']['output']; + /** Subscription unique identifier. */ + subscriptionId: Scalars['Long']['output']; +}; + +export type CustomerSubscriptionPayment = { + /** The details of the payment card associated with the subscription. */ + card?: Maybe; + /** The type of payment for the subscription. */ + type?: Maybe; +}; + +export type CustomerSubscriptionPaymentCard = { + /** The brand of the payment card (e.g., Visa, MasterCard). */ + brand?: Maybe; + /** The expiration date of the payment card. */ + expiration?: Maybe; + /** The masked or truncated number of the payment card. */ + number?: Maybe; +}; + +export type CustomerSubscriptionProduct = { + /** The id of the product variant associated with the subscription. */ + productVariantId: Scalars['Long']['output']; + /** The quantity of the product variant in the subscription. */ + quantity: Scalars['Int']['output']; + /** Indicates whether the product variant is removed from the subscription. */ + removed: Scalars['Boolean']['output']; + /** The id of the subscription product. */ + subscriptionProductId: Scalars['Long']['output']; + /** The monetary value of the product variant in the subscription. */ + value: Scalars['Decimal']['output']; +}; + +export type CustomerSubscriptionRecurring = { + /** The number of days between recurring payments. */ + days: Scalars['Int']['output']; + /** The description of the recurring subscription. */ + description?: Maybe; + /** The name of the recurring subscription. */ + name?: Maybe; + /** The recurring subscription id. */ + recurringId: Scalars['Long']['output']; + /** Indicates whether the recurring subscription is removed. */ + removed: Scalars['Boolean']['output']; }; export type CustomerUpdateInput = { /** The date of birth of the customer. */ - birthDate?: InputMaybe; - /** The Brazilian tax identification number for corporations. */ - cnpj?: InputMaybe; + birthDate?: InputMaybe; /** The legal name of the corporate customer. */ - corporateName?: InputMaybe; - /** The Brazilian tax identification number for individuals. */ - cpf?: InputMaybe; - /** Indicates if it is a natural person or company profile. */ - customerType: EntityType; + corporateName?: InputMaybe; /** The full name of the customer. */ - fullName?: InputMaybe; + fullName?: InputMaybe; /** The gender of the customer. */ gender?: InputMaybe; - /** The area code for the customer's primary phone number. */ - primaryPhoneAreaCode?: InputMaybe; + /** The customer information group values. */ + informationGroupValues?: InputMaybe>>; + /** The customer's primary phone number. */ + primaryPhoneNumber?: InputMaybe; /** The customer's primary phone number. */ - primaryPhoneNumber?: InputMaybe; + primaryPhoneNumberInternational?: InputMaybe; /** The Brazilian register identification number for individuals. */ - rg?: InputMaybe; - /** The area code for the customer's secondary phone number. */ - secondaryPhoneAreaCode?: InputMaybe; + rg?: InputMaybe; + /** The customer's secondary phone number. */ + secondaryPhoneNumber?: InputMaybe; /** The customer's secondary phone number. */ - secondaryPhoneNumber?: InputMaybe; + secondaryPhoneNumberInternational?: InputMaybe; /** The state registration number for businesses. */ - stateRegistration?: InputMaybe; + stateRegistration?: InputMaybe; }; /** Some products can have customizations, such as writing your name on it or other predefined options. */ export type Customization = Node & { /** Cost of customization. */ - cost: Scalars["Decimal"]["output"]; + cost: Scalars['Decimal']['output']; /** Customization unique identifier. */ - customizationId: Scalars["Long"]["output"]; + customizationId: Scalars['Long']['output']; /** Customization group's name. */ - groupName?: Maybe; + groupName?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** Maximum allowed size of the field. */ - maxLength: Scalars["Int"]["output"]; + maxLength: Scalars['Int']['output']; /** The customization's name. */ - name?: Maybe; + name?: Maybe; /** Priority order of customization. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; + /** Customization is required. */ + required: Scalars['Boolean']['output']; /** Type of customization. */ - type?: Maybe; + type?: Maybe; /** Value of customization. */ - values?: Maybe>>; + values?: Maybe>>; +}; + +/** Deadline alert informations. */ +export type DeadlineAlert = { + /** Deadline alert time */ + deadline?: Maybe; + /** Deadline alert description */ + description?: Maybe; + /** Second deadline alert time */ + secondDeadline?: Maybe; + /** Second deadline alert description */ + secondDescription?: Maybe; + /** Second deadline alert title */ + secondTitle?: Maybe; + /** Deadline alert title */ + title?: Maybe; }; /** The delivery schedule detail. */ export type DeliveryScheduleDetail = { /** The date of the delivery schedule. */ - date?: Maybe; + date?: Maybe; /** The end date and time of the delivery schedule. */ - endDateTime: Scalars["DateTime"]["output"]; + endDateTime: Scalars['DateTime']['output']; /** The end time of the delivery schedule. */ - endTime?: Maybe; + endTime?: Maybe; /** The start date and time of the delivery schedule. */ - startDateTime: Scalars["DateTime"]["output"]; + startDateTime: Scalars['DateTime']['output']; /** The start time of the delivery schedule. */ - startTime?: Maybe; + startTime?: Maybe; }; /** Input for delivery scheduling. */ export type DeliveryScheduleInput = { /** The date. */ - date: Scalars["DateTime"]["input"]; + date: Scalars['DateTime']['input']; /** The period ID. */ - periodId: Scalars["Long"]["input"]; + periodId: Scalars['Long']['input']; +}; + +/** A distribution center. */ +export type DistributionCenter = { + /** The distribution center unique identifier. */ + id?: Maybe; + /** The distribution center seller name. */ + sellerName?: Maybe; }; /** Define the entity type of the customer registration. */ export type EntityType = /** Legal entity, a company, business, organization. */ - | "COMPANY" + | 'COMPANY' /** An international person, a legal international entity. */ - | "INTERNATIONAL" + | 'INTERNATIONAL' /** An individual person, a physical person. */ - | "PERSON"; + | 'PERSON'; + +export type EnumInformationGroup = + | 'NEWSLETTER' + | 'PESSOA_FISICA' + | 'PESSOA_JURIDICA'; + +/** Represents a list of events with their details. */ +export type EventList = { + /** URL of the event's cover image */ + coverUrl?: Maybe; + /** Date of the event */ + date?: Maybe; + /** Type of the event */ + eventType?: Maybe; + /** Indicates if the token is from the owner of this event list */ + isOwner: Scalars['Boolean']['output']; + /** URL of the event's logo */ + logoUrl?: Maybe; + /** Name of the event owner */ + ownerName?: Maybe; + /** A list of products associated with the event. */ + products?: Maybe>>; + /** Event title */ + title?: Maybe; + /** URL of the event */ + url?: Maybe; +}; + +export type EventListAddProductInput = { + /** The unique identifier of the product variant. */ + productVariantId: Scalars['Long']['input']; + /** The quantity of the product to be added. */ + quantity: Scalars['Int']['input']; +}; + +/** Represents a list of store events. */ +export type EventListStore = { + /** Date of the event */ + date?: Maybe; + /** Event type name of the event */ + eventType?: Maybe; + /** URL of the event's logo */ + logoUrl?: Maybe; + /** The name of the event. */ + name?: Maybe; + /** The URL of the event. */ + url?: Maybe; +}; + +/** Represents a list of events types. */ +export type EventListType = { + /** The URL of the event's logo. */ + logoUrl?: Maybe; + /** The name of the event. */ + name?: Maybe; + /** The URL path of the event. */ + urlPath?: Maybe; +}; export type FilterPosition = /** Both filter position. */ - | "BOTH" + | 'BOTH' /** Horizontal filter position. */ - | "HORIZONTAL" + | 'HORIZONTAL' /** Vertical filter position. */ - | "VERTICAL"; + | 'VERTICAL'; + +export type FriendRecommendInput = { + /** The buy list id */ + buyListId?: InputMaybe; + /** Email of who is recommending a product */ + fromEmail: Scalars['String']['input']; + /** Who is recommending */ + fromName: Scalars['String']['input']; + /** The message */ + message?: InputMaybe; + /** The Product Id */ + productId?: InputMaybe; + /** Email of the person who will receive a product recommendation */ + toEmail: Scalars['String']['input']; + /** Name of the person who will receive a product recommendation */ + toName: Scalars['String']['input']; +}; /** The customer's gender. */ export type Gender = - | "FEMALE" - | "MALE"; + | 'FEMALE' + | 'MALE'; + +/** The shipping quotes for group. */ +export type GroupShippingQuote = { + /** The shipping deadline. */ + deadline: Scalars['Int']['output']; + /** The shipping deadline, in hours. */ + deadlineInHours?: Maybe; + /** The shipping name. */ + name?: Maybe; + /** The shipping quote unique identifier. */ + shippingQuoteId: Scalars['Uuid']['output']; + /** The shipping type. */ + type?: Maybe; + /** The shipping value. */ + value: Scalars['Float']['output']; +}; /** A hotsite is a group of products used to organize them or to make them easier to browse. */ export type Hotsite = Node & { @@ -1336,37 +1876,38 @@ export type Hotsite = Node & { /** A list of contents associated with the hotsite. */ contents?: Maybe>>; /** The hotsite will be displayed until this date. */ - endDate?: Maybe; + endDate?: Maybe; /** Expression used to associate products to the hotsite. */ - expression?: Maybe; + expression?: Maybe; /** Hotsite unique identifier. */ - hotsiteId: Scalars["Long"]["output"]; + hotsiteId: Scalars['Long']['output']; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The hotsite's name. */ - name?: Maybe; + name?: Maybe; /** Set the quantity of products displayed per page. */ - pageSize: Scalars["Int"]["output"]; + pageSize: Scalars['Int']['output']; /** A list of products associated with the hotsite. */ products?: Maybe; /** Sorting information to be used by default on the hotsite. */ sorting?: Maybe; /** The hotsite will be displayed from this date. */ - startDate?: Maybe; + startDate?: Maybe; /** The subtype of the hotsite. */ subtype?: Maybe; /** The template used for the hotsite. */ - template?: Maybe; + template?: Maybe; /** The hotsite's URL. */ - url?: Maybe; + url?: Maybe; }; + /** A hotsite is a group of products used to organize them or to make them easier to browse. */ export type HotsiteProductsArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; }; @@ -1374,11 +1915,11 @@ export type HotsiteProductsArgs = { /** Define the hotsite attribute which the result set will be sorted on. */ export type HotsiteSortKeys = /** The hotsite id. */ - | "ID" + | 'ID' /** The hotsite name. */ - | "NAME" + | 'NAME' /** The hotsite url. */ - | "URL"; + | 'URL'; export type HotsiteSorting = { direction?: Maybe; @@ -1387,13 +1928,13 @@ export type HotsiteSorting = { export type HotsiteSubtype = /** Hotsite created from a brand. */ - | "BRAND" + | 'BRAND' /** Hotsite created from a buy list (lista de compra). */ - | "BUY_LIST" + | 'BUY_LIST' /** Hotsite created from a category. */ - | "CATEGORY" + | 'CATEGORY' /** Hotsite created from a portfolio. */ - | "PORTFOLIO"; + | 'PORTFOLIO'; /** A connection to a list of items. */ export type HotsitesConnection = { @@ -1408,7 +1949,7 @@ export type HotsitesConnection = { /** An edge in a connection. */ export type HotsitesEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; @@ -1416,165 +1957,174 @@ export type HotsitesEdge = { /** Informations about an image of a product. */ export type Image = { /** The name of the image file. */ - fileName?: Maybe; + fileName?: Maybe; /** Check if the image is used for the product main image. */ - mini: Scalars["Boolean"]["output"]; + mini: Scalars['Boolean']['output']; /** Numeric order the image should be displayed. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; /** Check if the image is used for the product prints only. */ - print: Scalars["Boolean"]["output"]; + print: Scalars['Boolean']['output']; /** The url to retrieve the image */ - url?: Maybe; + url?: Maybe; }; /** The additional information about in-store pickup */ export type InStorePickupAdditionalInformationInput = { /** The document */ - document?: InputMaybe; + document?: InputMaybe; /** The name */ - name?: InputMaybe; + name?: InputMaybe; }; /** Information registred to the product. */ export type Information = { /** The information id. */ - id: Scalars["Long"]["output"]; + id: Scalars['Long']['output']; /** The information title. */ - title?: Maybe; + title?: Maybe; /** The information type. */ - type?: Maybe; + type?: Maybe; /** The information value. */ - value?: Maybe; + value?: Maybe; }; export type InformationGroupFieldNode = Node & { /** The information group field display type. */ - displayType?: Maybe; + displayType?: Maybe; /** The information group field name. */ - fieldName?: Maybe; + fieldName?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The information group field order. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; /** If the information group field is required. */ - required: Scalars["Boolean"]["output"]; + required: Scalars['Boolean']['output']; /** The information group field preset values. */ values?: Maybe>>; }; export type InformationGroupFieldValueNode = { /** The information group field value order. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; /** The information group field value. */ - value?: Maybe; + value?: Maybe; }; export type InformationGroupValueInput = { /** The information group field unique identifier. */ - id?: InputMaybe; + id?: InputMaybe; /** The information group field value. */ - value?: InputMaybe; + value?: InputMaybe; }; export type Installment = { /** Wether the installment has discount. */ - discount: Scalars["Boolean"]["output"]; + discount: Scalars['Boolean']['output']; /** Wether the installment has fees. */ - fees: Scalars["Boolean"]["output"]; + fees: Scalars['Boolean']['output']; /** The number of installments. */ - number: Scalars["Int"]["output"]; + number: Scalars['Int']['output']; /** The value of the installment. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; }; export type InstallmentPlan = { /** The custom display name of this installment plan. */ - displayName?: Maybe; + displayName?: Maybe; /** List of the installments. */ installments?: Maybe>>; /** The name of this installment plan. */ - name?: Maybe; + name?: Maybe; }; +/** The user login origin. */ +export type LoginOrigin = + | 'SIMPLE' + | 'SOCIAL'; + /** The user login type. */ export type LoginType = - | "AUTHENTICATED" - | "NEW" - | "SIMPLE"; + | 'AUTHENTICATED' + | 'NEW' + | 'SIMPLE'; /** Informations about menu items. */ export type Menu = Node & { /** Menu css class to apply. */ - cssClass?: Maybe; + cssClass?: Maybe; /** The full image URL. */ - fullImageUrl?: Maybe; + fullImageUrl?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** Menu image url address. */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** Menu hierarchy level. */ - level: Scalars["Int"]["output"]; + level: Scalars['Int']['output']; /** Menu link address. */ - link?: Maybe; + link?: Maybe; /** Menu group identifier. */ - menuGroupId: Scalars["Int"]["output"]; + menuGroupId: Scalars['Int']['output']; /** Menu identifier. */ - menuId: Scalars["Int"]["output"]; + menuId: Scalars['Int']['output']; /** Menu name. */ - name: Scalars["String"]["output"]; + name: Scalars['String']['output']; /** Menu hierarchy level. */ - openNewTab: Scalars["Boolean"]["output"]; + openNewTab: Scalars['Boolean']['output']; /** Menu position order. */ - order: Scalars["Int"]["output"]; + order: Scalars['Int']['output']; /** Parent menu identifier. */ - parentMenuId?: Maybe; + parentMenuId?: Maybe; /** Menu extra text. */ - text?: Maybe; + text?: Maybe; }; + /** Informations about menu items. */ export type MenuFullImageUrlArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Informations about menu groups. */ export type MenuGroup = Node & { /** The full image URL. */ - fullImageUrl?: Maybe; + fullImageUrl?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** Menu group image url. */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** Menu group identifier. */ - menuGroupId: Scalars["Int"]["output"]; + menuGroupId: Scalars['Int']['output']; /** List of menus associated with the current group */ menus?: Maybe>>; /** Menu group name. */ - name?: Maybe; + name?: Maybe; /** Menu group partner id. */ - partnerId?: Maybe; + partnerId?: Maybe; /** Menu group position. */ - position?: Maybe; + position?: Maybe; }; + /** Informations about menu groups. */ export type MenuGroupFullImageUrlArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Some products can have metadata, like diferent types of custom information. A basic key value pair. */ export type Metadata = { /** Metadata key. */ - key?: Maybe; + key?: Maybe; /** Metadata value. */ - value?: Maybe; + value?: Maybe; }; export type Mutation = { /** Add coupon to checkout */ checkoutAddCoupon?: Maybe; + /** Add kit to an existing checkout */ + checkoutAddKit?: Maybe; /** Add metadata to checkout */ checkoutAddMetadata?: Maybe; /** Add metadata to a checkout product */ @@ -1589,20 +2139,38 @@ export type Mutation = { checkoutComplete?: Maybe; /** Associate the customer with a checkout. */ checkoutCustomerAssociate?: Maybe; + /** Delete a suggested card */ + checkoutDeleteSuggestedCard?: Maybe; /** Selects the variant of a gift product */ checkoutGiftVariantSelection?: Maybe; /** Associate the partner with a checkout. */ checkoutPartnerAssociate?: Maybe; - /** Add coupon to checkout */ + /** Disassociates the checkout from the partner and returns a new checkout. */ + checkoutPartnerDisassociate?: Maybe; + /** Remove coupon to checkout */ checkoutRemoveCoupon?: Maybe; + /** Remove kit from an existing checkout */ + checkoutRemoveKit?: Maybe; + /** Removes metadata keys from a checkout */ + checkoutRemoveMetadata?: Maybe; /** Remove products from an existing checkout */ checkoutRemoveProduct?: Maybe; + /** Remove Customization to Checkout */ + checkoutRemoveProductCustomization?: Maybe; + /** Remove Subscription to Checkout */ + checkoutRemoveProductSubscription?: Maybe; + /** Resets a specific area of a checkout */ + checkoutReset?: Maybe; /** Select installment. */ checkoutSelectInstallment?: Maybe; /** Select payment method. */ checkoutSelectPaymentMethod?: Maybe; /** Select shipping quote */ checkoutSelectShippingQuote?: Maybe; + /** Update a product of an existing checkout */ + checkoutUpdateProduct?: Maybe; + /** Use balance checking account checkout */ + checkoutUseCheckingAccount?: Maybe; /** Create a new checkout */ createCheckout?: Maybe; /** Register an email in the newsletter. */ @@ -1611,14 +2179,21 @@ export type Mutation = { createProductReview?: Maybe; /** Record a searched term for admin reports */ createSearchTermRecord?: Maybe; - /** Creates a new customer access token with an expiration time. */ + /** + * Creates a new customer access token with an expiration time. + * @deprecated Use the CustomerAuthenticatedLogin mutation. + */ customerAccessTokenCreate?: Maybe; /** Renews the expiration time of a customer access token. The token must not be expired. */ customerAccessTokenRenew?: Maybe; /** Create an address. */ customerAddressCreate?: Maybe; + /** Delete an existing address, if it is not the only registered address */ + customerAddressRemove?: Maybe; /** Change an existing address */ customerAddressUpdate?: Maybe; + /** Creates a new customer access token with an expiration time. */ + customerAuthenticatedLogin?: Maybe; /** Allows the user to complete the required information for a partial registration. */ customerCompletePartialRegistration?: Maybe; /** Creates a new customer register. */ @@ -1629,6 +2204,8 @@ export type Mutation = { customerImpersonate?: Maybe; /** Changes user password. */ customerPasswordChange?: Maybe; + /** Change user password by recovery. */ + customerPasswordChangeByRecovery?: Maybe; /** Sends a password recovery email to the user. */ customerPasswordRecovery?: Maybe; /** Returns the user associated with a simple login (CPF or Email) if exists, else return a New user. */ @@ -1639,10 +2216,26 @@ export type Mutation = { customerSocialLoginFacebook?: Maybe; /** Returns the user associated with a Google account if exists, else return a New user. */ customerSocialLoginGoogle?: Maybe; + /** Allows a customer to change the delivery address for an existing subscription. */ + customerSubscriptionAddressChange?: Maybe; + /** Add products to an existing subscription */ + customerSubscriptionProductAdd?: Maybe; + /** Remove products to an existing subscription */ + customerSubscriptionProductRemove?: Maybe; + /** Allows a customer to change an existing subscription status. */ + customerSubscriptionUpdateStatus?: Maybe; /** Updates a customer register. */ customerUpdate?: Maybe; + /** Adds products to the event list. */ + eventListAddProduct?: Maybe; + /** Allows changing the payment method of a specific order */ + orderChangePayment?: Maybe; /** Creates a new closed scope partner access token with an expiration time. */ partnerAccessTokenCreate?: Maybe; + /** Submits a counteroffer for a product. */ + productCounterOfferSubmit?: Maybe; + /** Mutation to recommend a product to a friend */ + productFriendRecommend?: Maybe; /** Add a price alert. */ productPriceAlert?: Maybe; /** Creates an alert to notify when the product is back in stock. */ @@ -1660,367 +2253,634 @@ export type Mutation = { wishlistRemoveProduct?: Maybe>>; }; + export type MutationCheckoutAddCouponArgs = { - checkoutId: Scalars["Uuid"]["input"]; - coupon: Scalars["String"]["input"]; - customerAccessToken?: InputMaybe; - recaptchaToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + coupon: Scalars['String']['input']; + customerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCheckoutAddKitArgs = { + customerAccessToken?: InputMaybe; + input: CheckoutKitInput; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutAddMetadataArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; metadata: Array>; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutAddMetadataForProductVariantArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; metadata: Array>; - productVariantId: Scalars["Long"]["input"]; + productVariantId: Scalars['Long']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutAddProductArgs = { - customerAccessToken?: InputMaybe; + customerAccessToken?: InputMaybe; input: CheckoutProductInput; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutAddressAssociateArgs = { - addressId: Scalars["ID"]["input"]; - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken: Scalars["String"]["input"]; + addressId: Scalars['ID']['input']; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutCloneArgs = { - checkoutId: Scalars["Uuid"]["input"]; - copyUser?: Scalars["Boolean"]["input"]; - customerAccessToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + copyUser?: Scalars['Boolean']['input']; + customerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutCompleteArgs = { - checkoutId: Scalars["Uuid"]["input"]; - comments?: InputMaybe; - customerAccessToken?: InputMaybe; - paymentData: Scalars["String"]["input"]; - recaptchaToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + comments?: InputMaybe; + customerAccessToken?: InputMaybe; + paymentData: Scalars['String']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutCustomerAssociateArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken: Scalars["String"]["input"]; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; }; + +export type MutationCheckoutDeleteSuggestedCardArgs = { + cardKey: Scalars['String']['input']; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken: Scalars['String']['input']; + paymentMethodId: Scalars['ID']['input']; + recaptchaToken?: InputMaybe; +}; + + export type MutationCheckoutGiftVariantSelectionArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; - productVariantId: Scalars["Long"]["input"]; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + productVariantId: Scalars['Long']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutPartnerAssociateArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; - partnerAccessToken: Scalars["String"]["input"]; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + partnerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCheckoutPartnerDisassociateArgs = { + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutRemoveCouponArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + +export type MutationCheckoutRemoveKitArgs = { + customerAccessToken?: InputMaybe; + input: CheckoutKitInput; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCheckoutRemoveMetadataArgs = { + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + keys: Array>; + recaptchaToken?: InputMaybe; +}; + + export type MutationCheckoutRemoveProductArgs = { - customerAccessToken?: InputMaybe; + customerAccessToken?: InputMaybe; input: CheckoutProductInput; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCheckoutRemoveProductCustomizationArgs = { + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + customizationId: Scalars['ID']['input']; + productVariantId: Scalars['Long']['input']; + recaptchaToken?: InputMaybe; }; + +export type MutationCheckoutRemoveProductSubscriptionArgs = { + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + productVariantId: Scalars['Long']['input']; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCheckoutResetArgs = { + checkoutId: Scalars['Uuid']['input']; + recaptchaToken?: InputMaybe; + types: Array; +}; + + export type MutationCheckoutSelectInstallmentArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; - installmentNumber: Scalars["Int"]["input"]; - selectedPaymentMethodId: Scalars["Uuid"]["input"]; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + installmentNumber: Scalars['Int']['input']; + orderId?: InputMaybe; + recaptchaToken?: InputMaybe; + selectedPaymentMethodId: Scalars['Uuid']['input']; }; + export type MutationCheckoutSelectPaymentMethodArgs = { - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; - paymentMethodId: Scalars["ID"]["input"]; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + orderId?: InputMaybe; + paymentMethodId: Scalars['ID']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCheckoutSelectShippingQuoteArgs = { additionalInformation?: InputMaybe; - checkoutId: Scalars["Uuid"]["input"]; - customerAccessToken?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; deliveryScheduleInput?: InputMaybe; - shippingQuoteId: Scalars["Uuid"]["input"]; + distributionCenterId?: InputMaybe; + recaptchaToken?: InputMaybe; + shippingQuoteId: Scalars['Uuid']['input']; +}; + + +export type MutationCheckoutUpdateProductArgs = { + customerAccessToken?: InputMaybe; + input: CheckoutProductUpdateInput; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCheckoutUseCheckingAccountArgs = { + checkoutId: Scalars['Uuid']['input']; + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; + useBalance: Scalars['Boolean']['input']; }; + export type MutationCreateCheckoutArgs = { products?: InputMaybe>>; + recaptchaToken?: InputMaybe; }; + export type MutationCreateNewsletterRegisterArgs = { input: NewsletterInput; + recaptchaToken?: InputMaybe; }; + export type MutationCreateProductReviewArgs = { input: ReviewCreateInput; + recaptchaToken?: InputMaybe; }; + export type MutationCreateSearchTermRecordArgs = { input: SearchRecordInput; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerAccessTokenCreateArgs = { input: CustomerAccessTokenInput; - recaptchaToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerAccessTokenRenewArgs = { - customerAccessToken: Scalars["String"]["input"]; + customerAccessToken: Scalars['String']['input']; }; + export type MutationCustomerAddressCreateArgs = { address: CreateCustomerAddressInput; - customerAccessToken: Scalars["String"]["input"]; + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCustomerAddressRemoveArgs = { + customerAccessToken: Scalars['String']['input']; + id: Scalars['ID']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerAddressUpdateArgs = { address: UpdateCustomerAddressInput; - customerAccessToken: Scalars["String"]["input"]; - id: Scalars["ID"]["input"]; + customerAccessToken: Scalars['String']['input']; + id: Scalars['ID']['input']; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCustomerAuthenticatedLoginArgs = { + input: CustomerAuthenticateInput; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerCompletePartialRegistrationArgs = { - customerAccessToken: Scalars["String"]["input"]; + customerAccessToken: Scalars['String']['input']; input?: InputMaybe; - recaptchaToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerCreateArgs = { input?: InputMaybe; - recaptchaToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerEmailChangeArgs = { - customerAccessToken: Scalars["String"]["input"]; + customerAccessToken: Scalars['String']['input']; input?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerImpersonateArgs = { - customerAccessToken: Scalars["String"]["input"]; - input: Scalars["String"]["input"]; + customerAccessToken: Scalars['String']['input']; + input: Scalars['String']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerPasswordChangeArgs = { - customerAccessToken: Scalars["String"]["input"]; - input?: InputMaybe; - recaptchaToken?: InputMaybe; + customerAccessToken: Scalars['String']['input']; + input?: InputMaybe; + recaptchaToken?: InputMaybe; +}; + + +export type MutationCustomerPasswordChangeByRecoveryArgs = { + input?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerPasswordRecoveryArgs = { - input: Scalars["String"]["input"]; - recaptchaToken?: InputMaybe; + input: Scalars['String']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerSimpleLoginStartArgs = { - input?: InputMaybe; - recaptchaToken?: InputMaybe; + input?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerSimpleLoginVerifyAnwserArgs = { - anwserId: Scalars["Uuid"]["input"]; - input?: InputMaybe; - questionId: Scalars["Uuid"]["input"]; - recaptchaToken?: InputMaybe; + answerId: Scalars['Uuid']['input']; + input?: InputMaybe; + questionId: Scalars['Uuid']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerSocialLoginFacebookArgs = { - facebookAccessToken?: InputMaybe; - recaptchaToken?: InputMaybe; + facebookAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationCustomerSocialLoginGoogleArgs = { - clientId?: InputMaybe; - recaptchaToken?: InputMaybe; - userCredential?: InputMaybe; + clientId?: InputMaybe; + recaptchaToken?: InputMaybe; + userCredential?: InputMaybe; +}; + + +export type MutationCustomerSubscriptionAddressChangeArgs = { + addressId: Scalars['ID']['input']; + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; + subscriptionId: Scalars['Long']['input']; +}; + + +export type MutationCustomerSubscriptionProductAddArgs = { + customerAccessToken: Scalars['String']['input']; + products: Array>; + recaptchaToken?: InputMaybe; + subscriptionId: Scalars['Long']['input']; +}; + + +export type MutationCustomerSubscriptionProductRemoveArgs = { + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; + subscriptionId: Scalars['Long']['input']; + subscriptionProducts: Array>; }; + +export type MutationCustomerSubscriptionUpdateStatusArgs = { + customerAccessToken: Scalars['String']['input']; + recaptchaToken?: InputMaybe; + status: Status; + subscriptionId: Scalars['Long']['input']; +}; + + export type MutationCustomerUpdateArgs = { - customerAccessToken: Scalars["String"]["input"]; + customerAccessToken: Scalars['String']['input']; input: CustomerUpdateInput; + recaptchaToken?: InputMaybe; }; + +export type MutationEventListAddProductArgs = { + eventListToken: Scalars['String']['input']; + products: Array>; + recaptchaToken?: InputMaybe; +}; + + +export type MutationOrderChangePaymentArgs = { + checkoutId: Scalars['Uuid']['input']; + customerAccessToken: Scalars['String']['input']; + orderId: Scalars['Long']['input']; + paymentData: Scalars['String']['input']; + recaptchaToken?: InputMaybe; +}; + + export type MutationPartnerAccessTokenCreateArgs = { input: PartnerAccessTokenInput; + recaptchaToken?: InputMaybe; }; + +export type MutationProductCounterOfferSubmitArgs = { + input: CounterOfferInput; + recaptchaToken?: InputMaybe; +}; + + +export type MutationProductFriendRecommendArgs = { + input: FriendRecommendInput; + recaptchaToken?: InputMaybe; +}; + + export type MutationProductPriceAlertArgs = { input: AddPriceAlertInput; + recaptchaToken?: InputMaybe; }; + export type MutationProductRestockAlertArgs = { input: RestockAlertInput; - partnerAccessToken?: InputMaybe; + partnerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationSendGenericFormArgs = { - body?: InputMaybe; - file?: InputMaybe; - recaptchaToken?: InputMaybe; + body?: InputMaybe; + file?: InputMaybe; + recaptchaToken?: InputMaybe; }; + export type MutationUpdateAddressArgs = { address: UpdateCustomerAddressInput; - customerAccessToken: Scalars["String"]["input"]; - id: Scalars["ID"]["input"]; + customerAccessToken: Scalars['String']['input']; + id: Scalars['ID']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationWishlistAddProductArgs = { - customerAccessToken: Scalars["String"]["input"]; - productId: Scalars["Long"]["input"]; + customerAccessToken: Scalars['String']['input']; + productId: Scalars['Long']['input']; + recaptchaToken?: InputMaybe; }; + export type MutationWishlistRemoveProductArgs = { - customerAccessToken: Scalars["String"]["input"]; - productId: Scalars["Long"]["input"]; + customerAccessToken: Scalars['String']['input']; + productId: Scalars['Long']['input']; + recaptchaToken?: InputMaybe; }; export type NewsletterInput = { - email: Scalars["String"]["input"]; - informationGroupValues?: InputMaybe< - Array> - >; - name: Scalars["String"]["input"]; - recaptchaToken?: InputMaybe; + email: Scalars['String']['input']; + /** The receiver gender. Default is null. */ + gender?: InputMaybe; + informationGroupValues?: InputMaybe>>; + name: Scalars['String']['input']; + /** [Deprecated: use the root field] The google recaptcha token. */ + recaptchaToken?: InputMaybe; }; export type NewsletterNode = { /** Newsletter creation date. */ - createDate: Scalars["DateTime"]["output"]; + createDate: Scalars['DateTime']['output']; /** The newsletter receiver email. */ - email?: Maybe; + email?: Maybe; + /** Newsletter receiver gender. */ + gender?: Maybe; /** The newsletter receiver name. */ - name?: Maybe; + name?: Maybe; /** Newsletter update date. */ - updateDate?: Maybe; + updateDate?: Maybe; }; export type Node = { - id?: Maybe; + id?: Maybe; }; /** Types of operations to perform between query terms. */ export type Operation = /** Performs AND operation between query terms. */ - | "AND" + | 'AND' /** Performs OR operation between query terms. */ - | "OR"; + | 'OR'; /** Result of the operation. */ export type OperationResult = { /** If the operation is a success. */ - isSuccess: Scalars["Boolean"]["output"]; + isSuccess: Scalars['Boolean']['output']; }; export type OrderAdjustNode = { /** The adjust name. */ - name?: Maybe; + name?: Maybe; /** Note about the adjust. */ - note?: Maybe; + note?: Maybe; /** Type of adjust. */ - type?: Maybe; + type?: Maybe; /** Amount to be adjusted. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; }; export type OrderAttributeNode = { /** The attribute name. */ - name?: Maybe; + name?: Maybe; /** The attribute value. */ - value?: Maybe; + value?: Maybe; }; export type OrderCustomizationNode = { /** The customization cost. */ - cost?: Maybe; + cost?: Maybe; /** The customization name. */ - name?: Maybe; + name?: Maybe; /** The customization value. */ - value?: Maybe; + value?: Maybe; }; export type OrderDeliveryAddressNode = { /** The street number of the address. */ - addressNumber?: Maybe; + addressNumber?: Maybe; /** The ZIP code of the address. */ - cep?: Maybe; + cep?: Maybe; /** The city of the address. */ - city?: Maybe; + city?: Maybe; /** The additional address information. */ - complement?: Maybe; + complement?: Maybe; /** The country of the address. */ - country?: Maybe; + country?: Maybe; /** The neighborhood of the address. */ - neighboorhood?: Maybe; + neighboorhood?: Maybe; /** The receiver's name. */ - receiverName?: Maybe; + receiverName?: Maybe; /** The reference point for the address. */ - referencePoint?: Maybe; + referencePoint?: Maybe; /** The state of the address, abbreviated. */ - state?: Maybe; + state?: Maybe; /** The street name of the address. */ - street?: Maybe; + street?: Maybe; +}; + +export type OrderDigitalProductNode = { + /** The content of the digital product. */ + content?: Maybe; + /** The order date. */ + date: Scalars['DateTime']['output']; + /** The product name. */ + name?: Maybe; + /** Order unique identifier. */ + orderId: Scalars['Long']['output']; + /** The product sale price. */ + salePrice: Scalars['Decimal']['output']; }; export type OrderInvoiceNode = { /** The invoice access key. */ - accessKey?: Maybe; + accessKey?: Maybe; /** The invoice identifier code. */ - invoiceCode?: Maybe; + invoiceCode?: Maybe; /** The invoice serial digit. */ - serialDigit?: Maybe; + serialDigit?: Maybe; /** The invoice URL. */ - url?: Maybe; + url?: Maybe; +}; + +export type OrderKitNode = { + /** The kit alias */ + alias?: Maybe; + /** The kit URL image */ + imageUrl?: Maybe; + /** The kit unique identifier */ + kitGroupId?: Maybe; + /** The kit identifier */ + kitId: Scalars['Long']['output']; + /** The kit list price */ + listPrice: Scalars['Decimal']['output']; + /** The kit name */ + name?: Maybe; + /** The kit price */ + price: Scalars['Decimal']['output']; + /** The products contained in this kit */ + products?: Maybe>>; + /** The kit quantity */ + quantity: Scalars['Int']['output']; + /** The total list price */ + totalListPrice: Scalars['Decimal']['output']; }; export type OrderNoteNode = { /** Date the note was added to the order. */ - date?: Maybe; + date?: Maybe; /** The note added to the order. */ - note?: Maybe; + note?: Maybe; /** The user who added the note to the order. */ - user?: Maybe; + user?: Maybe; }; export type OrderPackagingNode = { /** The packaging cost. */ - cost: Scalars["Decimal"]["output"]; + cost: Scalars['Decimal']['output']; /** The packaging description. */ - description?: Maybe; + description?: Maybe; /** The message added to the packaging. */ - message?: Maybe; + message?: Maybe; /** The packaging name. */ - name?: Maybe; + name?: Maybe; }; export type OrderPaymentAdditionalInfoNode = { /** Additional information key. */ - key?: Maybe; + key?: Maybe; /** Additional information value. */ - value?: Maybe; + value?: Maybe; }; export type OrderPaymentBoletoNode = { /** The digitable line. */ - digitableLine?: Maybe; + digitableLine?: Maybe; /** The payment link. */ - paymentLink?: Maybe; + paymentLink?: Maybe; }; export type OrderPaymentCardNode = { /** The brand of the card. */ - brand?: Maybe; + brand?: Maybe; /** The masked credit card number with only the last 4 digits displayed. */ - maskedNumber?: Maybe; + maskedNumber?: Maybe; }; export type OrderPaymentNode = { @@ -2031,32 +2891,32 @@ export type OrderPaymentNode = { /** The card information. */ card?: Maybe; /** Order discounted value. */ - discount?: Maybe; + discount?: Maybe; /** Order additional fees value. */ - fees?: Maybe; + fees?: Maybe; /** Value per installment. */ - installmentValue?: Maybe; + installmentValue?: Maybe; /** Number of installments. */ - installments?: Maybe; + installments?: Maybe; /** Message about payment transaction. */ - message?: Maybe; + message?: Maybe; /** The chosen payment option for the order. */ - paymentOption?: Maybe; + paymentOption?: Maybe; /** The pix information. */ pix?: Maybe; /** Current payment status. */ - status?: Maybe; + status?: Maybe; /** Order total value. */ - total?: Maybe; + total?: Maybe; }; export type OrderPaymentPixNode = { /** The QR code. */ - qrCode?: Maybe; + qrCode?: Maybe; /** The expiration date of the QR code. */ - qrCodeExpirationDate?: Maybe; + qrCodeExpirationDate?: Maybe; /** The image URL of the QR code. */ - qrCodeUrl?: Maybe; + qrCodeUrl?: Maybe; }; export type OrderProductNode = { @@ -2065,243 +2925,263 @@ export type OrderProductNode = { /** The product attributes. */ attributes?: Maybe>>; /** The cost of the customizations, if any. */ - customizationPrice: Scalars["Decimal"]["output"]; + customizationPrice: Scalars['Decimal']['output']; /** List of customizations for the product. */ customizations?: Maybe>>; /** Amount of discount in the product price, if any. */ - discount: Scalars["Decimal"]["output"]; + discount: Scalars['Decimal']['output']; /** If the product is a gift. */ - gift?: Maybe; + gift?: Maybe; /** The product image. */ - image?: Maybe; + image?: Maybe; + /** The product has a kit */ + kit: Scalars['Boolean']['output']; /** The product list price. */ - listPrice: Scalars["Decimal"]["output"]; + listPrice: Scalars['Decimal']['output']; /** The product name. */ - name?: Maybe; + name?: Maybe; /** The cost of the packagings, if any. */ - packagingPrice: Scalars["Decimal"]["output"]; + packagingPrice: Scalars['Decimal']['output']; /** List of packagings for the product. */ packagings?: Maybe>>; /** The product price. */ - price: Scalars["Decimal"]["output"]; + price: Scalars['Decimal']['output']; /** Information about the product seller. */ productSeller?: Maybe; /** Variant unique identifier. */ - productVariantId: Scalars["Long"]["output"]; + productVariantId: Scalars['Long']['output']; /** Quantity of the given product in the order. */ - quantity: Scalars["Long"]["output"]; + quantity: Scalars['Long']['output']; /** The product sale price. */ - salePrice: Scalars["Decimal"]["output"]; + salePrice: Scalars['Decimal']['output']; /** The product SKU. */ - sku?: Maybe; + sku?: Maybe; /** List of trackings for the order. */ trackings?: Maybe>>; /** Value of an unit of the product. */ - unitaryValue: Scalars["Decimal"]["output"]; + unitaryValue: Scalars['Decimal']['output']; }; export type OrderSellerNode = { /** The seller's name. */ - name?: Maybe; + name?: Maybe; }; export type OrderShippingNode = { /** Limit date of delivery, in days. */ - deadline?: Maybe; + deadline?: Maybe; + /** Limit date of delivery, in hours. */ + deadlineInHours?: Maybe; /** Deadline text message. */ - deadlineText?: Maybe; + deadlineText?: Maybe; /** Distribution center unique identifier. */ - distributionCenterId?: Maybe; + distributionCenterId?: Maybe; /** The order pick up unique identifier. */ - pickUpId?: Maybe; + pickUpId?: Maybe; /** The products belonging to the order. */ products?: Maybe>>; /** Amount discounted from shipping costs, if any. */ - promotion?: Maybe; + promotion?: Maybe; /** Shipping company connector identifier code. */ - refConnector?: Maybe; + refConnector?: Maybe; /** Start date of shipping schedule. */ - scheduleFrom?: Maybe; + scheduleFrom?: Maybe; /** Limit date of shipping schedule. */ - scheduleUntil?: Maybe; + scheduleUntil?: Maybe; /** Shipping fee value. */ - shippingFee?: Maybe; + shippingFee?: Maybe; /** The shipping name. */ - shippingName?: Maybe; + shippingName?: Maybe; /** Shipping rate table unique identifier. */ - shippingTableId?: Maybe; + shippingTableId?: Maybe; /** The total value. */ - total?: Maybe; + total?: Maybe; /** Order package size. */ - volume?: Maybe; + volume?: Maybe; /** The order weight, in grams. */ - weight?: Maybe; + weight?: Maybe; }; export type OrderShippingProductNode = { /** Distribution center unique identifier. */ - distributionCenterId?: Maybe; + distributionCenterId?: Maybe; /** The product price. */ - price?: Maybe; + price?: Maybe; /** Variant unique identifier. */ - productVariantId?: Maybe; + productVariantId?: Maybe; /** Quantity of the given product. */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; }; /** Define the sort orientation of the result set. */ export type OrderSortDirection = /** The results will be sorted in an ascending order. */ - | "ASC" + | 'ASC' /** The results will be sorted in an descending order. */ - | "DESC"; + | 'DESC'; /** Represents the status of an order. */ export type OrderStatus = /** Order has been approved in analysis. */ - | "APPROVED_ANALYSIS" + | 'APPROVED_ANALYSIS' /** Order has been authorized. */ - | "AUTHORIZED" + | 'AUTHORIZED' /** Order is awaiting payment. */ - | "AWAITING_PAYMENT" + | 'AWAITING_PAYMENT' /** Order is awaiting change of payment method. */ - | "AWAITING_PAYMENT_CHANGE" + | 'AWAITING_PAYMENT_CHANGE' /** Order has been cancelled. */ - | "CANCELLED" + | 'CANCELLED' /** Order has been cancelled - Card Denied. */ - | "CANCELLED_DENIED_CARD" + | 'CANCELLED_DENIED_CARD' /** Order has been cancelled - Fraud. */ - | "CANCELLED_FRAUD" + | 'CANCELLED_FRAUD' /** Order has been cancelled. */ - | "CANCELLED_ORDER_CANCELLED" + | 'CANCELLED_ORDER_CANCELLED' /** Order has been cancelled - Suspected Fraud. */ - | "CANCELLED_SUSPECT_FRAUD" + | 'CANCELLED_SUSPECT_FRAUD' /** Order has been cancelled - Card Temporarily Denied. */ - | "CANCELLED_TEMPORARILY_DENIED_CARD" + | 'CANCELLED_TEMPORARILY_DENIED_CARD' /** Order has been checked. */ - | "CHECKED_ORDER" + | 'CHECKED_ORDER' /** Order has been credited. */ - | "CREDITED" + | 'CREDITED' /** Order has been delivered. */ - | "DELIVERED" + | 'DELIVERED' /** Payment denied, but the order has not been cancelled. */ - | "DENIED_PAYMENT" + | 'DENIED_PAYMENT' /** Documents needed for purchase. */ - | "DOCUMENTS_FOR_PURCHASE" + | 'DOCUMENTS_FOR_PURCHASE' /** Order has been placed. */ - | "ORDERED" + | 'ORDERED' /** Order has been paid. */ - | "PAID" + | 'PAID' /** Available for pick-up in store. */ - | "PICK_UP_IN_STORE" + | 'PICK_UP_IN_STORE' /** Order has been received - Gift Card. */ - | "RECEIVED_GIFT_CARD" + | 'RECEIVED_GIFT_CARD' /** Order has been returned. */ - | "RETURNED" + | 'RETURNED' /** Order has been sent. */ - | "SENT" + | 'SENT' /** Order has been sent - Invoiced. */ - | "SENT_INVOICED" + | 'SENT_INVOICED' /** Order has been separated. */ - | "SEPARATED"; + | 'SEPARATED'; export type OrderStatusNode = { /** The date when status has changed. */ - changeDate?: Maybe; + changeDate?: Maybe; /** Order status. */ - status?: Maybe; + status?: Maybe; /** Status unique identifier. */ - statusId: Scalars["Long"]["output"]; + statusId: Scalars['Long']['output']; +}; + +export type OrderSubscriptionNode = { + /** The length of the order signature period. */ + recurringDays?: Maybe; + /** The order subscription period type. */ + recurringName?: Maybe; + /** The order signing group identifier. */ + subscriptionGroupId?: Maybe; + /** subscription unique identifier. */ + subscriptionId?: Maybe; + /** The subscription's order identifier. */ + subscriptionOrderId?: Maybe; + /** The subscription fee for the order. */ + value?: Maybe; }; export type OrderTrackingNode = { /** The tracking code. */ - code?: Maybe; + code?: Maybe; /** The URL for tracking. */ - url?: Maybe; + url?: Maybe; }; /** Information about pagination in a connection. */ export type PageInfo = { /** When paginating forwards, the cursor to continue. */ - endCursor?: Maybe; + endCursor?: Maybe; /** Indicates whether more edges exist following the set defined by the clients arguments. */ - hasNextPage: Scalars["Boolean"]["output"]; + hasNextPage: Scalars['Boolean']['output']; /** Indicates whether more edges exist prior the set defined by the clients arguments. */ - hasPreviousPage: Scalars["Boolean"]["output"]; + hasPreviousPage: Scalars['Boolean']['output']; /** When paginating backwards, the cursor to continue. */ - startCursor?: Maybe; + startCursor?: Maybe; }; /** Partners are used to assign specific products or price tables depending on its scope. */ export type Partner = Node & { /** The partner alias. */ - alias?: Maybe; + alias?: Maybe; /** The partner is valid until this date. */ - endDate: Scalars["DateTime"]["output"]; + endDate: Scalars['DateTime']['output']; /** The full partner logo URL. */ - fullUrlLogo?: Maybe; + fullUrlLogo?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The partner logo's URL. */ - logoUrl?: Maybe; + logoUrl?: Maybe; /** The partner's name. */ - name?: Maybe; + name?: Maybe; /** The partner's origin. */ - origin?: Maybe; + origin?: Maybe; /** The partner's access token. */ - partnerAccessToken?: Maybe; + partnerAccessToken?: Maybe; /** Partner unique identifier. */ - partnerId: Scalars["Long"]["output"]; + partnerId: Scalars['Long']['output']; /** Portfolio identifier assigned to this partner. */ - portfolioId: Scalars["Int"]["output"]; + portfolioId: Scalars['Int']['output']; /** Price table identifier assigned to this partner. */ - priceTableId: Scalars["Int"]["output"]; + priceTableId: Scalars['Int']['output']; /** The partner is valid from this date. */ - startDate: Scalars["DateTime"]["output"]; + startDate: Scalars['DateTime']['output']; /** The type of scoped the partner is used. */ - type?: Maybe; + type?: Maybe; }; + /** Partners are used to assign specific products or price tables depending on its scope. */ export type PartnerFullUrlLogoArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; export type PartnerAccessToken = { - token?: Maybe; - validUntil?: Maybe; + token?: Maybe; + validUntil?: Maybe; }; /** The input to authenticate closed scope partners. */ export type PartnerAccessTokenInput = { - password: Scalars["String"]["input"]; - username: Scalars["String"]["input"]; + password: Scalars['String']['input']; + username: Scalars['String']['input']; }; /** Input for partners. */ export type PartnerByRegionInput = { /** CEP to get the regional partners. */ - cep?: InputMaybe; + cep?: InputMaybe; /** Region ID to get the regional partners. */ - regionId?: InputMaybe; + regionId?: InputMaybe; }; /** Define the partner attribute which the result set will be sorted on. */ export type PartnerSortKeys = /** The partner unique identifier. */ - | "ID" + | 'ID' /** The partner name. */ - | "NAME"; + | 'NAME'; export type PartnerSubtype = /** Partner 'client' subtype. */ - | "CLIENT" + | 'CLIENT' /** Partner 'closed' subtype. */ - | "CLOSED" + | 'CLOSED' /** Partner 'open' subtype. */ - | "OPEN"; + | 'OPEN'; /** A connection to a list of items. */ export type PartnersConnection = { @@ -2316,7 +3196,7 @@ export type PartnersConnection = { /** An edge in a connection. */ export type PartnersEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; @@ -2324,62 +3204,62 @@ export type PartnersEdge = { /** Informations about the physical store. */ export type PhysicalStore = { /** Additional text. */ - additionalText?: Maybe; + additionalText?: Maybe; /** Physical store address. */ - address?: Maybe; + address?: Maybe; /** Physical store address details. */ - addressDetails?: Maybe; + addressDetails?: Maybe; /** Physical store address number. */ - addressNumber?: Maybe; + addressNumber?: Maybe; /** Physical store address city. */ - city?: Maybe; + city?: Maybe; /** Physical store country. */ - country?: Maybe; + country?: Maybe; /** Physical store DDD. */ - ddd: Scalars["Int"]["output"]; + ddd: Scalars['Int']['output']; /** Delivery deadline. */ - deliveryDeadline: Scalars["Int"]["output"]; + deliveryDeadline: Scalars['Int']['output']; /** Physical store email. */ - email?: Maybe; + email?: Maybe; /** Physical store latitude. */ - latitude?: Maybe; + latitude?: Maybe; /** Physical store longitude. */ - longitude?: Maybe; + longitude?: Maybe; /** Physical store name. */ - name?: Maybe; + name?: Maybe; /** Physical store address neighborhood. */ - neighborhood?: Maybe; + neighborhood?: Maybe; /** Physical store phone number. */ - phoneNumber?: Maybe; + phoneNumber?: Maybe; /** Physical store ID. */ - physicalStoreId: Scalars["Int"]["output"]; + physicalStoreId: Scalars['Int']['output']; /** If the physical store allows pickup. */ - pickup: Scalars["Boolean"]["output"]; + pickup: Scalars['Boolean']['output']; /** Pickup deadline. */ - pickupDeadline: Scalars["Int"]["output"]; + pickupDeadline: Scalars['Int']['output']; /** Physical store state. */ - state?: Maybe; + state?: Maybe; /** Physical store zip code. */ - zipCode?: Maybe; + zipCode?: Maybe; }; /** Range of prices for this product. */ export type PriceRange = { /** The quantity of products in this range. */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; /** The price range. */ - range?: Maybe; + range?: Maybe; }; export type PriceTable = { /** The amount of discount in percentage. */ - discountPercentage: Scalars["Decimal"]["output"]; + discountPercentage: Scalars['Decimal']['output']; /** The id of this price table. */ - id: Scalars["Long"]["output"]; + id: Scalars['Long']['output']; /** The listed regular price of this table. */ - listPrice?: Maybe; + listPrice?: Maybe; /** The current working price of this table. */ - price: Scalars["Decimal"]["output"]; + price: Scalars['Decimal']['output']; }; /** The prices of the product. */ @@ -2387,17 +3267,17 @@ export type Prices = { /** The best installment option available. */ bestInstallment?: Maybe; /** The amount of discount in percentage. */ - discountPercentage: Scalars["Decimal"]["output"]; + discountPercentage: Scalars['Decimal']['output']; /** Wether the current price is discounted. */ - discounted: Scalars["Boolean"]["output"]; + discounted: Scalars['Boolean']['output']; /** List of the possibles installment plans. */ installmentPlans?: Maybe>>; /** The listed regular price of the product. */ - listPrice?: Maybe; + listPrice?: Maybe; /** The multiplication factor used for items that are sold by quantity. */ - multiplicationFactor: Scalars["Float"]["output"]; + multiplicationFactor: Scalars['Float']['output']; /** The current working price. */ - price: Scalars["Decimal"]["output"]; + price: Scalars['Decimal']['output']; /** * List of the product different price tables. * @@ -2411,63 +3291,79 @@ export type Prices = { /** Input to specify the range of prices to return. */ export type PricesInput = { /** The product discount must be greater than or equal to. */ - discount_gte?: InputMaybe; + discount_gte?: InputMaybe; /** The product discount must be lesser than or equal to. */ - discount_lte?: InputMaybe; + discount_lte?: InputMaybe; /** Return only products where the listed price is more than the price. */ - discounted?: InputMaybe; + discounted?: InputMaybe; /** The product price must be greater than or equal to. */ - price_gte?: InputMaybe; + price_gte?: InputMaybe; /** The product price must be lesser than or equal to. */ - price_lte?: InputMaybe; + price_lte?: InputMaybe; }; /** A product represents an item for sale in the store. */ export type Product = Node & { /** Check if the product can be added to cart directly from spot. */ - addToCartFromSpot?: Maybe; + addToCartFromSpot?: Maybe; /** The product url alias. */ - alias?: Maybe; + alias?: Maybe; + /** The complete product url alias. */ + aliasComplete?: Maybe; /** List of the product attributes. */ attributes?: Maybe>>; + /** The product author. */ + author?: Maybe; /** Field to check if the product is available in stock. */ - available?: Maybe; + available?: Maybe; /** The product average rating. From 0 to 5. */ - averageRating?: Maybe; + averageRating?: Maybe; /** BuyBox informations. */ buyBox?: Maybe; + /** The product collection. */ + collection?: Maybe; /** The product condition. */ - condition?: Maybe; + condition?: Maybe; + /** Checks if the product allows counteroffers. */ + counterOffer?: Maybe; /** The product creation date. */ - createdAt?: Maybe; + createdAt?: Maybe; /** The product delivery deadline. */ - deadline?: Maybe; + deadline?: Maybe; /** Check if the product should be displayed. */ - display?: Maybe; + display?: Maybe; /** Check if the product should be displayed only for partners. */ - displayOnlyPartner?: Maybe; + displayOnlyPartner?: Maybe; /** Check if the product should be displayed on search. */ - displaySearch?: Maybe; + displaySearch?: Maybe; /** The product's unique EAN. */ - ean?: Maybe; + ean?: Maybe; /** Check if the product offers free shipping. */ - freeShipping?: Maybe; + freeShipping?: Maybe; + /** The product gender. */ + gender?: Maybe; + /** The height of the product. */ + height?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** List of the product images. */ images?: Maybe>>; /** List of the product insformations. */ informations?: Maybe>>; + /** The length of the product. */ + length?: Maybe; /** Check if its the main variant. */ - mainVariant?: Maybe; + mainVariant?: Maybe; + /** The product maximum quantity for an order. */ + maximumOrderQuantity?: Maybe; /** The product minimum quantity for an order. */ - minimumOrderQuantity?: Maybe; + minimumOrderQuantity?: Maybe; /** Check if the product is a new release. */ - newRelease?: Maybe; + newRelease?: Maybe; /** The number of votes that the average rating consists of. */ - numberOfVotes?: Maybe; + numberOfVotes?: Maybe; /** Parent product unique identifier. */ - parentId?: Maybe; + parentId?: Maybe; /** The product prices. */ prices?: Maybe; /** Summarized informations about the brand of the product. */ @@ -2475,60 +3371,73 @@ export type Product = Node & { /** Summarized informations about the categories of the product. */ productCategories?: Maybe>>; /** Product unique identifier. */ - productId?: Maybe; + productId?: Maybe; /** The product name. */ - productName?: Maybe; - /** Summarized informations about the subscription of the product. */ + productName?: Maybe; + /** + * Summarized informations about the subscription of the product. + * @deprecated Use subscriptionGroups to get subscription information. + */ productSubscription?: Maybe; /** Variant unique identifier. */ - productVariantId?: Maybe; + productVariantId?: Maybe; /** List of promotions this product belongs to. */ promotions?: Maybe>>; + /** The product publisher */ + publisher?: Maybe; /** The product seller. */ seller?: Maybe; /** List of similar products. */ similarProducts?: Maybe>>; /** The product's unique SKU. */ - sku?: Maybe; + sku?: Maybe; /** The values of the spot attribute. */ - spotAttributes?: Maybe>>; + spotAttributes?: Maybe>>; /** The product spot information. */ - spotInformation?: Maybe; + spotInformation?: Maybe; /** Check if the product is on spotlight. */ - spotlight?: Maybe; - /** The available stock at the default distribution center. */ - stock?: Maybe; + spotlight?: Maybe; + /** The available aggregated product stock (all variants) at the default distribution center. */ + stock?: Maybe; /** List of the product stocks on different distribution centers. */ stocks?: Maybe>>; /** List of subscription groups this product belongs to. */ subscriptionGroups?: Maybe>>; /** Check if the product is a telesale. */ - telesales?: Maybe; + telesales?: Maybe; /** The product last update date. */ - updatedAt?: Maybe; + updatedAt?: Maybe; /** The product video url. */ - urlVideo?: Maybe; + urlVideo?: Maybe; /** The variant name. */ - variantName?: Maybe; + variantName?: Maybe; + /** The available aggregated variant stock at the default distribution center. */ + variantStock?: Maybe; + /** The weight of the product. */ + weight?: Maybe; + /** The width of the product. */ + width?: Maybe; }; + /** A product represents an item for sale in the store. */ export type ProductImagesArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; export type ProductAggregations = { /** List of product filters which can be used to filter subsequent queries. */ filters?: Maybe>>; /** Minimum price of the products. */ - maximumPrice: Scalars["Decimal"]["output"]; + maximumPrice: Scalars['Decimal']['output']; /** Maximum price of the products. */ - minimumPrice: Scalars["Decimal"]["output"]; + minimumPrice: Scalars['Decimal']['output']; /** List of price ranges for the selected products. */ priceRanges?: Maybe>>; }; + export type ProductAggregationsFiltersArgs = { position?: InputMaybe; }; @@ -2536,60 +3445,61 @@ export type ProductAggregationsFiltersArgs = { /** The attributes of the product. */ export type ProductAttribute = Node & { /** The id of the attribute. */ - attributeId: Scalars["Long"]["output"]; + attributeId: Scalars['Long']['output']; /** The display type of the attribute. */ - displayType?: Maybe; + displayType?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The name of the attribute. */ - name?: Maybe; + name?: Maybe; /** The type of the attribute. */ - type?: Maybe; + type?: Maybe; /** The value of the attribute. */ - value?: Maybe; + value?: Maybe; }; export type ProductBrand = { /** The hotsite url alias fot this brand. */ - alias?: Maybe; + alias?: Maybe; /** The full brand logo URL. */ - fullUrlLogo?: Maybe; + fullUrlLogo?: Maybe; /** The brand id. */ - id: Scalars["Long"]["output"]; + id: Scalars['Long']['output']; /** The url that contains the brand logo image. */ - logoUrl?: Maybe; + logoUrl?: Maybe; /** The name of the brand. */ - name?: Maybe; + name?: Maybe; }; + export type ProductBrandFullUrlLogoArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Information about the category of a product. */ export type ProductCategory = { /** Wether the category is currently active. */ - active: Scalars["Boolean"]["output"]; + active: Scalars['Boolean']['output']; /** The categories in google format. */ - googleCategories?: Maybe; + googleCategories?: Maybe; /** The category hierarchy. */ - hierarchy?: Maybe; + hierarchy?: Maybe; /** The id of the category. */ - id: Scalars["Int"]["output"]; + id: Scalars['Int']['output']; /** Wether this category is the main category for this product. */ - main: Scalars["Boolean"]["output"]; + main: Scalars['Boolean']['output']; /** The category name. */ - name?: Maybe; + name?: Maybe; /** The category hotsite url alias. */ - url?: Maybe; + url?: Maybe; }; export type ProductCollectionSegment = { items?: Maybe>>; - page: Scalars["Int"]["output"]; - pageSize: Scalars["Int"]["output"]; - totalCount: Scalars["Int"]["output"]; + page: Scalars['Int']['output']; + pageSize: Scalars['Int']['output']; + totalCount: Scalars['Int']['output']; }; /** Filter product results based on giving attributes. */ @@ -2597,45 +3507,55 @@ export type ProductExplicitFiltersInput = { /** The set of attributes do filter. */ attributes?: InputMaybe; /** Choose if you want to retrieve only the available products in stock. */ - available?: InputMaybe; + available?: InputMaybe; /** The set of brand IDs which the result item brand ID must be included in. */ - brandId?: InputMaybe>; + brandId?: InputMaybe>; /** The set of category IDs which the result item category ID must be included in. */ - categoryId?: InputMaybe>; + categoryId?: InputMaybe>; /** The set of EANs which the result item EAN must be included. */ - ean?: InputMaybe>>; + ean?: InputMaybe>>; + /** An external parent ID or a list of IDs to search for products with the external parent ID. */ + externalParentId?: InputMaybe>>; /** Retrieve the product variant only if it contains images. */ - hasImages?: InputMaybe; + hasImages?: InputMaybe; + /** Ignores the display rules when searching for products. */ + ignoreDisplayRules?: InputMaybe; /** Retrieve the product variant only if it is the main product variant. */ - mainVariant?: InputMaybe; + mainVariant?: InputMaybe; + /** A parent ID or a list of IDs to search for products with the parent ID. */ + parentId?: InputMaybe>; /** The set of prices to filter. */ prices?: InputMaybe; /** The product unique identifier (you may provide a list of IDs if needed). */ - productId?: InputMaybe>; + productId?: InputMaybe>; /** The product variant unique identifier (you may provide a list of IDs if needed). */ - productVariantId?: InputMaybe>; + productVariantId?: InputMaybe>; /** A product ID or a list of IDs to search for other products with the same parent ID. */ - sameParentAs?: InputMaybe>; + sameParentAs?: InputMaybe>; + /** Search products. */ + search?: InputMaybe>>; /** The set of SKUs which the result item SKU must be included. */ - sku?: InputMaybe>>; + sku?: InputMaybe>>; /** Show products with a quantity of available products in stock greater than or equal to the given number. */ - stock_gte?: InputMaybe; + stock_gte?: InputMaybe; /** Show products with a quantity of available products in stock less than or equal to the given number. */ - stock_lte?: InputMaybe; + stock_lte?: InputMaybe; /** The set of stocks to filter. */ stocks?: InputMaybe; + /** The subscription group IDs to search for products inside those groups. */ + subscriptionGroupId?: InputMaybe>; /** Retrieve products which the last update date is greater than or equal to the given date. */ - updatedAt_gte?: InputMaybe; + updatedAt_gte?: InputMaybe; /** Retrieve products which the last update date is less than or equal to the given date. */ - updatedAt_lte?: InputMaybe; + updatedAt_lte?: InputMaybe; }; /** Custom attribute defined on store's admin may also be used as a filter. */ export type ProductFilterInput = { /** The attribute name. */ - field: Scalars["String"]["input"]; + field: Scalars['String']['input']; /** The set of values which the result filter item value must be included in. */ - values: Array>; + values: Array>; }; /** Options available for the given product. */ @@ -2645,9 +3565,10 @@ export type ProductOption = Node & { /** A list of customizations available for the given products. */ customizations?: Maybe>>; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; }; + /** Options available for the given product. */ export type ProductOptionAttributesArgs = { filter?: InputMaybe>>; @@ -2656,80 +3577,81 @@ export type ProductOptionAttributesArgs = { /** A product price alert. */ export type ProductPriceAlert = { /** The alerted's email. */ - email?: Maybe; + email?: Maybe; /** The alerted's name. */ - name?: Maybe; + name?: Maybe; /** The price alert ID. */ - priceAlertId: Scalars["Long"]["output"]; + priceAlertId: Scalars['Long']['output']; /** The product variant ID. */ - productVariantId: Scalars["Long"]["output"]; + productVariantId: Scalars['Long']['output']; /** The request date. */ - requestDate: Scalars["DateTime"]["output"]; + requestDate: Scalars['DateTime']['output']; /** The target price. */ - targetPrice: Scalars["Decimal"]["output"]; + targetPrice: Scalars['Decimal']['output']; }; -export type ProductRecommendationAlgorithm = "DEFAULT"; +export type ProductRecommendationAlgorithm = + | 'DEFAULT'; /** Define the product attribute which the result set will be sorted on. */ export type ProductSearchSortKeys = /** The applied discount to the product variant price. */ - | "DISCOUNT" + | 'DISCOUNT' /** The product name. */ - | "NAME" + | 'NAME' /** The product variant price. */ - | "PRICE" + | 'PRICE' /** Sort in a random way. */ - | "RANDOM" + | 'RANDOM' /** The date the product was released. */ - | "RELEASE_DATE" + | 'RELEASE_DATE' /** The relevance that the search engine gave to the possible result item based on own criteria. */ - | "RELEVANCE" + | 'RELEVANCE' /** The sales number on a period of time. */ - | "SALES" + | 'SALES' /** The quantity in stock of the product variant. */ - | "STOCK"; + | 'STOCK'; /** Define the product attribute which the result set will be sorted on. */ export type ProductSortKeys = /** The applied discount to the product variant price. */ - | "DISCOUNT" + | 'DISCOUNT' /** The product name. */ - | "NAME" + | 'NAME' /** The product variant price. */ - | "PRICE" + | 'PRICE' /** Sort in a random way. */ - | "RANDOM" + | 'RANDOM' /** The date the product was released. */ - | "RELEASE_DATE" + | 'RELEASE_DATE' /** The sales number on a period of time. */ - | "SALES" + | 'SALES' /** The quantity in stock of the product variant. */ - | "STOCK"; + | 'STOCK'; export type ProductSubscription = { /** The amount of discount if this product is sold as a subscription. */ - discount: Scalars["Decimal"]["output"]; + discount: Scalars['Decimal']['output']; /** The price of the product when sold as a subscription. */ - price?: Maybe; + price?: Maybe; /** Wether this product is sold only as a subscrition. */ - subscriptionOnly: Scalars["Boolean"]["output"]; + subscriptionOnly: Scalars['Boolean']['output']; }; /** Product variants that have the attribute. */ export type ProductVariant = Node & { /** The available stock at the default distribution center. */ - aggregatedStock?: Maybe; + aggregatedStock?: Maybe; /** The product alias. */ - alias?: Maybe; + alias?: Maybe; /** List of the selected variant attributes. */ attributes?: Maybe>>; /** Field to check if the product is available in stock. */ - available?: Maybe; + available?: Maybe; /** The product's EAN. */ - ean?: Maybe; + ean?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The product's images. */ images?: Maybe>>; /** The seller's product offers. */ @@ -2737,23 +3659,24 @@ export type ProductVariant = Node & { /** The product prices. */ prices?: Maybe; /** Product unique identifier. */ - productId?: Maybe; + productId?: Maybe; /** Variant unique identifier. */ - productVariantId?: Maybe; + productVariantId?: Maybe; /** Product variant name. */ - productVariantName?: Maybe; + productVariantName?: Maybe; /** List of promotions this product variant belongs to. */ promotions?: Maybe>>; /** The product's unique SKU. */ - sku?: Maybe; + sku?: Maybe; /** The available stock at the default distribution center. */ - stock?: Maybe; + stock?: Maybe; }; + /** Product variants that have the attribute. */ export type ProductVariantImagesArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** A connection to a list of items. */ @@ -2764,13 +3687,13 @@ export type ProductsConnection = { nodes?: Maybe>>; /** Information to aid in pagination. */ pageInfo: PageInfo; - totalCount: Scalars["Int"]["output"]; + totalCount: Scalars['Int']['output']; }; /** An edge in a connection. */ export type ProductsEdge = { /** A cursor for use in pagination. */ - cursor: Scalars["String"]["output"]; + cursor: Scalars['String']['output']; /** The item at the end of the edge. */ node?: Maybe; }; @@ -2778,23 +3701,26 @@ export type ProductsEdge = { /** Information about promotions of a product. */ export type Promotion = { /** The promotion html content. */ - content?: Maybe; + content?: Maybe; /** Where the promotion is shown (spot, product page, etc..). */ - disclosureType?: Maybe; + disclosureType?: Maybe; + /** The end date for the promotion. */ + endDate: Scalars['DateTime']['output']; /** The stamp URL of the promotion. */ - fullStampUrl?: Maybe; + fullStampUrl?: Maybe; /** The promotion id. */ - id: Scalars["Long"]["output"]; + id: Scalars['Long']['output']; /** The stamp of the promotion. */ - stamp?: Maybe; + stamp?: Maybe; /** The promotion title. */ - title?: Maybe; + title?: Maybe; }; + /** Information about promotions of a product. */ export type PromotionFullStampUrlArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; export type QueryRoot = { @@ -2814,20 +3740,33 @@ export type QueryRoot = { categories?: Maybe; /** Get info from the checkout cart corresponding to the given ID. */ checkout?: Maybe; + /** Retrieve essential checkout details for a specific cart. */ + checkoutLite?: Maybe; /** List of contents. */ contents?: Maybe; /** Get informations about a customer from the store. */ customer?: Maybe; + /** Get informations about a customer access token. */ + customerAccessTokenDetails?: Maybe; + /** Retrieve an event list by the token. */ + eventList?: Maybe; + /** Retrieves event types */ + eventListType?: Maybe>>; + /** Retrieves a list of store events. */ + eventLists?: Maybe>>; /** Retrieve a single hotsite. A hotsite consists of products, banners and contents. */ hotsite?: Maybe; /** List of the shop's hotsites. A hotsite consists of products, banners and contents. */ hotsites?: Maybe; + /** Get information group fields. */ + informationGroupFields?: Maybe>>; /** List of menu groups. */ menuGroups?: Maybe>>; - /** Get newsletter information group fields. */ - newsletterInformationGroupFields?: Maybe< - Array> - >; + /** + * Get newsletter information group fields. + * @deprecated Use the informationGroupFields + */ + newsletterInformationGroupFields?: Maybe>>; node?: Maybe; nodes?: Maybe>>; /** Get single partner. */ @@ -2840,6 +3779,10 @@ export type QueryRoot = { paymentMethods?: Maybe>>; /** Retrieve a product by the given id. */ product?: Maybe; + /** Retrieve a list of product recommendations based on the customer's cart. */ + productAIRecommendationsByCart?: Maybe>>; + /** Retrieve a list of product recommendations based on the customer's orders. */ + productAIRecommendationsByOrder?: Maybe>>; /** * Options available for the given product. * @deprecated Use the product query. @@ -2853,297 +3796,430 @@ export type QueryRoot = { scripts?: Maybe>>; /** Search products with cursor pagination. */ search?: Maybe; + /** List of sellers */ + sellers?: Maybe; + /** Get the shipping quote groups by providing CEP and checkout or products. */ + shippingQuoteGroups?: Maybe>>; /** Get the shipping quotes by providing CEP and checkout or product identifier. */ shippingQuotes?: Maybe>>; /** Store informations */ shop?: Maybe; + /** Returns a single store setting */ + shopSetting?: Maybe; /** Store settings */ shopSettings?: Maybe>>; /** Get the URI kind. */ uri?: Maybe; }; + export type QueryRootAddressArgs = { - cep?: InputMaybe; + cep?: InputMaybe; }; + export type QueryRootAutocompleteArgs = { - limit?: InputMaybe; - partnerAccessToken?: InputMaybe; - query?: InputMaybe; + limit?: InputMaybe; + partnerAccessToken?: InputMaybe; + query?: InputMaybe; }; + export type QueryRootBannersArgs = { - after?: InputMaybe; - bannerIds?: InputMaybe>; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - partnerAccessToken?: InputMaybe; + after?: InputMaybe; + bannerIds?: InputMaybe>; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: SortDirection; sortKey?: BannerSortKeys; }; + export type QueryRootBrandsArgs = { - after?: InputMaybe; - before?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; brandInput?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; sortDirection?: SortDirection; sortKey?: BrandSortKeys; }; + export type QueryRootBuyListArgs = { - id: Scalars["Long"]["input"]; - partnerAccessToken?: InputMaybe; + id: Scalars['Long']['input']; + partnerAccessToken?: InputMaybe; }; + export type QueryRootCalculatePricesArgs = { - partnerAccessToken?: InputMaybe; + partnerAccessToken?: InputMaybe; products: Array>; }; + export type QueryRootCategoriesArgs = { - after?: InputMaybe; - before?: InputMaybe; - categoryIds?: InputMaybe>; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + categoryIds?: InputMaybe>; + first?: InputMaybe; + last?: InputMaybe; + onlyRoot?: Scalars['Boolean']['input']; sortDirection?: SortDirection; sortKey?: CategorySortKeys; + urls?: InputMaybe>>; }; + export type QueryRootCheckoutArgs = { - checkoutId: Scalars["String"]["input"]; - customerAccessToken?: InputMaybe; + checkoutId: Scalars['String']['input']; + customerAccessToken?: InputMaybe; }; + +export type QueryRootCheckoutLiteArgs = { + checkoutId: Scalars['Uuid']['input']; +}; + + export type QueryRootContentsArgs = { - after?: InputMaybe; - before?: InputMaybe; - contentIds?: InputMaybe>; - first?: InputMaybe; - last?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + contentIds?: InputMaybe>; + first?: InputMaybe; + last?: InputMaybe; sortDirection?: SortDirection; sortKey?: ContentSortKeys; }; + export type QueryRootCustomerArgs = { - customerAccessToken?: InputMaybe; + customerAccessToken?: InputMaybe; }; + +export type QueryRootCustomerAccessTokenDetailsArgs = { + customerAccessToken?: InputMaybe; +}; + + +export type QueryRootEventListArgs = { + eventListToken?: InputMaybe; +}; + + +export type QueryRootEventListsArgs = { + eventDate?: InputMaybe; + eventName?: InputMaybe; + eventType?: InputMaybe; +}; + + export type QueryRootHotsiteArgs = { - hotsiteId?: InputMaybe; - partnerAccessToken?: InputMaybe; - url?: InputMaybe; + hotsiteId?: InputMaybe; + partnerAccessToken?: InputMaybe; + url?: InputMaybe; }; + export type QueryRootHotsitesArgs = { - after?: InputMaybe; - before?: InputMaybe; - first?: InputMaybe; - hotsiteIds?: InputMaybe>; - last?: InputMaybe; - partnerAccessToken?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + hotsiteIds?: InputMaybe>; + last?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: SortDirection; sortKey?: HotsiteSortKeys; }; + +export type QueryRootInformationGroupFieldsArgs = { + type: EnumInformationGroup; +}; + + export type QueryRootMenuGroupsArgs = { - partnerAccessToken?: InputMaybe; - position?: InputMaybe; - url: Scalars["String"]["input"]; + partnerAccessToken?: InputMaybe; + position?: InputMaybe; + url: Scalars['String']['input']; }; + export type QueryRootNodeArgs = { - id: Scalars["ID"]["input"]; + id: Scalars['ID']['input']; }; + export type QueryRootNodesArgs = { - ids: Array; + ids: Array; }; + export type QueryRootPartnerArgs = { - partnerAccessToken: Scalars["String"]["input"]; + partnerAccessToken: Scalars['String']['input']; }; + export type QueryRootPartnerByRegionArgs = { input: PartnerByRegionInput; }; + export type QueryRootPartnersArgs = { - after?: InputMaybe; - alias?: InputMaybe>>; - before?: InputMaybe; - first?: InputMaybe; - last?: InputMaybe; - names?: InputMaybe>>; - priceTableIds?: InputMaybe>; + after?: InputMaybe; + alias?: InputMaybe>>; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + names?: InputMaybe>>; + priceTableIds?: InputMaybe>; sortDirection?: SortDirection; sortKey?: PartnerSortKeys; }; + export type QueryRootPaymentMethodsArgs = { - checkoutId: Scalars["Uuid"]["input"]; + checkoutId: Scalars['Uuid']['input']; }; + export type QueryRootProductArgs = { - partnerAccessToken?: InputMaybe; - productId: Scalars["Long"]["input"]; + partnerAccessToken?: InputMaybe; + productId: Scalars['Long']['input']; +}; + + +export type QueryRootProductAiRecommendationsByCartArgs = { + checkoutId: Scalars['Uuid']['input']; + partnerAccessToken?: InputMaybe; + quantity?: Scalars['Int']['input']; +}; + + +export type QueryRootProductAiRecommendationsByOrderArgs = { + customerAccessToken?: InputMaybe; + partnerAccessToken?: InputMaybe; + quantity?: Scalars['Int']['input']; }; + export type QueryRootProductOptionsArgs = { - productId: Scalars["Long"]["input"]; + productId: Scalars['Long']['input']; }; + export type QueryRootProductRecommendationsArgs = { algorithm?: ProductRecommendationAlgorithm; - partnerAccessToken?: InputMaybe; - productId: Scalars["Long"]["input"]; - quantity?: Scalars["Int"]["input"]; + partnerAccessToken?: InputMaybe; + productId: Scalars['Long']['input']; + quantity?: Scalars['Int']['input']; }; + export type QueryRootProductsArgs = { - after?: InputMaybe; - before?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; filters: ProductExplicitFiltersInput; - first?: InputMaybe; - last?: InputMaybe; - partnerAccessToken?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: SortDirection; sortKey?: ProductSortKeys; }; + export type QueryRootScriptsArgs = { - name?: InputMaybe; + id?: InputMaybe; + name?: InputMaybe; pageType?: InputMaybe>; position?: InputMaybe; - url?: InputMaybe; + url?: InputMaybe; }; + export type QueryRootSearchArgs = { + autoSecondSearch?: Scalars['Boolean']['input']; operation?: Operation; - partnerAccessToken?: InputMaybe; - query?: InputMaybe; + partnerAccessToken?: InputMaybe; + query?: InputMaybe; + useAI?: Scalars['Boolean']['input']; +}; + + +export type QueryRootSellersArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + sellerName?: InputMaybe; + sortDirection?: SortDirection; + sortKey?: ResellerSortKeys; }; + +export type QueryRootShippingQuoteGroupsArgs = { + cep?: InputMaybe; + checkoutId: Scalars['Uuid']['input']; + useSelectedAddress?: InputMaybe; +}; + + export type QueryRootShippingQuotesArgs = { - cep?: InputMaybe; - checkoutId?: InputMaybe; - productVariantId?: InputMaybe; - quantity?: InputMaybe; - useSelectedAddress?: InputMaybe; + cep?: InputMaybe; + checkoutId?: InputMaybe; + productVariantId?: InputMaybe; + products?: InputMaybe>>; + quantity?: InputMaybe; + useSelectedAddress?: InputMaybe; }; + +export type QueryRootShopSettingArgs = { + settingName?: InputMaybe; +}; + + export type QueryRootShopSettingsArgs = { - settingNames?: InputMaybe>>; + settingNames?: InputMaybe>>; }; + export type QueryRootUriArgs = { - url: Scalars["String"]["input"]; + partnerAccessToken?: InputMaybe; + url: Scalars['String']['input']; }; export type Question = { answers?: Maybe>>; - question?: Maybe; - questionId?: Maybe; + question?: Maybe; + questionId?: Maybe; }; +/** Represents the product to be removed from the subscription. */ +export type RemoveSubscriptionProductInput = { + /** The quantity to be removed for the product. Removes all if not passed */ + quantity?: InputMaybe; + /** The Id of the product within the subscription to be removed. */ + subscriptionProductId: Scalars['Long']['input']; +}; + +export type ResellerNode = { + /** Taxpayer identification number for businesses */ + cnpj?: Maybe; + /** The registered name of the company */ + corporateName?: Maybe; + /** The seller's name */ + name?: Maybe; + /** Seller unique identifier */ + sellerId: Scalars['Long']['output']; +}; + +/** Define the reseller attribute which the result set will be sorted on. */ +export type ResellerSortKeys = + /** Reseller unique identifier */ + | 'ID' + /** The reseller's name */ + | 'NAME'; + /** Back in stock registration input parameters. */ export type RestockAlertInput = { /** Email to be notified. */ - email: Scalars["String"]["input"]; + email: Scalars['String']['input']; /** Name of the person to be notified. */ - name?: InputMaybe; + name?: InputMaybe; /** The product variant id of the product to be notified. */ - productVariantId: Scalars["Long"]["input"]; + productVariantId: Scalars['Long']['input']; }; export type RestockAlertNode = { /** Email to be notified. */ - email?: Maybe; + email?: Maybe; /** Name of the person to be notified. */ - name?: Maybe; + name?: Maybe; /** The product variant id. */ - productVariantId: Scalars["Long"]["output"]; + productVariantId: Scalars['Long']['output']; /** Date the alert was requested. */ - requestDate: Scalars["DateTime"]["output"]; + requestDate: Scalars['DateTime']['output']; }; /** A product review written by a customer. */ export type Review = { /** The reviewer name. */ - customer?: Maybe; + customer?: Maybe; /** The reviewer e-mail. */ - email?: Maybe; + email?: Maybe; /** The review rating. */ - rating: Scalars["Int"]["output"]; + rating: Scalars['Int']['output']; /** The review content. */ - review?: Maybe; + review?: Maybe; /** The review date. */ - reviewDate: Scalars["DateTime"]["output"]; + reviewDate: Scalars['DateTime']['output']; }; /** Review input parameters. */ export type ReviewCreateInput = { /** The reviewer's email. */ - email: Scalars["String"]["input"]; + email: Scalars['String']['input']; /** The reviewer's name. */ - name: Scalars["String"]["input"]; + name: Scalars['String']['input']; /** The product variant id to add the review to. */ - productVariantId: Scalars["Long"]["input"]; + productVariantId: Scalars['Long']['input']; /** The review rating. */ - rating: Scalars["Int"]["input"]; - /** The google recaptcha token. */ - recaptchaToken?: InputMaybe; + rating: Scalars['Int']['input']; + /** [Deprecated: use the root field] The google recaptcha token. */ + recaptchaToken?: InputMaybe; /** The review content. */ - review: Scalars["String"]["input"]; + review: Scalars['String']['input']; }; /** Entity SEO information. */ export type Seo = { /** Content of SEO. */ - content?: Maybe; + content?: Maybe; /** Equivalent SEO type for HTTP. */ - httpEquiv?: Maybe; + httpEquiv?: Maybe; /** Name of SEO. */ - name?: Maybe; + name?: Maybe; /** Scheme for SEO. */ - scheme?: Maybe; + scheme?: Maybe; /** Type of SEO. */ - type?: Maybe; + type?: Maybe; }; /** Returns the scripts registered in the script manager. */ export type Script = { /** The script content. */ - content?: Maybe; + content?: Maybe; + /** The script id. */ + id: Scalars['Long']['output']; /** The script name. */ - name?: Maybe; + name?: Maybe; /** The script page type. */ pageType: ScriptPageType; /** The script position. */ position: ScriptPosition; /** The script priority. */ - priority: Scalars["Int"]["output"]; + priority: Scalars['Int']['output']; }; export type ScriptPageType = - | "ALL" - | "BRAND" - | "CATEGORY" - | "HOME" - | "PRODUCT" - | "SEARCH"; + | 'ALL' + | 'BRAND' + | 'CATEGORY' + | 'HOME' + | 'PRODUCT' + | 'SEARCH'; export type ScriptPosition = - | "BODY_END" - | "BODY_START" - | "FOOTER_END" - | "FOOTER_START" - | "HEADER_END" - | "HEADER_START"; + | 'BODY_END' + | 'BODY_START' + | 'FOOTER_END' + | 'FOOTER_START' + | 'HEADER_END' + | 'HEADER_START'; /** Search for relevant products to the searched term. */ export type Search = { @@ -3158,39 +4234,41 @@ export type Search = { /** Information about forbidden term. */ forbiddenTerm?: Maybe; /** The quantity of products displayed per page. */ - pageSize: Scalars["Int"]["output"]; + pageSize: Scalars['Int']['output']; /** A cursor based paginated list of products from the search. */ products?: Maybe; /** An offset based paginated list of products from the search. */ productsByOffset?: Maybe; /** Redirection url in case a term in the search triggers a redirect. */ - redirectUrl?: Maybe; + redirectUrl?: Maybe; /** Time taken to perform the search. */ - searchTime?: Maybe; + searchTime?: Maybe; }; + /** Search for relevant products to the searched term. */ export type SearchProductsArgs = { - after?: InputMaybe; - before?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; filters?: InputMaybe>>; - first?: InputMaybe; - last?: InputMaybe; - maximumPrice?: InputMaybe; - minimumPrice?: InputMaybe; - onlyMainVariant?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + maximumPrice?: InputMaybe; + minimumPrice?: InputMaybe; + onlyMainVariant?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; }; + /** Search for relevant products to the searched term. */ export type SearchProductsByOffsetArgs = { filters?: InputMaybe>>; - limit?: InputMaybe; - maximumPrice?: InputMaybe; - minimumPrice?: InputMaybe; - offset?: InputMaybe; - onlyMainVariant?: InputMaybe; + limit?: InputMaybe; + maximumPrice?: InputMaybe; + minimumPrice?: InputMaybe; + offset?: InputMaybe; + onlyMainVariant?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; }; @@ -3198,9 +4276,9 @@ export type SearchProductsByOffsetArgs = { /** Aggregated filters of a list of products. */ export type SearchFilter = { /** The name of the field. */ - field?: Maybe; + field?: Maybe; /** The origin of the field. */ - origin?: Maybe; + origin?: Maybe; /** List of the values of the field. */ values?: Maybe>>; }; @@ -3208,90 +4286,100 @@ export type SearchFilter = { /** Details of a filter value. */ export type SearchFilterItem = { /** The name of the value. */ - name?: Maybe; + name?: Maybe; /** The quantity of product with this value. */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; }; /** The response data */ export type SearchRecord = { /** The date time of the processed request */ - date: Scalars["DateTime"]["output"]; + date: Scalars['DateTime']['output']; /** If the record was successful */ - isSuccess: Scalars["Boolean"]["output"]; + isSuccess: Scalars['Boolean']['output']; /** The searched query */ - query?: Maybe; + query?: Maybe; }; /** The information to be saved for reports. */ export type SearchRecordInput = { /** The search operation (And, Or) */ - operation?: InputMaybe; + operation?: InputMaybe; /** The current page */ - page: Scalars["Int"]["input"]; + page: Scalars['Int']['input']; /** How many products show in page */ - pageSize: Scalars["Int"]["input"]; + pageSize: Scalars['Int']['input']; /** The client search page url */ - pageUrl?: InputMaybe; + pageUrl?: InputMaybe; /** The user search query */ - query?: InputMaybe; + query?: InputMaybe; /** How many products the search returned */ - totalResults: Scalars["Int"]["input"]; + totalResults: Scalars['Int']['input']; }; /** The selected payment method details. */ export type SelectedPaymentMethod = { + /** The payment html. */ + html?: Maybe; /** The unique identifier for the selected payment method. */ - id: Scalars["Uuid"]["output"]; + id: Scalars['Uuid']['output']; /** The list of installments associated with the selected payment method. */ installments?: Maybe>>; + /** The payment Method Id. */ + paymentMethodId?: Maybe; + /** Payment related scripts. */ + scripts?: Maybe>>; /** The selected installment. */ selectedInstallment?: Maybe; + /** The suggested cards. */ + suggestedCards?: Maybe>>; }; /** Details of an installment of the selected payment method. */ export type SelectedPaymentMethodInstallment = { /** The adjustment value applied to the installment. */ - adjustment: Scalars["Float"]["output"]; + adjustment: Scalars['Float']['output']; /** The installment number. */ - number: Scalars["Int"]["output"]; + number: Scalars['Int']['output']; /** The total value of the installment. */ - total: Scalars["Float"]["output"]; + total: Scalars['Float']['output']; /** The individual value of each installment. */ - value: Scalars["Float"]["output"]; + value: Scalars['Float']['output']; }; /** Seller informations. */ export type Seller = { /** Seller name */ - name?: Maybe; + name?: Maybe; }; export type SellerInstallment = { /** Wether the installment has discount. */ - discount: Scalars["Boolean"]["output"]; + discount: Scalars['Boolean']['output']; /** Wether the installment has fees. */ - fees: Scalars["Boolean"]["output"]; + fees: Scalars['Boolean']['output']; /** The number of installments. */ - number: Scalars["Int"]["output"]; + number: Scalars['Int']['output']; /** The value of the installment. */ - value: Scalars["Decimal"]["output"]; + value: Scalars['Decimal']['output']; }; export type SellerInstallmentPlan = { /** The custom display name of this installment plan. */ - displayName?: Maybe; + displayName?: Maybe; /** List of the installments. */ installments?: Maybe>>; }; /** The seller's product offer */ export type SellerOffer = { - name?: Maybe; + name?: Maybe; /** The product prices. */ prices?: Maybe; /** Variant unique identifier. */ - productVariantId?: Maybe; + productVariantId?: Maybe; + /** The stock of the product variant. */ + stock: Scalars['Int']['output']; }; /** The prices of the product. */ @@ -3299,96 +4387,142 @@ export type SellerPrices = { /** List of the possibles installment plans. */ installmentPlans?: Maybe>>; /** The listed regular price of the product. */ - listPrice?: Maybe; + listPrice?: Maybe; /** The current working price. */ - price?: Maybe; + price?: Maybe; +}; + +/** A connection to a list of items. */ +export type SellersConnection = { + /** A list of edges. */ + edges?: Maybe>; + /** A flattened list of the nodes. */ + nodes?: Maybe>>; + /** Information to aid in pagination. */ + pageInfo: PageInfo; + totalCount: Scalars['Int']['output']; +}; + +/** An edge in a connection. */ +export type SellersEdge = { + /** A cursor for use in pagination. */ + cursor: Scalars['String']['output']; + /** The item at the end of the edge. */ + node?: Maybe; }; export type ShippingNode = { /** The shipping deadline. */ - deadline: Scalars["Int"]["output"]; + deadline: Scalars['Int']['output']; + /** The shipping deadline in hours. */ + deadlineInHours?: Maybe; /** The delivery schedule detail. */ deliverySchedule?: Maybe; /** The shipping name. */ - name?: Maybe; + name?: Maybe; /** The shipping quote unique identifier. */ - shippingQuoteId: Scalars["Uuid"]["output"]; + shippingQuoteId: Scalars['Uuid']['output']; /** The shipping type. */ - type?: Maybe; + type?: Maybe; /** The shipping value. */ - value: Scalars["Float"]["output"]; + value: Scalars['Float']['output']; }; /** The product informations related to the shipping. */ export type ShippingProduct = { /** The product unique identifier. */ - productVariantId: Scalars["Int"]["output"]; + productVariantId: Scalars['Int']['output']; /** The shipping value related to the product. */ - value: Scalars["Float"]["output"]; + value: Scalars['Float']['output']; }; /** A shipping quote. */ export type ShippingQuote = Node & { /** The shipping deadline. */ - deadline: Scalars["Int"]["output"]; + deadline: Scalars['Int']['output']; + /** The shipping deadline in hours. */ + deadlineInHours?: Maybe; /** The available time slots for scheduling the delivery of the shipping quote. */ deliverySchedules?: Maybe>>; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The shipping name. */ - name?: Maybe; + name?: Maybe; /** The products related to the shipping. */ products?: Maybe>>; /** The shipping quote unique identifier. */ - shippingQuoteId: Scalars["Uuid"]["output"]; + shippingQuoteId: Scalars['Uuid']['output']; /** The shipping type. */ - type?: Maybe; + type?: Maybe; /** The shipping value. */ - value: Scalars["Float"]["output"]; + value: Scalars['Float']['output']; +}; + +/** A shipping quote group. */ +export type ShippingQuoteGroup = { + /** The distribution center. */ + distributionCenter?: Maybe; + /** The products related to the shipping quote group. */ + products?: Maybe>>; + /** Shipping quotes to group. */ + shippingQuotes?: Maybe>>; +}; + +/** The product informations related to the shipping. */ +export type ShippingQuoteGroupProduct = { + /** The product unique identifier. */ + productVariantId: Scalars['Int']['output']; }; /** Informations about the store. */ export type Shop = { /** Checkout URL */ - checkoutUrl?: Maybe; + checkoutUrl?: Maybe; + /** The Google Recaptcha Site Key for reCAPTCHA validation */ + googleRecaptchaSiteKey?: Maybe; /** Store main URL */ - mainUrl?: Maybe; + mainUrl?: Maybe; /** Mobile checkout URL */ - mobileCheckoutUrl?: Maybe; + mobileCheckoutUrl?: Maybe; /** Mobile URL */ - mobileUrl?: Maybe; + mobileUrl?: Maybe; /** Store modified name */ - modifiedName?: Maybe; + modifiedName?: Maybe; /** Store name */ - name?: Maybe; + name?: Maybe; /** Physical stores */ physicalStores?: Maybe>>; + /** The URL to obtain the SitemapImagens.xml file */ + sitemapImagesUrl?: Maybe; + /** The URL to obtain the Sitemap.xml file */ + sitemapUrl?: Maybe; }; /** Store setting. */ export type ShopSetting = { /** Setting name */ - name?: Maybe; + name?: Maybe; /** Setting value */ - value?: Maybe; + value?: Maybe; }; /** Information about a similar product. */ export type SimilarProduct = { /** The url alias of this similar product. */ - alias?: Maybe; + alias?: Maybe; /** The file name of the similar product image. */ - image?: Maybe; + image?: Maybe; /** The URL of the similar product image. */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** The name of the similar product. */ - name?: Maybe; + name?: Maybe; }; + /** Information about a similar product. */ export type SimilarProductImageUrlArgs = { - h?: InputMaybe; - w?: InputMaybe; + h?: InputMaybe; + w?: InputMaybe; }; export type SimpleLogin = { @@ -3402,8 +4536,8 @@ export type SimpleLogin = { /** The simple login type. */ export type SimpleLoginType = - | "NEW" - | "SIMPLE"; + | 'NEW' + | 'SIMPLE'; /** A hotsite is a group of products used to organize them or to make them easier to browse. */ export type SingleHotsite = Node & { @@ -3416,17 +4550,17 @@ export type SingleHotsite = Node & { /** A list of contents associated with the hotsite. */ contents?: Maybe>>; /** The hotsite will be displayed until this date. */ - endDate?: Maybe; + endDate?: Maybe; /** Expression used to associate products to the hotsite. */ - expression?: Maybe; + expression?: Maybe; /** Hotsite unique identifier. */ - hotsiteId: Scalars["Long"]["output"]; + hotsiteId: Scalars['Long']['output']; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The hotsite's name. */ - name?: Maybe; + name?: Maybe; /** Set the quantity of products displayed per page. */ - pageSize: Scalars["Int"]["output"]; + pageSize: Scalars['Int']['output']; /** A list of products associated with the hotsite. Cursor pagination. */ products?: Maybe; /** A list of products associated with the hotsite. Offset pagination. */ @@ -3436,39 +4570,41 @@ export type SingleHotsite = Node & { /** Sorting information to be used by default on the hotsite. */ sorting?: Maybe; /** The hotsite will be displayed from this date. */ - startDate?: Maybe; + startDate?: Maybe; /** The subtype of the hotsite. */ subtype?: Maybe; /** The template used for the hotsite. */ - template?: Maybe; + template?: Maybe; /** The hotsite's URL. */ - url?: Maybe; + url?: Maybe; }; + /** A hotsite is a group of products used to organize them or to make them easier to browse. */ export type SingleHotsiteProductsArgs = { - after?: InputMaybe; - before?: InputMaybe; + after?: InputMaybe; + before?: InputMaybe; filters?: InputMaybe>>; - first?: InputMaybe; - last?: InputMaybe; - maximumPrice?: InputMaybe; - minimumPrice?: InputMaybe; - onlyMainVariant?: InputMaybe; - partnerAccessToken?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + maximumPrice?: InputMaybe; + minimumPrice?: InputMaybe; + onlyMainVariant?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; }; + /** A hotsite is a group of products used to organize them or to make them easier to browse. */ export type SingleHotsiteProductsByOffsetArgs = { filters?: InputMaybe>>; - limit?: InputMaybe; - maximumPrice?: InputMaybe; - minimumPrice?: InputMaybe; - offset?: InputMaybe; - onlyMainVariant?: InputMaybe; - partnerAccessToken?: InputMaybe; + limit?: InputMaybe; + maximumPrice?: InputMaybe; + minimumPrice?: InputMaybe; + offset?: InputMaybe; + onlyMainVariant?: InputMaybe; + partnerAccessToken?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; }; @@ -3476,59 +4612,79 @@ export type SingleHotsiteProductsByOffsetArgs = { /** A product represents an item for sale in the store. */ export type SingleProduct = Node & { /** Check if the product can be added to cart directly from spot. */ - addToCartFromSpot?: Maybe; + addToCartFromSpot?: Maybe; /** The product url alias. */ - alias?: Maybe; + alias?: Maybe; + /** The complete product url alias. */ + aliasComplete?: Maybe; /** Information about the possible selection attributes. */ attributeSelections?: Maybe; /** List of the product attributes. */ attributes?: Maybe>>; + /** The product author. */ + author?: Maybe; /** Field to check if the product is available in stock. */ - available?: Maybe; + available?: Maybe; /** The product average rating. From 0 to 5. */ - averageRating?: Maybe; + averageRating?: Maybe; /** List of product breadcrumbs. */ breadcrumbs?: Maybe>>; /** BuyBox informations. */ buyBox?: Maybe; /** Buy together products. */ buyTogether?: Maybe>>; + /** Buy together groups products. */ + buyTogetherGroups?: Maybe>>; + /** The product collection. */ + collection?: Maybe; /** The product condition. */ - condition?: Maybe; + condition?: Maybe; + /** Checks if the product allows counteroffers. */ + counterOffer?: Maybe; /** The product creation date. */ - createdAt?: Maybe; + createdAt?: Maybe; /** A list of customizations available for the given products. */ customizations?: Maybe>>; /** The product delivery deadline. */ - deadline?: Maybe; + deadline?: Maybe; + /** Product deadline alert informations. */ + deadlineAlert?: Maybe; /** Check if the product should be displayed. */ - display?: Maybe; + display?: Maybe; /** Check if the product should be displayed only for partners. */ - displayOnlyPartner?: Maybe; + displayOnlyPartner?: Maybe; /** Check if the product should be displayed on search. */ - displaySearch?: Maybe; + displaySearch?: Maybe; /** The product's unique EAN. */ - ean?: Maybe; + ean?: Maybe; /** Check if the product offers free shipping. */ - freeShipping?: Maybe; + freeShipping?: Maybe; + /** The product gender. */ + gender?: Maybe; + /** The height of the product. */ + height?: Maybe; /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** List of the product images. */ images?: Maybe>>; /** List of the product insformations. */ informations?: Maybe>>; + /** The length of the product. */ + length?: Maybe; /** Check if its the main variant. */ - mainVariant?: Maybe; + mainVariant?: Maybe; + /** The product maximum quantity for an order. */ + maximumOrderQuantity?: Maybe; /** The product minimum quantity for an order. */ - minimumOrderQuantity?: Maybe; + minimumOrderQuantity?: Maybe; /** Check if the product is a new release. */ - newRelease?: Maybe; + newRelease?: Maybe; /** The number of votes that the average rating consists of. */ - numberOfVotes?: Maybe; + numberOfVotes?: Maybe; /** Product parallel options information. */ - parallelOptions?: Maybe>>; + parallelOptions?: Maybe>>; /** Parent product unique identifier. */ - parentId?: Maybe; + parentId?: Maybe; /** The product prices. */ prices?: Maybe; /** Summarized informations about the brand of the product. */ @@ -3536,15 +4692,20 @@ export type SingleProduct = Node & { /** Summarized informations about the categories of the product. */ productCategories?: Maybe>>; /** Product unique identifier. */ - productId?: Maybe; + productId?: Maybe; /** The product name. */ - productName?: Maybe; - /** Summarized informations about the subscription of the product. */ + productName?: Maybe; + /** + * Summarized informations about the subscription of the product. + * @deprecated Use subscriptionGroups to get subscription information. + */ productSubscription?: Maybe; /** Variant unique identifier. */ - productVariantId?: Maybe; + productVariantId?: Maybe; /** List of promotions this product belongs to. */ promotions?: Maybe>>; + /** The product publisher */ + publisher?: Maybe; /** List of customer reviews for this product. */ reviews?: Maybe>>; /** The product seller. */ @@ -3554,104 +4715,148 @@ export type SingleProduct = Node & { /** List of similar products. */ similarProducts?: Maybe>>; /** The product's unique SKU. */ - sku?: Maybe; + sku?: Maybe; /** The values of the spot attribute. */ - spotAttributes?: Maybe>>; + spotAttributes?: Maybe>>; /** The product spot information. */ - spotInformation?: Maybe; + spotInformation?: Maybe; /** Check if the product is on spotlight. */ - spotlight?: Maybe; - /** The available stock at the default distribution center. */ - stock?: Maybe; + spotlight?: Maybe; + /** The available aggregated product stock (all variants) at the default distribution center. */ + stock?: Maybe; /** List of the product stocks on different distribution centers. */ stocks?: Maybe>>; /** List of subscription groups this product belongs to. */ subscriptionGroups?: Maybe>>; /** Check if the product is a telesale. */ - telesales?: Maybe; + telesales?: Maybe; /** The product last update date. */ - updatedAt?: Maybe; + updatedAt?: Maybe; /** The product video url. */ - urlVideo?: Maybe; + urlVideo?: Maybe; /** The variant name. */ - variantName?: Maybe; + variantName?: Maybe; + /** The available aggregated variant stock at the default distribution center. */ + variantStock?: Maybe; + /** The weight of the product. */ + weight?: Maybe; + /** The width of the product. */ + width?: Maybe; }; + /** A product represents an item for sale in the store. */ export type SingleProductAttributeSelectionsArgs = { + includeParentIdVariants?: InputMaybe; selected?: InputMaybe>>; }; + /** A product represents an item for sale in the store. */ export type SingleProductImagesArgs = { - height?: InputMaybe; - width?: InputMaybe; + height?: InputMaybe; + width?: InputMaybe; }; /** Define the sort orientation of the result set. */ export type SortDirection = /** The results will be sorted in an ascending order. */ - | "ASC" + | 'ASC' /** The results will be sorted in an descending order. */ - | "DESC"; + | 'DESC'; + +/** The subscription status to update. */ +export type Status = + | 'ACTIVE' + | 'CANCELED' + | 'PAUSED'; /** Information about a product stock in a particular distribution center. */ export type Stock = { /** The id of the distribution center. */ - id: Scalars["Long"]["output"]; + id: Scalars['Long']['output']; /** The number of physical items in stock at this DC. */ - items: Scalars["Long"]["output"]; + items: Scalars['Long']['output']; /** The name of the distribution center. */ - name?: Maybe; + name?: Maybe; }; /** Input to specify the range of stocks, distribution center ID, and distribution center name to return. */ export type StocksInput = { /** The distribution center Ids to match. */ - dcId?: InputMaybe>; + dcId?: InputMaybe>; /** The distribution center names to match. */ - dcName?: InputMaybe>>; + dcName?: InputMaybe>>; /** The product stock must be greater than or equal to. */ - stock_gte?: InputMaybe; + stock_gte?: InputMaybe; /** The product stock must be lesser than or equal to. */ - stock_lte?: InputMaybe; + stock_lte?: InputMaybe; }; export type SubscriptionGroup = { /** The recurring types for this subscription group. */ recurringTypes?: Maybe>>; /** The status name of the group. */ - status?: Maybe; + status?: Maybe; /** The status id of the group. */ - statusId: Scalars["Int"]["output"]; + statusId: Scalars['Int']['output']; /** The subscription group id. */ - subscriptionGroupId: Scalars["Long"]["output"]; + subscriptionGroupId: Scalars['Long']['output']; /** Wether the product is only avaible for subscription. */ - subscriptionOnly: Scalars["Boolean"]["output"]; + subscriptionOnly: Scalars['Boolean']['output']; +}; + +/** Represents the product to be applied to the subscription. */ +export type SubscriptionProductsInput = { + /** The variant Id of the product. */ + productVariantId: Scalars['Long']['input']; + /** The quantity of the product. */ + quantity: Scalars['Int']['input']; }; export type SubscriptionRecurringType = { /** The number of days of the recurring type. */ - days: Scalars["Int"]["output"]; + days: Scalars['Int']['output']; /** The recurring type display name. */ - name?: Maybe; + name?: Maybe; /** The recurring type id. */ - recurringTypeId: Scalars["Long"]["output"]; + recurringTypeId: Scalars['Long']['output']; }; +export type SuggestedCard = { + /** Credit card brand. */ + brand?: Maybe; + /** Credit card key. */ + key?: Maybe; + /** Customer name on credit card. */ + name?: Maybe; + /** Credit card number. */ + number?: Maybe; +}; + +/** Represents the Type of Customer's Checking Account. */ +export type TypeCheckingAccount = + /** Credit */ + | 'Credit' + /** Debit */ + | 'Debit'; + export type UpdateCustomerAddressInput = { - addressDetails?: InputMaybe; - addressNumber?: InputMaybe; - cep?: InputMaybe; - city?: InputMaybe; - country?: InputMaybe; - email?: InputMaybe; - name?: InputMaybe; - neighborhood?: InputMaybe; - phone?: InputMaybe; - referencePoint?: InputMaybe; - state?: InputMaybe; - street?: InputMaybe; + address?: InputMaybe; + address2?: InputMaybe; + addressDetails?: InputMaybe; + addressNumber?: InputMaybe; + cep?: InputMaybe; + city?: InputMaybe; + country?: InputMaybe; + email?: InputMaybe; + name?: InputMaybe; + neighborhood?: InputMaybe; + phone?: InputMaybe; + receiverName?: InputMaybe; + referencePoint?: InputMaybe; + state?: InputMaybe; + street?: InputMaybe; }; /** Node of URI Kind. */ @@ -3663,34 +4868,34 @@ export type Uri = { /** The partner subtype. */ partnerSubtype?: Maybe; /** Product alias. */ - productAlias?: Maybe; + productAlias?: Maybe; /** Product categories IDs. */ - productCategoriesIds?: Maybe>; + productCategoriesIds?: Maybe>; /** Redirect status code. */ - redirectCode?: Maybe; + redirectCode?: Maybe; /** Url to redirect. */ - redirectUrl?: Maybe; + redirectUrl?: Maybe; }; export type UriKind = - | "BUY_LIST" - | "HOTSITE" - | "NOT_FOUND" - | "PARTNER" - | "PRODUCT" - | "REDIRECT"; + | 'BUY_LIST' + | 'HOTSITE' + | 'NOT_FOUND' + | 'PARTNER' + | 'PRODUCT' + | 'REDIRECT'; export type WholesalePrices = { /** The wholesale price. */ - price: Scalars["Decimal"]["output"]; + price: Scalars['Decimal']['output']; /** The minimum quantity required for the wholesale price to be applied */ - quantity: Scalars["Int"]["output"]; + quantity: Scalars['Int']['output']; }; /** A representation of available time slots for scheduling a delivery. */ export type DeliverySchedule = { /** The date of the delivery schedule. */ - date: Scalars["DateTime"]["output"]; + date: Scalars['DateTime']['output']; /** The list of time periods available for scheduling a delivery. */ periods?: Maybe>>; }; @@ -3698,71 +4903,83 @@ export type DeliverySchedule = { /** Informations about a forbidden search term. */ export type ForbiddenTerm = { /** The suggested search term instead. */ - suggested?: Maybe; + suggested?: Maybe; /** The text to display about the term. */ - text?: Maybe; + text?: Maybe; }; export type Order = { + /** Checking account value used for the order. */ + checkingAccount: Scalars['Decimal']['output']; + /** The checkout unique identifier. */ + checkoutId: Scalars['Uuid']['output']; /** The coupon for discounts. */ - coupon?: Maybe; - /** Current account value used for the order. */ - currentAccount: Scalars["Decimal"]["output"]; + coupon?: Maybe; /** The date when te order was placed. */ - date: Scalars["DateTime"]["output"]; + date: Scalars['DateTime']['output']; /** The address where the order will be delivered. */ deliveryAddress?: Maybe; /** Order discount amount, if any. */ - discount: Scalars["Decimal"]["output"]; + discount: Scalars['Decimal']['output']; /** Order interest fee, if any. */ - interestFee: Scalars["Decimal"]["output"]; + interestFee: Scalars['Decimal']['output']; /** Information about order invoices. */ invoices?: Maybe>>; + /** A list of kits belonging to the order. */ + kits?: Maybe>>; /** Information about order notes. */ notes?: Maybe>>; /** Order unique identifier. */ - orderId: Scalars["Long"]["output"]; + orderId: Scalars['Long']['output']; /** The date when the order was payed. */ - paymentDate?: Maybe; + paymentDate?: Maybe; /** Information about payments. */ payments?: Maybe>>; /** Products belonging to the order. */ products?: Maybe>>; /** List of promotions applied to the order. */ - promotions?: Maybe>; + promotions?: Maybe>; /** The shipping fee. */ - shippingFee: Scalars["Decimal"]["output"]; + shippingFee: Scalars['Decimal']['output']; /** Information about order shippings. */ shippings?: Maybe>>; /** The order current status. */ status?: Maybe; /** List of the order status history. */ statusHistory?: Maybe>>; + /** List of order subscriptions. */ + subscriptions?: Maybe>>; /** Order subtotal value. */ - subtotal: Scalars["Decimal"]["output"]; + subtotal: Scalars['Decimal']['output']; /** Order total value. */ - total: Scalars["Decimal"]["output"]; + total: Scalars['Decimal']['output']; /** Information about order trackings. */ trackings?: Maybe>>; }; export type PaymentMethod = Node & { /** The node unique identifier. */ - id?: Maybe; + id?: Maybe; /** The url link that displays for the payment. */ - imageUrl?: Maybe; + imageUrl?: Maybe; /** The name of the payment method. */ - name?: Maybe; + name?: Maybe; }; /** Represents a time period available for scheduling a delivery. */ export type Period = { /** The end time of the time period. */ - end?: Maybe; + end?: Maybe; /** The unique identifier of the time period. */ - id: Scalars["Long"]["output"]; + id: Scalars['Long']['output']; /** The start time of the time period. */ - start?: Maybe; + start?: Maybe; +}; + +/** The list of products to quote shipping. */ +export type ProductsInput = { + productVariantId: Scalars['Long']['input']; + quantity: Scalars['Int']['input']; }; export type Wishlist = { @@ -3770,817 +4987,290 @@ export type Wishlist = { products?: Maybe>>; }; -export type CheckoutFragment = { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; -}; - -export type ProductFragment = { - mainVariant?: boolean | null; - productName?: string | null; - productId?: any | null; - alias?: string | null; - available?: boolean | null; - averageRating?: number | null; - condition?: string | null; - createdAt?: any | null; - ean?: string | null; - id?: string | null; - minimumOrderQuantity?: number | null; - productVariantId?: any | null; - sku?: string | null; - stock?: any | null; - variantName?: string | null; - attributes?: - | Array<{ value?: string | null; name?: string | null } | null> - | null; - productCategories?: - | Array< - { - name?: string | null; - url?: string | null; - hierarchy?: string | null; - main: boolean; - googleCategories?: string | null; - } | null - > - | null; - informations?: - | Array< - | { title?: string | null; value?: string | null; type?: string | null } - | null - > - | null; - images?: - | Array< - { url?: string | null; fileName?: string | null; print: boolean } | null - > - | null; - prices?: { - discountPercentage: any; - discounted: boolean; - listPrice?: any | null; - multiplicationFactor: number; - price: any; - bestInstallment?: { - discount: boolean; - displayName?: string | null; - fees: boolean; - name?: string | null; - number: number; - value: any; - } | null; - installmentPlans?: - | Array< - { - displayName?: string | null; - name?: string | null; - installments?: - | Array< - | { discount: boolean; fees: boolean; number: number; value: any } - | null - > - | null; - } | null - > - | null; - priceTables?: - | Array< - | { - discountPercentage: any; - id: any; - listPrice?: any | null; - price: any; - } - | null - > - | null; - wholesalePrices?: Array<{ price: any; quantity: number } | null> | null; - } | null; - productBrand?: { - fullUrlLogo?: string | null; - logoUrl?: string | null; - name?: string | null; - alias?: string | null; - } | null; - seller?: { name?: string | null } | null; -}; - -export type SingleProductFragment = { - mainVariant?: boolean | null; - productName?: string | null; - productId?: any | null; - alias?: string | null; - available?: boolean | null; - averageRating?: number | null; - condition?: string | null; - createdAt?: any | null; - ean?: string | null; - id?: string | null; - minimumOrderQuantity?: number | null; - productVariantId?: any | null; - sku?: string | null; - stock?: any | null; - variantName?: string | null; - attributes?: - | Array<{ value?: string | null; name?: string | null } | null> - | null; - productCategories?: - | Array< - { - name?: string | null; - url?: string | null; - hierarchy?: string | null; - main: boolean; - googleCategories?: string | null; - } | null - > - | null; - informations?: - | Array< - | { title?: string | null; value?: string | null; type?: string | null } - | null - > - | null; - breadcrumbs?: - | Array<{ text?: string | null; link?: string | null } | null> - | null; - images?: - | Array< - { url?: string | null; fileName?: string | null; print: boolean } | null - > - | null; - prices?: { - discountPercentage: any; - discounted: boolean; - listPrice?: any | null; - multiplicationFactor: number; - price: any; - bestInstallment?: { - discount: boolean; - displayName?: string | null; - fees: boolean; - name?: string | null; - number: number; - value: any; - } | null; - installmentPlans?: - | Array< - { - displayName?: string | null; - name?: string | null; - installments?: - | Array< - | { discount: boolean; fees: boolean; number: number; value: any } - | null - > - | null; - } | null - > - | null; - priceTables?: - | Array< - | { - discountPercentage: any; - id: any; - listPrice?: any | null; - price: any; - } - | null - > - | null; - wholesalePrices?: Array<{ price: any; quantity: number } | null> | null; - } | null; - productBrand?: { - fullUrlLogo?: string | null; - logoUrl?: string | null; - name?: string | null; - alias?: string | null; - } | null; - reviews?: - | Array< - { - rating: number; - review?: string | null; - reviewDate: any; - email?: string | null; - customer?: string | null; - } | null - > - | null; - seller?: { name?: string | null } | null; - seo?: - | Array< - { - name?: string | null; - scheme?: string | null; - type?: string | null; - httpEquiv?: string | null; - content?: string | null; - } | null - > - | null; -}; +export type CheckoutFragment = { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null }; + +export type ProductFragment = { mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null }; + +export type ProductVariantFragment = { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null }; + +export type BuyListFragment = { mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, collection?: string | null, kit: boolean, numberOfVotes?: number | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, sku?: string | null, stock?: any | null, variantName?: string | null, parallelOptions?: Array | null, urlVideo?: string | null, buyListId: number, attributes?: Array<{ name?: string | null, type?: string | null, value?: string | null, attributeId: any, displayType?: string | null, id?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null, id: any } | null> | null, breadcrumbs?: Array<{ text?: string | null, link?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, seo?: Array<{ name?: string | null, scheme?: string | null, type?: string | null, httpEquiv?: string | null, content?: string | null } | null> | null, reviews?: Array<{ rating: number, review?: string | null, reviewDate: any, email?: string | null, customer?: string | null } | null> | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, attributeSelections?: { canBeMatrix: boolean, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, value?: string | null, selected: boolean, printUrl?: string | null } | null> | null } | null> | null, matrix?: { column?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null } | null> | null } | null, data?: Array | null> | null, row?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null, printUrl?: string | null } | null> | null } | null } | null } | null, buyTogether?: Array<{ productId?: any | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null, buyListProducts?: Array<{ productId: any, quantity: number, includeSameParent: boolean } | null> | null }; + +export type SingleProductPartFragment = { mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, collection?: string | null, numberOfVotes?: number | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, sku?: string | null, stock?: any | null, variantName?: string | null, parallelOptions?: Array | null, urlVideo?: string | null, attributes?: Array<{ name?: string | null, type?: string | null, value?: string | null, attributeId: any, displayType?: string | null, id?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, breadcrumbs?: Array<{ text?: string | null, link?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, seo?: Array<{ name?: string | null, scheme?: string | null, type?: string | null, httpEquiv?: string | null, content?: string | null } | null> | null, reviews?: Array<{ rating: number, review?: string | null, reviewDate: any, email?: string | null, customer?: string | null } | null> | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, attributeSelections?: { canBeMatrix: boolean, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, value?: string | null, selected: boolean, printUrl?: string | null } | null> | null } | null> | null, matrix?: { column?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null } | null> | null } | null, data?: Array | null> | null, row?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null, printUrl?: string | null } | null> | null } | null } | null, selectedVariant?: { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null, candidateVariant?: { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null } | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null }; + +export type SingleProductFragment = { mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, collection?: string | null, numberOfVotes?: number | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, sku?: string | null, stock?: any | null, variantName?: string | null, parallelOptions?: Array | null, urlVideo?: string | null, buyTogether?: Array<{ productId?: any | null } | null> | null, attributes?: Array<{ name?: string | null, type?: string | null, value?: string | null, attributeId: any, displayType?: string | null, id?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, breadcrumbs?: Array<{ text?: string | null, link?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, seo?: Array<{ name?: string | null, scheme?: string | null, type?: string | null, httpEquiv?: string | null, content?: string | null } | null> | null, reviews?: Array<{ rating: number, review?: string | null, reviewDate: any, email?: string | null, customer?: string | null } | null> | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, attributeSelections?: { canBeMatrix: boolean, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, value?: string | null, selected: boolean, printUrl?: string | null } | null> | null } | null> | null, matrix?: { column?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null } | null> | null } | null, data?: Array | null> | null, row?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null, printUrl?: string | null } | null> | null } | null } | null, selectedVariant?: { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null, candidateVariant?: { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null } | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null }; + +export type RestockAlertNodeFragment = { email?: string | null, name?: string | null, productVariantId: any, requestDate: any }; + +export type NewsletterNodeFragment = { email?: string | null, name?: string | null, createDate: any, updateDate?: any | null }; + +export type ShippingQuoteFragment = { id?: string | null, type?: string | null, name?: string | null, value: number, deadline: number, shippingQuoteId: any, deliverySchedules?: Array<{ date: any, periods?: Array<{ end?: string | null, id: any, start?: string | null } | null> | null } | null> | null, products?: Array<{ productVariantId: number, value: number } | null> | null }; + +export type CustomerFragment = { id?: string | null, email?: string | null, gender?: string | null, customerId: any, companyName?: string | null, customerName?: string | null, customerType?: string | null, responsibleName?: string | null, informationGroups?: Array<{ exibitionName?: string | null, name?: string | null } | null> | null }; + +export type WishlistReducedProductFragment = { productId?: any | null, productName?: string | null }; export type GetProductQueryVariables = Exact<{ - productId: Scalars["Long"]["input"]; + productId: Scalars['Long']['input']; + includeParentIdVariants?: InputMaybe; + partnerAccessToken?: InputMaybe; }>; -export type GetProductQuery = { - product?: { - mainVariant?: boolean | null; - productName?: string | null; - productId?: any | null; - alias?: string | null; - available?: boolean | null; - averageRating?: number | null; - condition?: string | null; - createdAt?: any | null; - ean?: string | null; - id?: string | null; - minimumOrderQuantity?: number | null; - productVariantId?: any | null; - sku?: string | null; - stock?: any | null; - variantName?: string | null; - attributes?: - | Array<{ value?: string | null; name?: string | null } | null> - | null; - productCategories?: - | Array< - { - name?: string | null; - url?: string | null; - hierarchy?: string | null; - main: boolean; - googleCategories?: string | null; - } | null - > - | null; - informations?: - | Array< - | { title?: string | null; value?: string | null; type?: string | null } - | null - > - | null; - breadcrumbs?: - | Array<{ text?: string | null; link?: string | null } | null> - | null; - images?: - | Array< - { url?: string | null; fileName?: string | null; print: boolean } | null - > - | null; - prices?: { - discountPercentage: any; - discounted: boolean; - listPrice?: any | null; - multiplicationFactor: number; - price: any; - bestInstallment?: { - discount: boolean; - displayName?: string | null; - fees: boolean; - name?: string | null; - number: number; - value: any; - } | null; - installmentPlans?: - | Array< - { - displayName?: string | null; - name?: string | null; - installments?: - | Array< - | { - discount: boolean; - fees: boolean; - number: number; - value: any; - } - | null - > - | null; - } | null - > - | null; - priceTables?: - | Array< - { - discountPercentage: any; - id: any; - listPrice?: any | null; - price: any; - } | null - > - | null; - wholesalePrices?: Array<{ price: any; quantity: number } | null> | null; - } | null; - productBrand?: { - fullUrlLogo?: string | null; - logoUrl?: string | null; - name?: string | null; - alias?: string | null; - } | null; - reviews?: - | Array< - { - rating: number; - review?: string | null; - reviewDate: any; - email?: string | null; - customer?: string | null; - } | null - > - | null; - seller?: { name?: string | null } | null; - seo?: - | Array< - { - name?: string | null; - scheme?: string | null; - type?: string | null; - httpEquiv?: string | null; - content?: string | null; - } | null - > - | null; - } | null; -}; + +export type GetProductQuery = { product?: { mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, collection?: string | null, numberOfVotes?: number | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, sku?: string | null, stock?: any | null, variantName?: string | null, parallelOptions?: Array | null, urlVideo?: string | null, buyTogether?: Array<{ productId?: any | null } | null> | null, attributes?: Array<{ name?: string | null, type?: string | null, value?: string | null, attributeId: any, displayType?: string | null, id?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, breadcrumbs?: Array<{ text?: string | null, link?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, seo?: Array<{ name?: string | null, scheme?: string | null, type?: string | null, httpEquiv?: string | null, content?: string | null } | null> | null, reviews?: Array<{ rating: number, review?: string | null, reviewDate: any, email?: string | null, customer?: string | null } | null> | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, attributeSelections?: { canBeMatrix: boolean, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, value?: string | null, selected: boolean, printUrl?: string | null } | null> | null } | null> | null, matrix?: { column?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null } | null> | null } | null, data?: Array | null> | null, row?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null, printUrl?: string | null } | null> | null } | null } | null, selectedVariant?: { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null, candidateVariant?: { aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null } | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null }; export type GetCartQueryVariables = Exact<{ - checkoutId: Scalars["String"]["input"]; + checkoutId: Scalars['String']['input']; }>; -export type GetCartQuery = { - checkout?: { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; - } | null; -}; - -export type CreateCartMutationVariables = Exact<{ [key: string]: never }>; - -export type CreateCartMutation = { - checkout?: { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; - } | null; -}; + +export type GetCartQuery = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; + +export type CreateCartMutationVariables = Exact<{ [key: string]: never; }>; + + +export type CreateCartMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; export type GetProductsQueryVariables = Exact<{ filters: ProductExplicitFiltersInput; - first: Scalars["Int"]["input"]; + first: Scalars['Int']['input']; sortDirection: SortDirection; sortKey?: InputMaybe; + after?: InputMaybe; + partnerAccessToken?: InputMaybe; }>; -export type GetProductsQuery = { - products?: { - nodes?: - | Array< - { - mainVariant?: boolean | null; - productName?: string | null; - productId?: any | null; - alias?: string | null; - available?: boolean | null; - averageRating?: number | null; - condition?: string | null; - createdAt?: any | null; - ean?: string | null; - id?: string | null; - minimumOrderQuantity?: number | null; - productVariantId?: any | null; - sku?: string | null; - stock?: any | null; - variantName?: string | null; - attributes?: - | Array<{ value?: string | null; name?: string | null } | null> - | null; - productCategories?: - | Array< - { - name?: string | null; - url?: string | null; - hierarchy?: string | null; - main: boolean; - googleCategories?: string | null; - } | null - > - | null; - informations?: - | Array< - { - title?: string | null; - value?: string | null; - type?: string | null; - } | null - > - | null; - images?: - | Array< - | { - url?: string | null; - fileName?: string | null; - print: boolean; - } - | null - > - | null; - prices?: { - discountPercentage: any; - discounted: boolean; - listPrice?: any | null; - multiplicationFactor: number; - price: any; - bestInstallment?: { - discount: boolean; - displayName?: string | null; - fees: boolean; - name?: string | null; - number: number; - value: any; - } | null; - installmentPlans?: - | Array< - { - displayName?: string | null; - name?: string | null; - installments?: - | Array< - { - discount: boolean; - fees: boolean; - number: number; - value: any; - } | null - > - | null; - } | null - > - | null; - priceTables?: - | Array< - { - discountPercentage: any; - id: any; - listPrice?: any | null; - price: any; - } | null - > - | null; - wholesalePrices?: - | Array<{ price: any; quantity: number } | null> - | null; - } | null; - productBrand?: { - fullUrlLogo?: string | null; - logoUrl?: string | null; - name?: string | null; - alias?: string | null; - } | null; - seller?: { name?: string | null } | null; - } | null - > - | null; - } | null; -}; + +export type GetProductsQuery = { products?: { totalCount: number, nodes?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null, pageInfo: { hasNextPage: boolean, endCursor?: string | null, hasPreviousPage: boolean, startCursor?: string | null } } | null }; export type SearchQueryVariables = Exact<{ operation: Operation; - query?: InputMaybe; - first: Scalars["Int"]["input"]; + query?: InputMaybe; + onlyMainVariant?: InputMaybe; + minimumPrice?: InputMaybe; + maximumPrice?: InputMaybe; + limit?: InputMaybe; + offset?: InputMaybe; sortDirection?: InputMaybe; sortKey?: InputMaybe; - filters?: InputMaybe< - Array> | InputMaybe - >; + filters?: InputMaybe> | InputMaybe>; + partnerAccessToken?: InputMaybe; }>; -export type SearchQuery = { - search?: { - pageSize: number; - redirectUrl?: string | null; - searchTime?: string | null; - aggregations?: { - filters?: - | Array< - { - field?: string | null; - origin?: string | null; - values?: - | Array<{ quantity: number; name?: string | null } | null> - | null; - } | null - > - | null; - } | null; - breadcrumbs?: - | Array<{ link?: string | null; text?: string | null } | null> - | null; - forbiddenTerm?: { text?: string | null; suggested?: string | null } | null; - products?: { - totalCount: number; - nodes?: - | Array< - { - mainVariant?: boolean | null; - productName?: string | null; - productId?: any | null; - alias?: string | null; - available?: boolean | null; - averageRating?: number | null; - condition?: string | null; - createdAt?: any | null; - ean?: string | null; - id?: string | null; - minimumOrderQuantity?: number | null; - productVariantId?: any | null; - sku?: string | null; - stock?: any | null; - variantName?: string | null; - attributes?: - | Array<{ value?: string | null; name?: string | null } | null> - | null; - productCategories?: - | Array< - { - name?: string | null; - url?: string | null; - hierarchy?: string | null; - main: boolean; - googleCategories?: string | null; - } | null - > - | null; - informations?: - | Array< - { - title?: string | null; - value?: string | null; - type?: string | null; - } | null - > - | null; - images?: - | Array< - { - url?: string | null; - fileName?: string | null; - print: boolean; - } | null - > - | null; - prices?: { - discountPercentage: any; - discounted: boolean; - listPrice?: any | null; - multiplicationFactor: number; - price: any; - bestInstallment?: { - discount: boolean; - displayName?: string | null; - fees: boolean; - name?: string | null; - number: number; - value: any; - } | null; - installmentPlans?: - | Array< - { - displayName?: string | null; - name?: string | null; - installments?: - | Array< - { - discount: boolean; - fees: boolean; - number: number; - value: any; - } | null - > - | null; - } | null - > - | null; - priceTables?: - | Array< - { - discountPercentage: any; - id: any; - listPrice?: any | null; - price: any; - } | null - > - | null; - wholesalePrices?: - | Array<{ price: any; quantity: number } | null> - | null; - } | null; - productBrand?: { - fullUrlLogo?: string | null; - logoUrl?: string | null; - name?: string | null; - alias?: string | null; - } | null; - seller?: { name?: string | null } | null; - } | null - > - | null; - pageInfo: { hasNextPage: boolean; hasPreviousPage: boolean }; - } | null; - } | null; -}; + +export type SearchQuery = { result?: { pageSize: number, redirectUrl?: string | null, searchTime?: string | null, aggregations?: { maximumPrice: any, minimumPrice: any, priceRanges?: Array<{ quantity: number, range?: string | null } | null> | null, filters?: Array<{ field?: string | null, origin?: string | null, values?: Array<{ quantity: number, name?: string | null } | null> | null } | null> | null } | null, breadcrumbs?: Array<{ link?: string | null, text?: string | null } | null> | null, forbiddenTerm?: { text?: string | null, suggested?: string | null } | null, productsByOffset?: { page: number, pageSize: number, totalCount: number, items?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null } | null } | null }; export type AddCouponMutationVariables = Exact<{ - checkoutId: Scalars["Uuid"]["input"]; - coupon: Scalars["String"]["input"]; + checkoutId: Scalars['Uuid']['input']; + coupon: Scalars['String']['input']; }>; -export type AddCouponMutation = { - checkout?: { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; - } | null; -}; + +export type AddCouponMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; export type AddItemToCartMutationVariables = Exact<{ input: CheckoutProductInput; }>; -export type AddItemToCartMutation = { - checkout?: { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; - } | null; -}; + +export type AddItemToCartMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; export type RemoveCouponMutationVariables = Exact<{ - checkoutId: Scalars["Uuid"]["input"]; + checkoutId: Scalars['Uuid']['input']; }>; -export type RemoveCouponMutation = { - checkout?: { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; - } | null; -}; + +export type RemoveCouponMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; export type RemoveItemFromCartMutationVariables = Exact<{ input: CheckoutProductInput; }>; -export type RemoveItemFromCartMutation = { - checkout?: { - checkoutId: any; - shippingFee: any; - subtotal: any; - total: any; - completed: boolean; - coupon?: string | null; - products?: - | Array< - { - imageUrl?: string | null; - brand?: string | null; - ajustedPrice: any; - listPrice: any; - price: any; - name?: string | null; - productId: any; - productVariantId: any; - quantity: number; - sku?: string | null; - url?: string | null; - } | null - > - | null; - } | null; -}; + +export type RemoveItemFromCartMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; + +export type ProductRestockAlertMutationVariables = Exact<{ + input: RestockAlertInput; +}>; + + +export type ProductRestockAlertMutation = { productRestockAlert?: { email?: string | null, name?: string | null, productVariantId: any, requestDate: any } | null }; + +export type WishlistAddProductMutationVariables = Exact<{ + customerAccessToken: Scalars['String']['input']; + productId: Scalars['Long']['input']; +}>; + + +export type WishlistAddProductMutation = { wishlistAddProduct?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null }; + +export type WishlistRemoveProductMutationVariables = Exact<{ + customerAccessToken: Scalars['String']['input']; + productId: Scalars['Long']['input']; +}>; + + +export type WishlistRemoveProductMutation = { wishlistRemoveProduct?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null }; + +export type CreateNewsletterRegisterMutationVariables = Exact<{ + input: NewsletterInput; +}>; + + +export type CreateNewsletterRegisterMutation = { createNewsletterRegister?: { email?: string | null, name?: string | null, createDate: any, updateDate?: any | null } | null }; + +export type AutocompleteQueryVariables = Exact<{ + limit?: InputMaybe; + query?: InputMaybe; + partnerAccessToken?: InputMaybe; +}>; + + +export type AutocompleteQuery = { autocomplete?: { suggestions?: Array | null, products?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null } | null }; + +export type ProductRecommendationsQueryVariables = Exact<{ + productId: Scalars['Long']['input']; + algorithm: ProductRecommendationAlgorithm; + partnerAccessToken?: InputMaybe; + quantity: Scalars['Int']['input']; +}>; + + +export type ProductRecommendationsQuery = { productRecommendations?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null }; + +export type ShippingQuotesQueryVariables = Exact<{ + cep?: InputMaybe; + checkoutId?: InputMaybe; + productVariantId?: InputMaybe; + quantity?: InputMaybe; + useSelectedAddress?: InputMaybe; +}>; + + +export type ShippingQuotesQuery = { shippingQuotes?: Array<{ id?: string | null, type?: string | null, name?: string | null, value: number, deadline: number, shippingQuoteId: any, deliverySchedules?: Array<{ date: any, periods?: Array<{ end?: string | null, id: any, start?: string | null } | null> | null } | null> | null, products?: Array<{ productVariantId: number, value: number } | null> | null } | null> | null }; + +export type GetUserQueryVariables = Exact<{ + customerAccessToken?: InputMaybe; +}>; + + +export type GetUserQuery = { customer?: { id?: string | null, email?: string | null, gender?: string | null, customerId: any, companyName?: string | null, customerName?: string | null, customerType?: string | null, responsibleName?: string | null, informationGroups?: Array<{ exibitionName?: string | null, name?: string | null } | null> | null } | null }; + +export type GetWishlistQueryVariables = Exact<{ + customerAccessToken?: InputMaybe; +}>; + + +export type GetWishlistQuery = { customer?: { wishlist?: { products?: Array<{ productId?: any | null, productName?: string | null } | null> | null } | null } | null }; + +export type GetUrlQueryVariables = Exact<{ + url: Scalars['String']['input']; +}>; + + +export type GetUrlQuery = { uri?: { hotsiteSubtype?: HotsiteSubtype | null, kind: UriKind, partnerSubtype?: PartnerSubtype | null, productAlias?: string | null, productCategoriesIds?: Array | null, redirectCode?: string | null, redirectUrl?: string | null } | null }; + +export type CreateProductReviewMutationVariables = Exact<{ + email: Scalars['String']['input']; + name: Scalars['String']['input']; + productVariantId: Scalars['Long']['input']; + rating: Scalars['Int']['input']; + review: Scalars['String']['input']; +}>; + + +export type CreateProductReviewMutation = { createProductReview?: { customer?: string | null, email?: string | null, rating: number, review?: string | null, reviewDate: any } | null }; + +export type SendGenericFormMutationVariables = Exact<{ + body?: InputMaybe; + file?: InputMaybe; + recaptchaToken?: InputMaybe; +}>; + + +export type SendGenericFormMutation = { sendGenericForm?: { isSuccess: boolean } | null }; + +export type HotsiteQueryVariables = Exact<{ + url?: InputMaybe; + filters?: InputMaybe> | InputMaybe>; + limit?: InputMaybe; + maximumPrice?: InputMaybe; + minimumPrice?: InputMaybe; + onlyMainVariant?: InputMaybe; + offset?: InputMaybe; + sortDirection?: InputMaybe; + sortKey?: InputMaybe; + partnerAccessToken?: InputMaybe; +}>; + + +export type HotsiteQuery = { result?: { endDate?: any | null, expression?: string | null, id?: string | null, name?: string | null, pageSize: number, startDate?: any | null, subtype?: HotsiteSubtype | null, template?: string | null, url?: string | null, hotsiteId: any, aggregations?: { maximumPrice: any, minimumPrice: any, filters?: Array<{ field?: string | null, origin?: string | null, values?: Array<{ name?: string | null, quantity: number } | null> | null } | null> | null, priceRanges?: Array<{ quantity: number, range?: string | null } | null> | null } | null, productsByOffset?: { page: number, pageSize: number, totalCount: number, items?: Array<{ mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, parentId?: any | null, sku?: string | null, numberOfVotes?: number | null, stock?: any | null, variantName?: string | null, variantStock?: any | null, collection?: string | null, urlVideo?: string | null, attributes?: Array<{ id?: string | null, type?: string | null, value?: string | null, name?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null } | null, breadcrumbs?: Array<{ link?: string | null, text?: string | null } | null> | null, seo?: Array<{ content?: string | null, httpEquiv?: string | null, name?: string | null, scheme?: string | null, type?: string | null } | null> | null, sorting?: { direction?: SortDirection | null, field?: ProductSortKeys | null } | null } | null }; + +export type ProductOptionsQueryVariables = Exact<{ + productId: Scalars['Long']['input']; +}>; + + +export type ProductOptionsQuery = { productOptions?: { id?: string | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, values?: Array<{ value?: string | null, productVariants?: Array<{ aggregatedStock?: any | null, alias?: string | null, available?: boolean | null, ean?: string | null, id?: string | null, productId?: any | null, productVariantId?: any | null, productVariantName?: string | null, sku?: string | null, stock?: any | null, attributes?: Array<{ attributeId: any, displayType?: string | null, id?: string | null, name?: string | null, type?: string | null, value?: string | null } | null> | null, images?: Array<{ fileName?: string | null, mini: boolean, order: number, print: boolean, url?: string | null } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null } | null, offers?: Array<{ name?: string | null, productVariantId?: any | null, prices?: { listPrice?: any | null, price?: any | null, installmentPlans?: Array<{ displayName?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null } | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null } | null> | null } | null> | null } | null> | null } | null }; + +export type ShopQueryVariables = Exact<{ [key: string]: never; }>; + + +export type ShopQuery = { shop?: { checkoutUrl?: string | null, mainUrl?: string | null, mobileCheckoutUrl?: string | null, mobileUrl?: string | null, modifiedName?: string | null, name?: string | null } | null }; + +export type BuyListQueryVariables = Exact<{ + id: Scalars['Long']['input']; + partnerAccessToken?: InputMaybe; +}>; + + +export type BuyListQuery = { buyList?: { mainVariant?: boolean | null, productName?: string | null, productId?: any | null, alias?: string | null, collection?: string | null, kit: boolean, numberOfVotes?: number | null, available?: boolean | null, averageRating?: number | null, condition?: string | null, createdAt?: any | null, ean?: string | null, id?: string | null, minimumOrderQuantity?: number | null, productVariantId?: any | null, sku?: string | null, stock?: any | null, variantName?: string | null, parallelOptions?: Array | null, urlVideo?: string | null, buyListId: number, attributes?: Array<{ name?: string | null, type?: string | null, value?: string | null, attributeId: any, displayType?: string | null, id?: string | null } | null> | null, productCategories?: Array<{ id: number, name?: string | null, url?: string | null, hierarchy?: string | null, main: boolean, googleCategories?: string | null } | null> | null, informations?: Array<{ title?: string | null, value?: string | null, type?: string | null, id: any } | null> | null, breadcrumbs?: Array<{ text?: string | null, link?: string | null } | null> | null, images?: Array<{ url?: string | null, fileName?: string | null, print: boolean } | null> | null, prices?: { discountPercentage: any, discounted: boolean, listPrice?: any | null, multiplicationFactor: number, price: any, bestInstallment?: { discount: boolean, displayName?: string | null, fees: boolean, name?: string | null, number: number, value: any } | null, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, priceTables?: Array<{ discountPercentage: any, id: any, listPrice?: any | null, price: any } | null> | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null, productBrand?: { fullUrlLogo?: string | null, logoUrl?: string | null, name?: string | null, alias?: string | null } | null, seller?: { name?: string | null } | null, seo?: Array<{ name?: string | null, scheme?: string | null, type?: string | null, httpEquiv?: string | null, content?: string | null } | null> | null, reviews?: Array<{ rating: number, review?: string | null, reviewDate: any, email?: string | null, customer?: string | null } | null> | null, similarProducts?: Array<{ alias?: string | null, image?: string | null, imageUrl?: string | null, name?: string | null } | null> | null, attributeSelections?: { canBeMatrix: boolean, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, value?: string | null, selected: boolean, printUrl?: string | null } | null> | null } | null> | null, matrix?: { column?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null } | null> | null } | null, data?: Array | null> | null, row?: { displayType?: string | null, name?: string | null, values?: Array<{ value?: string | null, printUrl?: string | null } | null> | null } | null } | null } | null, buyTogether?: Array<{ productId?: any | null } | null> | null, promotions?: Array<{ content?: string | null, disclosureType?: string | null, id: any, fullStampUrl?: string | null, stamp?: string | null, title?: string | null } | null> | null, buyListProducts?: Array<{ productId: any, quantity: number, includeSameParent: boolean } | null> | null } | null }; + +export type AddKitMutationVariables = Exact<{ + input: CheckoutKitInput; + customerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; +}>; + + +export type AddKitMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; + +export type RemoveKitMutationVariables = Exact<{ + input: CheckoutKitInput; + customerAccessToken?: InputMaybe; + recaptchaToken?: InputMaybe; +}>; + + +export type RemoveKitMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; + +export type GetPartnersQueryVariables = Exact<{ + first?: InputMaybe; + last?: InputMaybe; + names?: InputMaybe> | InputMaybe>; + priceTableIds?: InputMaybe | Scalars['Int']['input']>; + sortDirection?: SortDirection; + sortKey?: PartnerSortKeys; + before?: InputMaybe; + alias?: InputMaybe> | InputMaybe>; + after?: InputMaybe; +}>; + + +export type GetPartnersQuery = { partners?: { edges?: Array<{ node?: { partnerId: any, priceTableId: number, portfolioId: number, type?: string | null, startDate: any, endDate: any, name?: string | null, alias?: string | null, fullUrlLogo?: string | null, origin?: string | null, partnerAccessToken?: string | null } | null }> | null } | null }; + +export type CheckoutPartnerAssociateMutationVariables = Exact<{ + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; + partnerAccessToken: Scalars['String']['input']; +}>; + + +export type CheckoutPartnerAssociateMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; + +export type CheckoutPartnerDisassociateMutationVariables = Exact<{ + checkoutId: Scalars['Uuid']['input']; + customerAccessToken?: InputMaybe; +}>; + + +export type CheckoutPartnerDisassociateMutation = { checkout?: { checkoutId: any, shippingFee: any, subtotal: any, total: any, completed: boolean, coupon?: string | null, customer?: { customerId: any } | null, products?: Array<{ imageUrl?: string | null, brand?: string | null, ajustedPrice: any, listPrice: any, totalListPrice: any, totalAdjustedPrice: any, price: any, name?: string | null, productId: any, productVariantId: any, quantity: number, sku?: string | null, url?: string | null, category?: string | null, kit: boolean, gift: boolean, seller?: { sellerName?: string | null, distributionCenterId?: string | null } | null, productAttributes?: Array<{ name?: string | null, type: number, value?: string | null } | null> | null, adjustments?: Array<{ observation?: string | null, type?: string | null, value: any } | null> | null, subscription?: { availableSubscriptions?: Array<{ name?: string | null, recurringDays: number, recurringTypeId: any, selected: boolean, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null> | null, selected?: { selected: boolean, name?: string | null, recurringDays: number, recurringTypeId: any, subscriptionGroupDiscount: any, subscriptionGroupId: any } | null } | null, customization?: { id?: string | null, availableCustomizations?: Array<{ cost: any, customizationId: any, groupName?: string | null, id?: string | null, maxLength: number, name?: string | null, order: number, type?: string | null, values?: Array | null } | null> | null, values?: Array<{ cost: any, name?: string | null, value?: string | null } | null> | null } | null, attributeSelections?: { selectedVariant?: { id?: string | null, alias?: string | null, available?: boolean | null, productId?: any | null, productVariantId?: any | null, stock?: any | null, images?: Array<{ fileName?: string | null, url?: string | null } | null> | null, prices?: { listPrice?: any | null, price: any, discountPercentage: any, installmentPlans?: Array<{ displayName?: string | null, name?: string | null, installments?: Array<{ discount: boolean, fees: boolean, number: number, value: any } | null> | null } | null> | null, bestInstallment?: { name?: string | null, displayName?: string | null, discount: boolean, fees: boolean, number: number, value: any } | null, wholesalePrices?: Array<{ price: any, quantity: number } | null> | null } | null } | null, selections?: Array<{ attributeId: any, displayType?: string | null, name?: string | null, varyByParent: boolean, values?: Array<{ alias?: string | null, available: boolean, printUrl?: string | null, selected: boolean, value?: string | null } | null> | null } | null> | null } | null } | null> | null, selectedAddress?: { addressNumber?: string | null, cep: number, city?: string | null, complement?: string | null, id?: string | null, neighborhood?: string | null, referencePoint?: string | null, state?: string | null, street?: string | null } | null, selectedShipping?: { deadline: number, deadlineInHours?: number | null, name?: string | null, shippingQuoteId: any, type?: string | null, value: number, deliverySchedule?: { date?: string | null, endDateTime: any, endTime?: string | null, startDateTime: any, startTime?: string | null } | null } | null, selectedPaymentMethod?: { html?: string | null, id: any, paymentMethodId?: string | null, scripts?: Array | null, installments?: Array<{ adjustment: number, number: number, total: number, value: number } | null> | null, selectedInstallment?: { adjustment: number, number: number, total: number, value: number } | null, suggestedCards?: Array<{ brand?: string | null, key?: string | null, name?: string | null, number?: string | null } | null> | null } | null, orders?: Array<{ date: any, discountValue: any, dispatchTimeText?: string | null, interestValue: any, orderId: any, orderStatus: OrderStatus, shippingValue: any, totalValue: any, adjustments?: Array<{ name?: string | null, type?: string | null, value: any } | null> | null, delivery?: { cost: any, deliveryTime: number, deliveryTimeInHours?: number | null, name?: string | null, address?: { address?: string | null, cep?: string | null, city?: string | null, complement?: string | null, isPickupStore: boolean, name?: string | null, neighborhood?: string | null, pickupStoreText?: string | null } | null } | null, payment?: { name?: string | null, card?: { brand?: string | null, cardInterest: any, installments: number, name?: string | null, number?: string | null } | null, invoice?: { digitableLine?: string | null, paymentLink?: string | null } | null, pix?: { qrCode?: string | null, qrCodeExpirationDate?: any | null, qrCodeUrl?: string | null } | null } | null, products?: Array<{ imageUrl?: string | null, name?: string | null, productVariantId: any, quantity: number, unitValue: any, value: any, adjustments?: Array<{ additionalInformation?: string | null, name?: string | null, type?: string | null, value: any } | null> | null, attributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null, kits?: Array<{ kitId: any, kitGroupId?: string | null, alias?: string | null, imageUrl?: string | null, listPrice: any, price: any, totalListPrice: any, totalAdjustedPrice: any, name?: string | null, quantity: number, products?: Array<{ productId: any, productVariantId: any, imageUrl?: string | null, name?: string | null, url?: string | null, quantity: number, productAttributes?: Array<{ name?: string | null, value?: string | null } | null> | null } | null> | null } | null> | null } | null }; diff --git a/wake/utils/graphql/storefront.graphql.json b/wake/utils/graphql/storefront.graphql.json index 9c72529cb..9a007675a 100644 --- a/wake/utils/graphql/storefront.graphql.json +++ b/wake/utils/graphql/storefront.graphql.json @@ -1,514 +1,748 @@ { - "data": { - "__schema": { - "queryType": { - "name": "QueryRoot" - }, - "mutationType": { - "name": "Mutation" - }, - "subscriptionType": null, - "types": [ - { - "kind": "OBJECT", - "name": "__Directive", - "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL\u0027s execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", - "fields": [ - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", + "__schema": { + "queryType": { + "name": "QueryRoot" + }, + "mutationType": { + "name": "Mutation" + }, + "subscriptionType": null, + "types": [ + { + "kind": "OBJECT", + "name": "__Directive", + "description": "A Directive provides a way to describe alternate runtime execution and type validation behavior in a GraphQL document.\n\nIn some cases, you need to provide options to alter GraphQL's execution behavior in ways field arguments will not suffice, such as conditionally including or skipping a field. Directives provide this by describing additional information to the executor.", + "fields": [ + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", "name": null, "ofType": { - "kind": "LIST", + "kind": "NON_NULL", "name": null, "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null } } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "description", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isRepeatable", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "isRepeatable", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "locations", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "locations", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", "name": null, "ofType": { - "kind": "LIST", + "kind": "NON_NULL", "name": null, "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__DirectiveLocation", - "ofType": null - } + "kind": "ENUM", + "name": "__DirectiveLocation", + "ofType": null } } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } }, - { - "name": "onField", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use \u0060locations\u0060." + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "onField", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } }, - { - "name": "onFragment", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use \u0060locations\u0060." + "isDeprecated": true, + "deprecationReason": "Use `locations`." + }, + { + "name": "onFragment", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } }, - { - "name": "onOperation", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": true, - "deprecationReason": "Use \u0060locations\u0060." - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__DirectiveLocation", - "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "QUERY", - "description": "Location adjacent to a query operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "MUTATION", - "description": "Location adjacent to a mutation operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SUBSCRIPTION", - "description": "Location adjacent to a subscription operation.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD", - "description": "Location adjacent to a field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_DEFINITION", - "description": "Location adjacent to a fragment definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FRAGMENT_SPREAD", - "description": "Location adjacent to a fragment spread.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INLINE_FRAGMENT", - "description": "Location adjacent to an inline fragment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "VARIABLE_DEFINITION", - "description": "Location adjacent to a variable definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCHEMA", - "description": "Location adjacent to a schema definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SCALAR", - "description": "Location adjacent to a scalar definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Location adjacent to an object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FIELD_DEFINITION", - "description": "Location adjacent to a field definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ARGUMENT_DEFINITION", - "description": "Location adjacent to an argument definition", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Location adjacent to an interface definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Location adjacent to a union definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Location adjacent to an enum definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM_VALUE", - "description": "Location adjacent to an enum value definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Location adjacent to an input object type definition.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_FIELD_DEFINITION", - "description": "Location adjacent to an input object field definition.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__EnumValue", - "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", - "fields": [ - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { + "isDeprecated": true, + "deprecationReason": "Use `locations`." + }, + { + "name": "onOperation", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use `locations`." + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__DirectiveLocation", + "description": "A Directive can be adjacent to many parts of the GraphQL language, a __DirectiveLocation describes one such possible adjacencies.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "QUERY", + "description": "Location adjacent to a query operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "MUTATION", + "description": "Location adjacent to a mutation operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SUBSCRIPTION", + "description": "Location adjacent to a subscription operation.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD", + "description": "Location adjacent to a field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_DEFINITION", + "description": "Location adjacent to a fragment definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FRAGMENT_SPREAD", + "description": "Location adjacent to a fragment spread.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INLINE_FRAGMENT", + "description": "Location adjacent to an inline fragment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "VARIABLE_DEFINITION", + "description": "Location adjacent to a variable definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCHEMA", + "description": "Location adjacent to a schema definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SCALAR", + "description": "Location adjacent to a scalar definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Location adjacent to an object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FIELD_DEFINITION", + "description": "Location adjacent to a field definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ARGUMENT_DEFINITION", + "description": "Location adjacent to an argument definition", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Location adjacent to an interface definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Location adjacent to a union definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Location adjacent to an enum definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM_VALUE", + "description": "Location adjacent to an enum value definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Location adjacent to an input object type definition.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_FIELD_DEFINITION", + "description": "Location adjacent to an input object field definition.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__EnumValue", + "description": "One possible value for a given Enum. Enum values are unique values, not a placeholder for a string or numeric value. However an Enum value is returned in a JSON response as a string.", + "fields": [ + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "description", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Field", + "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", + "fields": [ + { + "name": "args", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__InputValue", + "ofType": null + } } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deprecationReason", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Field", - "description": "Object and Interface types are described by a list of Fields, each of which has a name, potentially a list of arguments, and a return type.", - "fields": [ - { - "name": "args", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isDeprecated", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__InputValue", + "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", + "fields": [ + { + "name": "defaultValue", + "description": "A GraphQL-formatted string representing the default value for this input value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Schema", + "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", + "fields": [ + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "directives", + "description": "A list of all directives supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", "name": null, "ofType": { - "kind": "LIST", + "kind": "NON_NULL", "name": null, "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } + "kind": "OBJECT", + "name": "__Directive", + "ofType": null } } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "deprecationReason", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mutationType", + "description": "If this server supports mutation, the type that mutation operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "queryType", + "description": "The type that query operations will be rooted at.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "isDeprecated", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionType", + "description": "If this server support subscription, the type that subscription operations will be rooted at.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "types", + "description": "A list of all types supported by this server.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", "name": null, "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null + } + } + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "__Type", + "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the `__TypeKind` enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", + "fields": [ + { + "name": "description", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "enumValues", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": null, - "args": [], - "type": { + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", + "kind": "OBJECT", + "name": "__EnumValue", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "type", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fields", + "description": null, + "args": [ + { + "name": "includeDeprecated", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "false" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "OBJECT", - "name": "__Type", + "name": "__Field", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__InputValue", - "description": "Arguments provided to Fields or Directives and the input fields of an InputObject are represented as Input Values which describe their type and optionally a default value.", - "fields": [ - { - "name": "defaultValue", - "description": "A GraphQL-formatted string representing the default value for this input value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "inputFields", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", + "kind": "OBJECT", + "name": "__InputValue", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "type", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "interfaces", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -516,74 +750,59 @@ "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Schema", - "description": "A GraphQL Schema defines the capabilities of a GraphQL server. It exposes all available types and directives on the server, as well as the entry points for query, mutation, and subscription operations.", - "fields": [ - { - "name": "description", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "directives", - "description": "A list of all directives supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Directive", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kind", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "__TypeKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "mutationType", - "description": "If this server supports mutation, the type that mutation operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ofType", + "description": null, + "args": [], + "type": { + "kind": "OBJECT", + "name": "__Type", + "ofType": null }, - { - "name": "queryType", - "description": "The type that query operations will be rooted at.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "possibleTypes", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -591,6402 +810,9741 @@ "name": "__Type", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "subscriptionType", - "description": "If this server support subscription, the type that subscription operations will be rooted at.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "specifiedByURL", + "description": "`specifiedByURL` may return a String (in the form of a URL) for custom scalars, otherwise it will return `null`.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "__TypeKind", + "description": "An enum describing what kind of type a given `__Type` is.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SCALAR", + "description": "Indicates this type is a scalar.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OBJECT", + "description": "Indicates this type is an object. `fields` and `interfaces` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERFACE", + "description": "Indicates this type is an interface. `fields` and `possibleTypes` are valid fields.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "UNION", + "description": "Indicates this type is a union. `possibleTypes` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ENUM", + "description": "Indicates this type is an enum. `enumValues` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INPUT_OBJECT", + "description": "Indicates this type is an input object. `inputFields` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "LIST", + "description": "Indicates this type is a list. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NON_NULL", + "description": "Indicates this type is a non-null. `ofType` is a valid field.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Uuid", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutCustomer", + "description": "Represents a customer node in the checkout.", + "fields": [ + { + "name": "checkingAccountBalance", + "description": "Customer's checking account balance.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cnpj", + "description": "Taxpayer identification number for businesses.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cpf", + "description": "Brazilian individual taxpayer registry identification.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creditLimit", + "description": "Customer's credit limit.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "types", - "description": "A list of all types supported by this server.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "__Type", - "description": "The fundamental unit of any GraphQL Schema is the type. There are many kinds of types in GraphQL as represented by the \u0060__TypeKind\u0060 enum.\n\nDepending on the kind of a type, certain fields describe information about that type. Scalar types provide no information beyond a name and description, while Enum types provide their values. Object and Interface types provide the fields they describe. Abstract types, Union and Interface, provide the Object types possible at runtime. List and NonNull types compose other types.", - "fields": [ - { - "name": "description", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creditLimitBalance", + "description": "Customer's credit balance.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "enumValues", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__EnumValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": null, - "args": [ - { - "name": "includeDeprecated", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "false" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Field", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerId", + "description": "Customer's unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerName", + "description": "Customer's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "inputFields", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__InputValue", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The email address of the customer.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "interfaces", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "phoneNumber", + "description": "Customer's phone number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "kind", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "__TypeKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Checkout", + "description": null, + "fields": [ + { + "name": "cep", + "description": "The CEP.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "name", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkingAccountActive", + "description": "Indicates if the checking account is being used.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkingAccountValue", + "description": "Total used from checking account.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "ofType", - "description": null, - "args": [], - "type": { - "kind": "OBJECT", - "name": "__Type", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutId", + "description": "The checkout unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "completed", + "description": "Indicates if the checkout is completed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "possibleTypes", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "__Type", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "coupon", + "description": "The coupon for discounts.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "specifiedByURL", - "description": "\u0060specifiedByURL\u0060 may return a String (in the form of a URL) for custom scalars, otherwise it will return \u0060null\u0060.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "couponDiscount", + "description": "The total coupon discount applied at checkout.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "__TypeKind", - "description": "An enum describing what kind of type a given \u0060__Type\u0060 is.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "SCALAR", - "description": "Indicates this type is a scalar.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OBJECT", - "description": "Indicates this type is an object. \u0060fields\u0060 and \u0060interfaces\u0060 are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERFACE", - "description": "Indicates this type is an interface. \u0060fields\u0060 and \u0060possibleTypes\u0060 are valid fields.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "UNION", - "description": "Indicates this type is a union. \u0060possibleTypes\u0060 is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ENUM", - "description": "Indicates this type is an enum. \u0060enumValues\u0060 is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INPUT_OBJECT", - "description": "Indicates this type is an input object. \u0060inputFields\u0060 is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "LIST", - "description": "Indicates this type is a list. \u0060ofType\u0060 is a valid field.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NON_NULL", - "description": "Indicates this type is a non-null. \u0060ofType\u0060 is a valid field.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Uuid", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Checkout", - "description": null, - "fields": [ - { - "name": "cep", - "description": "The CEP.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customer", + "description": "The customer associated with the checkout.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutCustomer", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizationValue", + "description": "The total value of customizations added to the products.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "checkoutId", - "description": "The checkout unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discount", + "description": "The discount applied at checkout excluding any coupons.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "completed", - "description": "Indicates if the checkout is completed.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kits", + "description": "A list of kits associated with the checkout.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutKit", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "login", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "coupon", - "description": "The coupon for discounts.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": "The metadata related to this checkout.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Metadata", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orders", + "description": "The checkout orders informations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutOrder", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentFees", + "description": "The additional fees applied based on the payment method.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A list of products associated with the checkout.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutProductNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedAddress", + "description": "The selected delivery address for the checkout.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutAddress", + "ofType": null }, - { - "name": "customer", - "description": "The customer associated with the checkout.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedPaymentMethod", + "description": "The selected payment method", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SelectedPaymentMethod", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedShipping", + "description": "Selected Shipping.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ShippingNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedShippingGroups", + "description": "Selected shipping quote groups.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "CheckoutCustomer", + "name": "CheckoutShippingQuoteGroupNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingFee", + "description": "The shipping fee.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtotal", + "description": "The subtotal value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "login", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "total", + "description": "The total value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "metadata", - "description": "The metadata related to this checkout.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Metadata", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "orders", - "description": "The checkout orders informations.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutOrder", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "products", - "description": "A list of products associated with the checkout.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutProductNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalDiscount", + "description": "The total discount applied at checkout.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } }, - { - "name": "selectedAddress", - "description": "The selected delivery address for the checkout.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CheckoutAddress", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateDate", + "description": "The last update date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "Url for the current checkout id.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "selectedPaymentMethod", - "description": "The selected payment method", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrder", + "description": "Represents a node in the checkout order.", + "fields": [ + { + "name": "adjustments", + "description": "The list of adjustments applied to the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "SelectedPaymentMethod", + "name": "CheckoutOrderAdjustment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "The date of the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "selectedShipping", - "description": "Selected Shipping.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ShippingNode", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "delivery", + "description": "Details of the delivery or store pickup.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutOrderDelivery", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discountValue", + "description": "The discount value of the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "dispatchTimeText", + "description": "The dispatch time text from the shop settings.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "shippingFee", - "description": "The shipping fee.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "interestValue", + "description": "The interest value of the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } }, - { - "name": "subtotal", - "description": "The subtotal value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orderId", + "description": "The ID of the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orderStatus", + "description": "The order status.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "OrderStatus", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payment", + "description": "The payment information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutOrderPayment", + "ofType": null }, - { - "name": "total", - "description": "The total value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The list of products in the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutOrderProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingValue", + "description": "The shipping value of the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } }, - { - "name": "updateDate", - "description": "The last update date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalValue", + "description": "The total value of the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } }, - { - "name": "url", - "description": "Url for the current checkout id.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ShippingNode", + "description": null, + "fields": [ + { + "name": "deadline", + "description": "The shipping deadline.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineInHours", + "description": "The shipping deadline in hours.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrder", - "description": "Represents a node in the checkout order.", - "fields": [ - { - "name": "adjustments", - "description": "The list of adjustments applied to the order.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutOrderAdjustment", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "date", - "description": "The date of the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliverySchedule", + "description": "The delivery schedule detail.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DeliveryScheduleDetail", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The shipping name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingQuoteId", + "description": "The shipping quote unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The shipping type.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The shipping value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ShippingQuoteGroup", + "description": "A shipping quote group.", + "fields": [ + { + "name": "distributionCenter", + "description": "The distribution center.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DistributionCenter", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The products related to the shipping quote group.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ShippingQuoteGroupProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingQuotes", + "description": "Shipping quotes to group.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "GroupShippingQuote", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Customer", + "description": "A customer from the store.", + "fields": [ + { + "name": "address", + "description": "A specific customer's address.", + "args": [ + { + "name": "addressId", + "description": "An address unique identifier to be searched.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null }, - { - "name": "delivery", - "description": "Details of the delivery or store pickup.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addresses", + "description": "Customer's addresses.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "CheckoutOrderDelivery", + "name": "CustomerAddressNode", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "discountValue", - "description": "The discount value of the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "birthDate", + "description": "Customer's birth date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "businessPhoneNumber", + "description": "Customer's business phone number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkingAccountBalance", + "description": "Customer's checking account balance.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkingAccountHistory", + "description": "Customer's checking account History.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CustomerCheckingAccountHistoryNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cnpj", + "description": "Taxpayer identification number for businesses.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "companyName", + "description": "Entities legal name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cpf", + "description": "Brazilian individual taxpayer registry identification.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "dispatchTimeText", - "description": "The dispatch time text from the shop settings.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creationDate", + "description": "Creation Date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "interestValue", - "description": "The interest value of the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerId", + "description": "Customer's unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerName", + "description": "Customer's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerType", + "description": "Indicates if it is a natural person or company profile.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryAddress", + "description": "Customer's delivery address.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "digitalProducts", + "description": "Customer's digital products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderDigitalProductNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "Customer's email address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gender", + "description": "Customer's gender.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "informationGroups", + "description": "Customer information groups.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CustomerInformationGroupNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mobilePhoneNumber", + "description": "Customer's mobile phone number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "A specific order placed by the customer.", + "args": [ + { + "name": "orderId", + "description": "An order unique identifier to be searched.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": "0" + } + ], + "type": { + "kind": "OBJECT", + "name": "order", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orders", + "description": "List of orders placed by the customer.", + "args": [ + { + "name": "offset", + "description": "The offset used to paginate.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "Int", "ofType": null - } + }, + "defaultValue": "0" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "orderId", - "description": "The ID of the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "pageSize", + "description": "The number of orders per page.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "Int", "ofType": null - } + }, + "defaultValue": "10" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "orderStatus", - "description": "The order status.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "sortDirection", + "description": "Define the sort orientation of the result set.", + "type": { "kind": "ENUM", - "name": "OrderStatus", + "name": "OrderSortDirection", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "payment", - "description": "The payment information.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CheckoutOrderPayment", - "ofType": null + }, + "defaultValue": "DESC" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "The list of products in the order.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutOrderProduct", + { + "name": "sortKey", + "description": "Define the order attribute which the result set will be sorted on.", + "type": { + "kind": "ENUM", + "name": "CustomerOrderSortKeys", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": "DATE" + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerOrderCollectionSegment", + "ofType": null }, - { - "name": "shippingValue", - "description": "The shipping value of the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ordersStatistics", + "description": "Statistics about the orders the customer made in a specific timeframe.", + "args": [ + { + "name": "dateGte", + "description": "Filter que customer orders by date greater than or equal the specified date.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "DateTime", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalValue", - "description": "The total value of the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "dateLt", + "description": "Filter que customer orders by date lesser than the specified date.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "DateTime", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ShippingNode", - "description": null, - "fields": [ - { - "name": "deadline", - "description": "The shipping deadline.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "onlyPaidOrders", + "description": "Toggle to apply the statistics only on orders with paid status.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": "true" + }, + { + "name": "partnerId", + "description": "The partner id which the order was made with.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "Long", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerOrdersStatistics", + "ofType": null }, - { - "name": "deliverySchedule", - "description": "The delivery schedule detail.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partners", + "description": "Get info about the associated partners.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "DeliveryScheduleDetail", + "name": "Partner", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "phoneNumber", + "description": "Customer's phone number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "residentialAddress", + "description": "Customer's residential address.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "responsibleName", + "description": "Responsible's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "rg", + "description": "Registration number Id.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stateRegistration", + "description": "State registration number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The shipping name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptions", + "description": "Customer's subscriptions.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CustomerSubscription", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateDate", + "description": "Date of the last update.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wishlist", + "description": "Customer wishlist.", + "args": [ + { + "name": "productsIds", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "wishlist", + "ofType": null }, - { - "name": "shippingQuoteId", - "description": "The shipping quote unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "order", + "description": null, + "fields": [ + { + "name": "checkingAccount", + "description": "Checking account value used for the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutId", + "description": "The checkout unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "coupon", + "description": "The coupon for discounts.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "type", - "description": "The shipping type.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "The date when te order was placed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The shipping value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Customer", - "description": "A customer from the store.", - "fields": [ - { - "name": "addresses", - "description": "Customer\u0027s addresses.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryAddress", + "description": "The address where the order will be delivered.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrderDeliveryAddressNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discount", + "description": "Order discount amount, if any.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "interestFee", + "description": "Order interest fee, if any.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invoices", + "description": "Information about order invoices.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderInvoiceNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kits", + "description": "A list of kits belonging to the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderKitNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "notes", + "description": "Information about order notes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderNoteNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orderId", + "description": "Order unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentDate", + "description": "The date when the order was payed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payments", + "description": "Information about payments.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderPaymentNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "Products belonging to the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderProductNode", + "ofType": null + } }, - { - "name": "birthDate", - "description": "Customer\u0027s birth date.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "promotions", + "description": "List of promotions applied to the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "businessPhoneNumber", - "description": "Customer\u0027s business phone number.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingFee", + "description": "The shipping fee.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippings", + "description": "Information about order shippings.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderShippingNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "The order current status.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrderStatusNode", + "ofType": null }, - { - "name": "cnpj", - "description": "Taxpayer identification number for businesses.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "statusHistory", + "description": "List of the order status history.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderStatusNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptions", + "description": "List of order subscriptions.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderSubscriptionNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtotal", + "description": "Order subtotal value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "companyName", - "description": "Entities legal name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "total", + "description": "Order total value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trackings", + "description": "Information about order trackings.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderTrackingNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerSubscription", + "description": null, + "fields": [ + { + "name": "billingAddress", + "description": "Subscription billing address.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cancellationDate", + "description": "The date when the subscription was cancelled.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "coupon", + "description": "The coupon code applied to the subscription.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "cpf", - "description": "Brazilian individual taxpayer registry identification.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "The date of the subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "creationDate", - "description": "Creation Date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryAddress", + "description": "Subscription delivery address.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null }, - { - "name": "customerId", - "description": "Customer\u0027s unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "intercalatedRecurrenceDate", + "description": "The date of intercalated recurring payments.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nextRecurrenceDate", + "description": "The date of the next recurring payment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "customerName", - "description": "Customer\u0027s name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orders", + "description": "Subscription orders.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "order", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pauseDate", + "description": "The date when the subscription was paused.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "payment", + "description": "The payment details for the subscription.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerSubscriptionPayment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The list of products associated with the subscription.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CustomerSubscriptionProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recurring", + "description": "The details of the recurring subscription.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerSubscriptionRecurring", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "The subscription status.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroupId", + "description": "The subscription group id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "customerType", - "description": "Indicates if it is a natural person or company profile.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionId", + "description": "Subscription unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "deliveryAddress", - "description": "Customer\u0027s delivery address.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Hotsite", + "description": "A hotsite is a group of products used to organize them or to make them easier to browse.", + "fields": [ + { + "name": "banners", + "description": "A list of banners associated with the hotsite.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "CustomerAddressNode", + "name": "Banner", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": "Customer\u0027s email address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contents", + "description": "A list of contents associated with the hotsite.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Content", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endDate", + "description": "The hotsite will be displayed until this date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "gender", - "description": "Customer\u0027s gender.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "expression", + "description": "Expression used to associate products to the hotsite.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hotsiteId", + "description": "Hotsite unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "informationGroups", - "description": "Customer information groups.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CustomerInformationGroupNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The hotsite's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "mobilePhoneNumber", - "description": "Customer\u0027s mobile phone number.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageSize", + "description": "Set the quantity of products displayed per page.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "orders", - "description": "List of orders placed by the customer.", - "args": [ - { - "name": "offset", - "description": "The offset used to paginate.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": "0" - }, - { - "name": "sortDirection", - "description": "Define the sort orientation of the result set.", - "type": { - "kind": "ENUM", - "name": "OrderSortDirection", - "ofType": null - }, - "defaultValue": "DESC" + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A list of products associated with the hotsite.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sortKey", - "description": "Define the order attribute which the result set will be sorted on.", - "type": { - "kind": "ENUM", - "name": "CustomerOrderSortKeys", - "ofType": null - }, - "defaultValue": "DATE" - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerOrderCollectionSegment", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ordersStatistics", - "description": "Statistics about the orders the customer made in a specific timeframe.", - "args": [ - { - "name": "dateGte", - "description": "Filter que customer orders by date greater than or equal the specified date.", - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "defaultValue": null + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "dateLt", - "description": "Filter que customer orders by date lesser than the specified date.", - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "onlyPaidOrders", - "description": "Toggle to apply the statistics only on orders with paid status.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": "true" + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "partnerId", - "description": "The partner id which the order was made with.", - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerOrdersStatistics", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partners", - "description": "Get info about the associated partners.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CustomerPartnerNode", + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "ENUM", + "name": "SortDirection", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "ENUM", + "name": "ProductSortKeys", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductsConnection", + "ofType": null }, - { - "name": "phoneNumber", - "description": "Customer\u0027s phone number.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sorting", + "description": "Sorting information to be used by default on the hotsite.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "HotsiteSorting", + "ofType": null }, - { - "name": "residentialAddress", - "description": "Customer\u0027s residential address.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startDate", + "description": "The hotsite will be displayed from this date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "responsibleName", - "description": "Responsible\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtype", + "description": "The subtype of the hotsite.", + "args": [], + "type": { + "kind": "ENUM", + "name": "HotsiteSubtype", + "ofType": null }, - { - "name": "rg", - "description": "Registration number Id.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "template", + "description": "The template used for the hotsite.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "stateRegistration", - "description": "State registration number.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The hotsite's URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "updateDate", - "description": "Date of the last update.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SingleHotsite", + "description": "A hotsite is a group of products used to organize them or to make them easier to browse.", + "fields": [ + { + "name": "aggregations", + "description": "Aggregations from the products.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductAggregations", + "ofType": null }, - { - "name": "wishlist", - "description": "Customer wishlist.", - "args": [ - { - "name": "productsIds", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "banners", + "description": "A list of banners associated with the hotsite.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "wishlist", + "name": "Banner", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "breadcrumbs", + "description": "A list of breadcrumbs for the hotsite.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Breadcrumb", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contents", + "description": "A list of contents associated with the hotsite.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Content", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endDate", + "description": "The hotsite will be displayed until this date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Hotsite", - "description": "A hotsite is a group of products used to organize them or to make them easier to browse.", - "fields": [ - { - "name": "banners", - "description": "A list of banners associated with the hotsite.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Banner", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "contents", - "description": "A list of contents associated with the hotsite.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Content", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "expression", + "description": "Expression used to associate products to the hotsite.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "endDate", - "description": "The hotsite will be displayed until this date.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hotsiteId", + "description": "Hotsite unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The hotsite's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "expression", - "description": "Expression used to associate products to the hotsite.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageSize", + "description": "Set the quantity of products displayed per page.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "hotsiteId", - "description": "Hotsite unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A list of products associated with the hotsite. Cursor pagination.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The hotsite\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageSize", - "description": "Set the quantity of products displayed per page.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "A list of products associated with the hotsite.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", + { + "name": "filters", + "description": "List of filters. Check filters result for available inputs.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductFilterInput", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "maximumPrice", + "description": "Maximum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "minimumPrice", + "description": "Minimum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "ENUM", - "name": "ProductSortKeys", + "defaultValue": null + }, + { + "name": "onlyMainVariant", + "description": "Toggle the return of only main variants.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "sortKey", + "description": null, + "type": { + "kind": "ENUM", + "name": "ProductSortKeys", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductsConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productsByOffset", + "description": "A list of products associated with the hotsite. Offset pagination.", + "args": [ + { + "name": "filters", + "description": "List of filters. Check filters result for available inputs.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductFilterInput", "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductsConnection", - "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "limit", + "description": "The number of products to return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "maximumPrice", + "description": "Maximum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "minimumPrice", + "description": "Minimum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "offset", + "description": "The offset used to paginate.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "0" + }, + { + "name": "onlyMainVariant", + "description": "Toggle the return of only main variants.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" + }, + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "sortKey", + "description": null, + "type": { + "kind": "ENUM", + "name": "ProductSortKeys", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductCollectionSegment", + "ofType": null }, - { - "name": "sorting", - "description": "Sorting information to be used by default on the hotsite.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seo", + "description": "A list of SEO contents associated with the hotsite.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "HotsiteSorting", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "SEO", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sorting", + "description": "Sorting information to be used by default on the hotsite.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "HotsiteSorting", + "ofType": null }, - { - "name": "startDate", - "description": "The hotsite will be displayed from this date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startDate", + "description": "The hotsite will be displayed from this date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subtype", + "description": "The subtype of the hotsite.", + "args": [], + "type": { + "kind": "ENUM", + "name": "HotsiteSubtype", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "template", + "description": "The template used for the hotsite.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The hotsite's URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductCollectionSegment", + "description": null, + "fields": [ + { + "name": "items", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Product", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "subtype", - "description": "The subtype of the hotsite.", - "args": [], - "type": { - "kind": "ENUM", - "name": "HotsiteSubtype", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "page", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "template", - "description": "The template used for the hotsite.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageSize", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "url", - "description": "The hotsite\u0027s URL.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SingleHotsite", - "description": "A hotsite is a group of products used to organize them or to make them easier to browse.", - "fields": [ - { - "name": "aggregations", - "description": "Aggregations from the products.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerOrderCollectionSegment", + "description": null, + "fields": [ + { + "name": "items", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "ProductAggregations", + "name": "order", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "page", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "banners", - "description": "A list of banners associated with the hotsite.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Banner", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "breadcrumbs", - "description": "A list of breadcrumbs for the hotsite.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Breadcrumb", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "contents", - "description": "A list of contents associated with the hotsite.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Content", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "endDate", - "description": "The hotsite will be displayed until this date.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageSize", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "expression", - "description": "Expression used to associate products to the hotsite.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "hotsiteId", - "description": "Hotsite unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Search", + "description": "Search for relevant products to the searched term.", + "fields": [ + { + "name": "aggregations", + "description": "Aggregations from the products.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductAggregations", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "banners", + "description": "A list of banners displayed in search pages.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Banner", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "breadcrumbs", + "description": "List of search breadcrumbs.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Breadcrumb", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contents", + "description": "A list of contents displayed in search pages.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Content", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "forbiddenTerm", + "description": "Information about forbidden term.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "forbiddenTerm", + "ofType": null }, - { - "name": "name", - "description": "The hotsite\u0027s name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageSize", + "description": "The quantity of products displayed per page.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "pageSize", - "description": "Set the quantity of products displayed per page.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A cursor based paginated list of products from the search.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "A list of products associated with the hotsite. Cursor pagination.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", + "defaultValue": null + }, + { + "name": "filters", + "description": "List of filters. Check filters result for available inputs.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductFilterInput", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "filters", - "description": "List of filters. Check filters result for available inputs.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ProductFilterInput", - "ofType": null - } - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "maximumPrice", + "description": "Maximum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "maximumPrice", - "description": "Maximum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "minimumPrice", + "description": "Minimum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "minimumPrice", - "description": "Minimum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "onlyMainVariant", + "description": "Toggle the return of only main variants.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "onlyMainVariant", - "description": "Toggle the return of only main variants.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "true" - }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "ENUM", - "name": "ProductSortKeys", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductsConnection", - "ofType": null + "defaultValue": "true" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productsByOffset", - "description": "A list of products associated with the hotsite. Offset pagination.", - "args": [ - { - "name": "filters", - "description": "List of filters. Check filters result for available inputs.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ProductFilterInput", - "ofType": null - } - }, - "defaultValue": null + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null }, - { - "name": "limit", - "description": "The number of products to return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "sortKey", + "description": null, + "type": { + "kind": "ENUM", + "name": "ProductSearchSortKeys", + "ofType": null }, - { - "name": "maximumPrice", - "description": "Maximum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductsConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productsByOffset", + "description": "An offset based paginated list of products from the search.", + "args": [ + { + "name": "filters", + "description": "List of filters. Check filters result for available inputs.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductFilterInput", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "minimumPrice", - "description": "Minimum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "limit", + "description": "The number of products to return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "offset", - "description": "The offset used to paginate.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": "0" + "defaultValue": "10" + }, + { + "name": "maximumPrice", + "description": "Maximum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "onlyMainVariant", - "description": "Toggle the return of only main variants.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "true" + "defaultValue": null + }, + { + "name": "minimumPrice", + "description": "Minimum price filter.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "offset", + "description": "The offset used to paginate.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - }, - "defaultValue": null + "defaultValue": "0" + }, + { + "name": "onlyMainVariant", + "description": "Toggle the return of only main variants.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "ENUM", - "name": "ProductSortKeys", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductCollectionSegment", - "ofType": null + "defaultValue": "true" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "seo", - "description": "A list of SEO contents associated with the hotsite.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SEO", + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "ENUM", + "name": "SortDirection", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "ENUM", + "name": "ProductSearchSortKeys", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductCollectionSegment", + "ofType": null }, - { - "name": "sorting", - "description": "Sorting information to be used by default on the hotsite.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "HotsiteSorting", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "redirectUrl", + "description": "Redirection url in case a term in the search triggers a redirect.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "startDate", - "description": "The hotsite will be displayed from this date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "searchTime", + "description": "Time taken to perform the search.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "subtype", - "description": "The subtype of the hotsite.", - "args": [], - "type": { - "kind": "ENUM", - "name": "HotsiteSubtype", + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Brand", + "description": "Informations about brands and its products.", + "fields": [ + { + "name": "active", + "description": "If the brand is active at the platform.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": "The alias for the brand's hotsite.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "template", - "description": "The template used for the hotsite.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "brandId", + "description": "Brand unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "url", - "description": "The hotsite\u0027s URL.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The date the brand was created in the database.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductCollectionSegment", - "description": null, - "fields": [ - { - "name": "items", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "page", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullUrlLogo", + "description": "The full brand logo URL.", + "args": [ + { + "name": "height", + "description": "The height of the image.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageSize", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "width", + "description": "The width of the image.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The brand's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A list of products from the brand.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerOrderCollectionSegment", - "description": null, - "fields": [ - { - "name": "items", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "order", + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "page", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageSize", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "partnerAccessToken", + "description": null, + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Search", - "description": "Search for relevant products to the searched term.", - "fields": [ - { - "name": "aggregations", - "description": "Aggregations from the products.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductAggregations", - "ofType": null + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProductSortKeys", + "ofType": null + } + }, + "defaultValue": "NAME" + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductsConnection", + "ofType": null }, - { - "name": "banners", - "description": "A list of banners displayed in search pages.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Banner", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The last update date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlCarrossel", + "description": "A web address to be redirected.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "breadcrumbs", - "description": "List of search breadcrumbs.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Breadcrumb", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlLink", + "description": "A web address linked to the brand.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlLogo", + "description": "The url of the brand's logo.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductOption", + "description": "Options available for the given product.", + "fields": [ + { + "name": "attributes", + "description": "A list of attributes available for the given product and its variants.", + "args": [ + { + "name": "filter", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AttributeFilterInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Attribute", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizations", + "description": "A list of customizations available for the given products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Customization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "contents", - "description": "A list of contents displayed in search pages.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ProductFilterInput", + "description": "Custom attribute defined on store's admin may also be used as a filter.", + "fields": null, + "inputFields": [ + { + "name": "field", + "description": "The attribute name.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "values", + "description": "The set of values which the result filter item value must be included in.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "LIST", "name": null, "ofType": { - "kind": "OBJECT", - "name": "Content", + "kind": "SCALAR", + "name": "String", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "forbiddenTerm", - "description": "Information about forbidden term.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Category", + "description": "Categories are used to arrange your products into different sections by similarity.", + "fields": [ + { + "name": "categoryId", + "description": "Category unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "children", + "description": "A list of child categories, if it exists.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "forbiddenTerm", + "name": "Category", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "A description to the category.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "pageSize", - "description": "The quantity of products displayed per page.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "A cursor based paginated list of products from the search.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "List of filters. Check filters result for available inputs.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ProductFilterInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "maximumPrice", - "description": "Maximum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "minimumPrice", - "description": "Minimum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "onlyMainVariant", - "description": "Toggle the return of only main variants.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "true" - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "ENUM", - "name": "ProductSearchSortKeys", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductsConnection", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayMenu", + "description": "Field to check if the category is displayed in the store's menu.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hotsiteAlias", + "description": "The hotsite alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productsByOffset", - "description": "An offset based paginated list of products from the search.", - "args": [ - { - "name": "filters", - "description": "List of filters. Check filters result for available inputs.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ProductFilterInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "limit", - "description": "The number of products to return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": "10" - }, - { - "name": "maximumPrice", - "description": "Maximum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "minimumPrice", - "description": "Minimum price filter.", - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "offset", - "description": "The offset used to paginate.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": "0" - }, - { - "name": "onlyMainVariant", - "description": "Toggle the return of only main variants.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": "true" - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "ENUM", - "name": "ProductSearchSortKeys", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductCollectionSegment", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hotsiteUrl", + "description": "The URL path for the category.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "redirectUrl", - "description": "Redirection url in case a term in the search triggers a redirect.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The url to access the image linked to the category.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrlLink", + "description": "The web address to access the image linked to the category.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The category's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parent", + "description": "The parent category, if it exists.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Category", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parentCategoryId", + "description": "The parent category unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "searchTime", - "description": "Time taken to perform the search.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The position the category will be displayed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A list of products associated with the category.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Brand", - "description": "Informations about brands and its products.", - "fields": [ - { - "name": "active", - "description": "If the brand is active at the platform.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "alias", - "description": "The alias for the brand\u0027s hotsite.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "brandId", - "description": "Brand unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createdAt", - "description": "The date the brand was created in the database.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "partnerAccessToken", + "description": null, + "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fullUrlLogo", - "description": "The full brand logo URL.", - "args": [ - { - "name": "height", - "description": "The height of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "width", - "description": "The width of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProductSortKeys", + "ofType": null + } + }, + "defaultValue": "NAME" + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductsConnection", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlLink", + "description": "A web address linked to the category.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The brand\u0027s name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Customization", + "description": "Some products can have customizations, such as writing your name on it or other predefined options.", + "fields": [ + { + "name": "cost", + "description": "Cost of customization.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "products", - "description": "A list of products from the brand.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" - }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ProductSortKeys", - "ofType": null - } - }, - "defaultValue": "NAME" - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductsConnection", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizationId", + "description": "Customization unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "groupName", + "description": "Customization group's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "updatedAt", - "description": "The last update date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "urlCarrossel", - "description": "A web address to be redirected.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maxLength", + "description": "Maximum allowed size of the field.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The customization's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "urlLink", - "description": "A web address linked to the brand.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "Priority order of customization.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "urlLogo", - "description": "The url of the brand\u0027s logo.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "required", + "description": "Customization is required.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "Type of customization.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductOption", - "description": "Options available for the given product.", - "fields": [ - { - "name": "attributes", - "description": "A list of attributes available for the given product and its variants.", - "args": [ - { - "name": "filter", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "AttributeFilterInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Attribute", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "customizations", - "description": "A list of customizations available for the given products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Customization", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "Value of customization.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SingleProduct", + "description": "A product represents an item for sale in the store.", + "fields": [ + { + "name": "addToCartFromSpot", + "description": "Check if the product can be added to cart directly from spot.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": "The product url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ProductFilterInput", - "description": "Custom attribute defined on store\u0027s admin may also be used as a filter.", - "fields": null, - "inputFields": [ - { - "name": "field", - "description": "The attribute name.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aliasComplete", + "description": "The complete product url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributeSelections", + "description": "Information about the possible selection attributes.", + "args": [ + { + "name": "includeParentIdVariants", + "description": null, + "type": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - } + }, + "defaultValue": "true" }, - "defaultValue": null - }, - { - "name": "values", - "description": "The set of values which the result filter item value must be included in.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "selected", + "description": null, + "type": { "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "String", + "kind": "INPUT_OBJECT", + "name": "AttributeFilterInput", "ofType": null } - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Category", - "description": "Categories are used to arrange your products into different sections by similarity.", - "fields": [ - { - "name": "categoryId", - "description": "Category unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "children", - "description": "A list of child categories, if it exists.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Category", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AttributeSelection", + "ofType": null }, - { - "name": "description", - "description": "A description to the category.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "List of the product attributes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductAttribute", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "author", + "description": "The product author.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "displayMenu", - "description": "Field to check if the category is displayed in the store\u0027s menu.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "available", + "description": "Field to check if the product is available in stock.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "hotsiteAlias", - "description": "The hotsite alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "averageRating", + "description": "The product average rating. From 0 to 5.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "hotsiteUrl", - "description": "The URL path for the category.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "breadcrumbs", + "description": "List of product breadcrumbs.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Breadcrumb", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyBox", + "description": "BuyBox informations.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BuyBox", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyTogether", + "description": "Buy together products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SingleProduct", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyTogetherGroups", + "description": "Buy together groups products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BuyTogetherGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "collection", + "description": "The product collection.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "imageUrl", - "description": "The url to access the image linked to the category.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "condition", + "description": "The product condition.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "imageUrlLink", - "description": "The web address to access the image linked to the category.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "counterOffer", + "description": "Checks if the product allows counteroffers.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "name", - "description": "The category\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The product creation date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "parent", - "description": "The parent category, if it exists.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizations", + "description": "A list of customizations available for the given products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Category", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "Customization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadline", + "description": "The product delivery deadline.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "parentCategoryId", - "description": "The parent category unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineAlert", + "description": "Product deadline alert informations.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DeadlineAlert", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display", + "description": "Check if the product should be displayed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnlyPartner", + "description": "Check if the product should be displayed only for partners.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displaySearch", + "description": "Check if the product should be displayed on search.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ean", + "description": "The product's unique EAN.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "freeShipping", + "description": "Check if the product offers free shipping.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gender", + "description": "The product gender.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "height", + "description": "The height of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "images", + "description": "List of the product images.", + "args": [ + { + "name": "height", + "description": "The height of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "position", - "description": "The position the category will be displayed.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "width", + "description": "The width of the image the url will return.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "A list of products associated with the category.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ProductSortKeys", - "ofType": null - } - }, - "defaultValue": "NAME" - } - ], - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "ProductsConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "Image", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "informations", + "description": "List of the product insformations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Information", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "length", + "description": "The length of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "urlLink", - "description": "A web address linked to the category.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mainVariant", + "description": "Check if its the main variant.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Customization", - "description": "Some products can have customizations, such as writing your name on it or other predefined options.", - "fields": [ - { - "name": "cost", - "description": "Cost of customization.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "customizationId", - "description": "Customization unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maximumOrderQuantity", + "description": "The product maximum quantity for an order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "groupName", - "description": "Customization group\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimumOrderQuantity", + "description": "The product minimum quantity for an order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newRelease", + "description": "Check if the product is a new release.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "maxLength", - "description": "Maximum allowed size of the field.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "numberOfVotes", + "description": "The number of votes that the average rating consists of.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "name", - "description": "The customization\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parallelOptions", + "description": "Product parallel options information.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parentId", + "description": "Parent product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "order", - "description": "Priority order of customization.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "prices", + "description": "The product prices.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Prices", + "ofType": null }, - { - "name": "type", - "description": "Type of customization.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productBrand", + "description": "Summarized informations about the brand of the product.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductBrand", + "ofType": null }, - { - "name": "values", - "description": "Value of customization.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productCategories", + "description": "Summarized informations about the categories of the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductCategory", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productId", + "description": "Product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SingleProduct", - "description": "A product represents an item for sale in the store.", - "fields": [ - { - "name": "addToCartFromSpot", - "description": "Check if the product can be added to cart directly from spot.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "alias", - "description": "The product url alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productName", + "description": "The product name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "attributeSelections", - "description": "Information about the possible selection attributes.", - "args": [ - { - "name": "selected", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "AttributeFilterInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productSubscription", + "description": "Summarized informations about the subscription of the product.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductSubscription", + "ofType": null + }, + "isDeprecated": true, + "deprecationReason": "Use subscriptionGroups to get subscription information." + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "promotions", + "description": "List of promotions this product belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "AttributeSelection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "Promotion", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publisher", + "description": "The product publisher", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "attributes", - "description": "List of the product attributes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductAttribute", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "available", - "description": "Field to check if the product is available in stock.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "averageRating", - "description": "The product average rating. From 0 to 5.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviews", + "description": "List of customer reviews for this product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Review", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "breadcrumbs", - "description": "List of product breadcrumbs.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Breadcrumb", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seller", + "description": "The product seller.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Seller", + "ofType": null }, - { - "name": "buyBox", - "description": "BuyBox informations.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seo", + "description": "Product SEO informations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "BuyBox", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "SEO", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "similarProducts", + "description": "List of similar products. ", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SimilarProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "The product's unique SKU.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "buyTogether", - "description": "Buy together products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SingleProduct", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotAttributes", + "description": "The values of the spot attribute.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotInformation", + "description": "The product spot information.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "condition", - "description": "The product condition.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotlight", + "description": "Check if the product is on spotlight.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "createdAt", - "description": "The product creation date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stock", + "description": "The available aggregated product stock (all variants) at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "customizations", - "description": "A list of customizations available for the given products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Customization", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stocks", + "description": "List of the product stocks on different distribution centers.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Stock", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroups", + "description": "List of subscription groups this product belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SubscriptionGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "telesales", + "description": "Check if the product is a telesale.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "deadline", - "description": "The product delivery deadline.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The product last update date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "display", - "description": "Check if the product should be displayed.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlVideo", + "description": "The product video url.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "displayOnlyPartner", - "description": "Check if the product should be displayed only for partners.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variantName", + "description": "The variant name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "displaySearch", - "description": "Check if the product should be displayed on search.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variantStock", + "description": "The available aggregated variant stock at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "ean", - "description": "The product\u0027s unique EAN.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weight", + "description": "The weight of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "freeShipping", - "description": "Check if the product offers free shipping.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "width", + "description": "The width of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BuyList", + "description": "A buy list represents a list of items for sale in the store.", + "fields": [ + { + "name": "addToCartFromSpot", + "description": "Check if the product can be added to cart directly from spot.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "images", - "description": "List of the product images.", - "args": [ - { - "name": "height", - "description": "The height of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Image", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": "The product url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "informations", - "description": "List of the product insformations.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Information", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aliasComplete", + "description": "The complete product url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "mainVariant", - "description": "Check if its the main variant.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributeSelections", + "description": "Information about the possible selection attributes.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "AttributeSelection", + "ofType": null }, - { - "name": "minimumOrderQuantity", - "description": "The product minimum quantity for an order.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "List of the product attributes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductAttribute", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "author", + "description": "The product author.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "newRelease", - "description": "Check if the product is a new release.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "available", + "description": "Field to check if the product is available in stock.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "numberOfVotes", - "description": "The number of votes that the average rating consists of.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "averageRating", + "description": "The product average rating. From 0 to 5.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "parallelOptions", - "description": "Product parallel options information.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "breadcrumbs", + "description": "List of product breadcrumbs.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Breadcrumb", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyBox", + "description": "BuyBox informations.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BuyBox", + "ofType": null }, - { - "name": "parentId", - "description": "Parent product unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyListId", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "prices", - "description": "The product prices.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyListProducts", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Prices", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productBrand", - "description": "Summarized informations about the brand of the product.", - "args": [], - "type": { + "name": "BuyListProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyTogether", + "description": "Buy together products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "ProductBrand", + "name": "SingleProduct", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyTogetherGroups", + "description": "Buy together groups products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "BuyTogetherGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "collection", + "description": "The product collection.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productCategories", - "description": "Summarized informations about the categories of the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "condition", + "description": "The product condition.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productId", - "description": "Product unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "counterOffer", + "description": "Checks if the product allows counteroffers.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "productName", - "description": "The product name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The product creation date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "productSubscription", - "description": "Summarized informations about the subscription of the product.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizations", + "description": "A list of customizations available for the given products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "ProductSubscription", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "Customization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadline", + "description": "The product delivery deadline.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineAlert", + "description": "Product deadline alert informations.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DeadlineAlert", + "ofType": null }, - { - "name": "promotions", - "description": "List of promotions this product belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Promotion", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display", + "description": "Check if the product should be displayed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "reviews", - "description": "List of customer reviews for this product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnlyPartner", + "description": "Check if the product should be displayed only for partners.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "seller", - "description": "The product seller.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Seller", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displaySearch", + "description": "Check if the product should be displayed on search.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "seo", - "description": "Product SEO informations.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SEO", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ean", + "description": "The product's unique EAN.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "similarProducts", - "description": "List of similar products. ", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SimilarProduct", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "freeShipping", + "description": "Check if the product offers free shipping.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "sku", - "description": "The product\u0027s unique SKU.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gender", + "description": "The product gender.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "spotAttributes", - "description": "The values of the spot attribute.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "height", + "description": "The height of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "images", + "description": "List of the product images.", + "args": [ + { + "name": "height", + "description": "The height of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "spotInformation", - "description": "The product spot information.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "spotlight", - "description": "Check if the product is on spotlight.", - "args": [], - "type": { + { + "name": "width", + "description": "The width of the image the url will return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Image", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "informations", + "description": "List of the product insformations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Information", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kit", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "length", + "description": "The length of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "stock", - "description": "The available stock at the default distribution center.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mainVariant", + "description": "Check if its the main variant.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maximumOrderQuantity", + "description": "The product maximum quantity for an order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimumOrderQuantity", + "description": "The product minimum quantity for an order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newRelease", + "description": "Check if the product is a new release.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "numberOfVotes", + "description": "The number of votes that the average rating consists of.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parallelOptions", + "description": "Product parallel options information.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parentId", + "description": "Parent product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "prices", + "description": "The product prices.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Prices", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productBrand", + "description": "Summarized informations about the brand of the product.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductBrand", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productCategories", + "description": "Summarized informations about the categories of the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductCategory", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productId", + "description": "Product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productName", + "description": "The product name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productSubscription", + "description": "Summarized informations about the subscription of the product.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductSubscription", + "ofType": null + }, + "isDeprecated": true, + "deprecationReason": "Use subscriptionGroups to get subscription information." + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "promotions", + "description": "List of promotions this product belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Promotion", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publisher", + "description": "The product publisher", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviews", + "description": "List of customer reviews for this product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Review", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "stocks", - "description": "List of the product stocks on different distribution centers.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Stock", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seller", + "description": "The product seller.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Seller", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seo", + "description": "Product SEO informations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SEO", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "similarProducts", + "description": "List of similar products. ", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SimilarProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "The product's unique SKU.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotAttributes", + "description": "The values of the spot attribute.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotInformation", + "description": "The product spot information.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotlight", + "description": "Check if the product is on spotlight.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stock", + "description": "The available aggregated product stock (all variants) at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stocks", + "description": "List of the product stocks on different distribution centers.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Stock", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroups", + "description": "List of subscription groups this product belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SubscriptionGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "telesales", + "description": "Check if the product is a telesale.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The product last update date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlVideo", + "description": "The product video url.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variantName", + "description": "The variant name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variantStock", + "description": "The available aggregated variant stock at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weight", + "description": "The weight of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "width", + "description": "The width of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductVariant", + "description": "Product variants that have the attribute.", + "fields": [ + { + "name": "aggregatedStock", + "description": "The available stock at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": "The product alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "List of the selected variant attributes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductAttribute", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "available", + "description": "Field to check if the product is available in stock.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ean", + "description": "The product's EAN.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "images", + "description": "The product's images.", + "args": [ + { + "name": "height", + "description": "The height of the image the url will return.", + "type": { + "kind": "SCALAR", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "width", + "description": "The width of the image the url will return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Image", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "offers", + "description": "The seller's product offers.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SellerOffer", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "prices", + "description": "The product prices.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Prices", + "ofType": null }, - { - "name": "subscriptionGroups", - "description": "List of subscription groups this product belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SubscriptionGroup", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productId", + "description": "Product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantName", + "description": "Product variant name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "promotions", + "description": "List of promotions this product variant belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Promotion", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "The product's unique SKU.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stock", + "description": "The available stock at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Shop", + "description": "Informations about the store.", + "fields": [ + { + "name": "checkoutUrl", + "description": "Checkout URL", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "googleRecaptchaSiteKey", + "description": "The Google Recaptcha Site Key for reCAPTCHA validation", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mainUrl", + "description": "Store main URL", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mobileCheckoutUrl", + "description": "Mobile checkout URL", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mobileUrl", + "description": "Mobile URL", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "modifiedName", + "description": "Store modified name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Store name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "physicalStores", + "description": "Physical stores", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PhysicalStore", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sitemapImagesUrl", + "description": "The URL to obtain the SitemapImagens.xml file", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sitemapUrl", + "description": "The URL to obtain the Sitemap.xml file", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Any", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Upload", + "description": "The `Upload` scalar type represents a file upload.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "MenuGroup", + "description": "Informations about menu groups.", + "fields": [ + { + "name": "fullImageUrl", + "description": "The full image URL.", + "args": [ + { + "name": "height", + "description": "The height of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "width", + "description": "The width of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "telesales", - "description": "Check if the product is a telesale.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "updatedAt", - "description": "The product last update date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "Menu group image url.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "urlVideo", - "description": "The product video url.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "menuGroupId", + "description": "Menu group identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "menus", + "description": "List of menus associated with the current group", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Menu", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Menu group name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "variantName", - "description": "The variant name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partnerId", + "description": "Menu group partner id.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "Menu group position.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductVariant", - "description": "Product variants that have the attribute.", - "fields": [ - { - "name": "aggregatedStock", - "description": "The available stock at the default distribution center.", - "args": [], - "type": { + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderProductNode", + "description": null, + "fields": [ + { + "name": "adjusts", + "description": "List of adjusts on the product price, if any.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderAdjustNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "The product attributes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderAttributeNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizationPrice", + "description": "The cost of the customizations, if any.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "alias", - "description": "The product alias.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customizations", + "description": "List of customizations for the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderCustomizationNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discount", + "description": "Amount of discount in the product price, if any.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gift", + "description": "If the product is a gift.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "attributes", - "description": "List of the selected variant attributes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductAttribute", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "image", + "description": "The product image.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "available", - "description": "Field to check if the product is available in stock.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kit", + "description": "The product has a kit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "ean", - "description": "The product\u0027s EAN.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The product list price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The product name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "packagingPrice", + "description": "The cost of the packagings, if any.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "images", - "description": "The product\u0027s images.", - "args": [ - { - "name": "height", - "description": "The height of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Image", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "offers", - "description": "The seller\u0027s product offers.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SellerOffer", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "prices", - "description": "The product prices.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "packagings", + "description": "List of packagings for the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Prices", + "name": "OrderPackagingNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The product price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productSeller", + "description": "Information about the product seller.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrderSellerNode", + "ofType": null }, - { - "name": "productId", - "description": "Product unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "Quantity of the given product in the order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productVariantName", - "description": "Product variant name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "salePrice", + "description": "The product sale price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "promotions", - "description": "List of promotions this product variant belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Promotion", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "The product SKU.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sku", - "description": "The product\u0027s unique SKU.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "trackings", + "description": "List of trackings for the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderTrackingNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unitaryValue", + "description": "Value of an unit of the product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "stock", - "description": "The available stock at the default distribution center.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Shop", - "description": "Informations about the store.", - "fields": [ - { - "name": "checkoutUrl", - "description": "Checkout URL", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductNode", + "description": null, + "fields": [ + { + "name": "adjustments", + "description": "The product adjustment information", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutProductAdjustmentNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ajustedPrice", + "description": "The price adjusted with promotions and other price changes", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "mainUrl", - "description": "Store main URL", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributeSelections", + "description": "Information about the possible selection attributes.", + "args": [ + { + "name": "includeParentIdVariants", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": "true" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "selected", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "AttributeFilterInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AttributeSelection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "brand", + "description": "The product brand", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "mobileCheckoutUrl", - "description": "Mobile checkout URL", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "category", + "description": "The product category", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customization", + "description": "The product customization.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutProductCustomizationNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gift", + "description": "If the product is a gift", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "googleCategory", + "description": "The product Google category", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The product URL image", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "mobileUrl", - "description": "Mobile URL", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "informations", + "description": "The product informations", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installmentFee", + "description": "The product installment fee", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "modifiedName", - "description": "Store modified name", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installmentValue", + "description": "The product installment value", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": "Store name", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kit", + "description": "The product has a kit", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "physicalStores", - "description": "Physical stores", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PhysicalStore", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Any", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Upload", - "description": "The \u0060Upload\u0060 scalar type represents a file upload.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "MenuGroup", - "description": "Informations about menu groups.", - "fields": [ - { - "name": "fullImageUrl", - "description": "The full image URL.", - "args": [ - { - "name": "height", - "description": "The height of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The product list price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "metadata", + "description": "The metadata related to this checkout.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Metadata", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The product name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "numberOfInstallments", + "description": "The product number of installments", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "imageUrl", - "description": "Menu group image url.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The product price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productAttributes", + "description": "The product attributes", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutProductAttributeNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productId", + "description": "The product unique identifier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } }, - { - "name": "menuGroupId", - "description": "Menu group identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "The product variant unique identifier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } }, - { - "name": "menus", - "description": "List of menus associated with the current group", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Menu", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The product quantity", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seller", + "description": "The product seller.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutProductSellerNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingDeadline", + "description": "The product shipping deadline", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutShippingDeadlineNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "The product SKU", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "Menu group name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscription", + "description": "The product subscription information", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutProductSubscription", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalAdjustedPrice", + "description": "The total price adjusted with promotions and other price changes", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "partnerId", - "description": "Menu group partner id.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalListPrice", + "description": "The total list price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The product URL", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "EventList", + "description": "Represents a list of events with their details.", + "fields": [ + { + "name": "coverUrl", + "description": "URL of the event's cover image", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "Date of the event", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eventType", + "description": "Type of the event", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "position", - "description": "Menu group position.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isOwner", + "description": "Indicates if the token is from the owner of this event list", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoUrl", + "description": "URL of the event's logo", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderProductNode", - "description": null, - "fields": [ - { - "name": "adjusts", - "description": "List of adjusts on the product price, if any.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderAdjustNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "attributes", - "description": "The product attributes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderAttributeNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ownerName", + "description": "Name of the event owner", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "customizationPrice", - "description": "The cost of the customizations, if any.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "A list of products associated with the event.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Product", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "Event title", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "customizations", - "description": "List of customizations for the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderCustomizationNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "URL of the event", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "discount", - "description": "Amount of discount in the product price, if any.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "String", + "description": "The `String` scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Boolean", + "description": "The `Boolean` scalar type represents `true` or `false`.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Int", + "description": "The `Int` scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ApplyPolicy", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "BEFORE_RESOLVER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AFTER_RESOLVER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "ID", + "description": "The `ID` scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as `\"4\"`) or integer (such as `4`) input value will be accepted as an ID.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Long", + "description": "The `Long` scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CustomerOrderSortKeys", + "description": "Define the order attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The order ID.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DATE", + "description": "The date the order was placed.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STATUS", + "description": "The order current status.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AMOUNT", + "description": "The total order value.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "OrderSortDirection", + "description": "Define the sort orientation of the result set.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "DESC", + "description": "The results will be sorted in an descending order.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ASC", + "description": "The results will be sorted in an ascending order.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductsConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "kind": "OBJECT", + "name": "ProductsEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Product", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, - { - "name": "gift", - "description": "If the product is a gift.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProductSortKeys", + "description": "Define the product attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NAME", + "description": "The product name.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SALES", + "description": "The sales number on a period of time.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRICE", + "description": "The product variant price.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DISCOUNT", + "description": "The applied discount to the product variant price.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RANDOM", + "description": "Sort in a random way.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RELEASE_DATE", + "description": "The date the product was released.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STOCK", + "description": "The quantity in stock of the product variant.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SortDirection", + "description": "Define the sort orientation of the result set.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ASC", + "description": "The results will be sorted in an ascending order.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DESC", + "description": "The results will be sorted in an descending order.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Decimal", + "description": "The built-in `Decimal` scalar type.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProductSearchSortKeys", + "description": "Define the product attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "RELEVANCE", + "description": "The relevance that the search engine gave to the possible result item based on own criteria.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "The product name.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SALES", + "description": "The sales number on a period of time.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRICE", + "description": "The product variant price.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DISCOUNT", + "description": "The applied discount to the product variant price.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RANDOM", + "description": "Sort in a random way.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RELEASE_DATE", + "description": "The date the product was released.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "STOCK", + "description": "The quantity in stock of the product variant.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeFilterInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "attributeId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "image", - "description": "The product image.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "value", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "listPrice", - "description": "The product list price.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PageInfo", + "description": "Information about pagination in a connection.", + "fields": [ + { + "name": "endCursor", + "description": "When paginating forwards, the cursor to continue.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The product name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasNextPage", + "description": "Indicates whether more edges exist following the set defined by the clients arguments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "packagingPrice", - "description": "The cost of the packagings, if any.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hasPreviousPage", + "description": "Indicates whether more edges exist prior the set defined by the clients arguments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startCursor", + "description": "When paginating backwards, the cursor to continue.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "packagings", - "description": "List of packagings for the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderPackagingNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Product", + "description": "A product represents an item for sale in the store.", + "fields": [ + { + "name": "addToCartFromSpot", + "description": "Check if the product can be added to cart directly from spot.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "price", - "description": "The product price.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": "The product url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "aliasComplete", + "description": "The complete product url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productSeller", - "description": "Information about the product seller.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "List of the product attributes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "OrderSellerNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "ProductAttribute", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "author", + "description": "The product author.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "available", + "description": "Field to check if the product is available in stock.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "quantity", - "description": "Quantity of the given product in the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "averageRating", + "description": "The product average rating. From 0 to 5.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "salePrice", - "description": "The product sale price.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyBox", + "description": "BuyBox informations.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BuyBox", + "ofType": null }, - { - "name": "sku", - "description": "The product SKU.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "collection", + "description": "The product collection.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "trackings", - "description": "List of trackings for the order.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderTrackingNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "condition", + "description": "The product condition.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "unitaryValue", - "description": "Value of an unit of the product.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "counterOffer", + "description": "Checks if the product allows counteroffers.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createdAt", + "description": "The product creation date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadline", + "description": "The product delivery deadline.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "display", + "description": "Check if the product should be displayed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnlyPartner", + "description": "Check if the product should be displayed only for partners.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displaySearch", + "description": "Check if the product should be displayed on search.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ean", + "description": "The product's unique EAN.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "freeShipping", + "description": "Check if the product offers free shipping.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gender", + "description": "The product gender.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "height", + "description": "The height of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "images", + "description": "List of the product images.", + "args": [ + { + "name": "height", + "description": "The height of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutProductNode", - "description": null, - "fields": [ - { - "name": "ajustedPrice", - "description": "The product adjusted price", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "width", + "description": "The width of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "attributeSelections", - "description": "Information about the possible selection attributes.", - "args": [ - { - "name": "selected", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "AttributeFilterInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "AttributeSelection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "Image", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "informations", + "description": "List of the product insformations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Information", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "length", + "description": "The length of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "brand", - "description": "The product brand", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mainVariant", + "description": "Check if its the main variant.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "category", - "description": "The product category", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maximumOrderQuantity", + "description": "The product maximum quantity for an order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "gift", - "description": "If the product is a gift", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimumOrderQuantity", + "description": "The product minimum quantity for an order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newRelease", + "description": "Check if the product is a new release.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "numberOfVotes", + "description": "The number of votes that the average rating consists of.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parentId", + "description": "Parent product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "prices", + "description": "The product prices.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Prices", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productBrand", + "description": "Summarized informations about the brand of the product.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductBrand", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productCategories", + "description": "Summarized informations about the categories of the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductCategory", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productId", + "description": "Product unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productName", + "description": "The product name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productSubscription", + "description": "Summarized informations about the subscription of the product.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductSubscription", + "ofType": null + }, + "isDeprecated": true, + "deprecationReason": "Use subscriptionGroups to get subscription information." + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "promotions", + "description": "List of promotions this product belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Promotion", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "publisher", + "description": "The product publisher", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "seller", + "description": "The product seller.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Seller", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "similarProducts", + "description": "List of similar products. ", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SimilarProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sku", + "description": "The product's unique SKU.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotAttributes", + "description": "The values of the spot attribute.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotInformation", + "description": "The product spot information.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "spotlight", + "description": "Check if the product is on spotlight.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stock", + "description": "The available aggregated product stock (all variants) at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stocks", + "description": "List of the product stocks on different distribution centers.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Stock", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroups", + "description": "List of subscription groups this product belongs to.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SubscriptionGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "telesales", + "description": "Check if the product is a telesale.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updatedAt", + "description": "The product last update date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlVideo", + "description": "The product video url.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variantName", + "description": "The variant name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "variantStock", + "description": "The available aggregated variant stock at the default distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weight", + "description": "The weight of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "width", + "description": "The width of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductsEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Product", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "QueryRoot", + "description": null, + "fields": [ + { + "name": "address", + "description": "Get informations about an address.", + "args": [ + { + "name": "cep", + "description": "The address zip code.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "CEP", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "AddressNode", + "ofType": null }, - { - "name": "googleCategory", - "description": "The product Google category", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "autocomplete", + "description": "Get query completion suggestion.", + "args": [ + { + "name": "limit", + "description": null, + "type": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "imageUrl", - "description": "The product URL image", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "informations", - "description": "The product informations", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "installmentFee", - "description": "The product installment fee", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "query", + "description": null, + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Autocomplete", + "ofType": null }, - { - "name": "installmentValue", - "description": "The product installment value", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "banners", + "description": "List of banners.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "listPrice", - "description": "The product list price", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "bannerIds", + "description": "Filter the list by specific banner ids.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "metadata", - "description": "The metadata related to this checkout.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Metadata", + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The product name", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "numberOfInstallments", - "description": "The product number of installments", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "price", - "description": "The product price", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "partnerAccessToken", + "description": null, + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productAttributes", - "description": "The product attributes", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutProductAttributeNode", - "ofType": null - } + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BannerSortKeys", + "ofType": null + } + }, + "defaultValue": "ID" + } + ], + "type": { + "kind": "OBJECT", + "name": "BannersConnection", + "ofType": null }, - { - "name": "productId", - "description": "The product unique identifier", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "brands", + "description": "List of brands", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productVariantId", - "description": "The product variant unique identifier", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantity", - "description": "The product quantity", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "brandInput", + "description": "Brand input", + "type": { + "kind": "INPUT_OBJECT", + "name": "BrandFilterInput", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shippingDeadline", - "description": "The product shipping deadline", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CheckoutShippingDeadlineNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sku", - "description": "The product SKU", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "The product URL", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "String", - "description": "The \u0060String\u0060 scalar type represents textual data, represented as UTF-8 character sequences. The String type is most often used by GraphQL to represent free-form human-readable text.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Boolean", - "description": "The \u0060Boolean\u0060 scalar type represents \u0060true\u0060 or \u0060false\u0060.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Int", - "description": "The \u0060Int\u0060 scalar type represents non-fractional signed whole numeric values. Int can represent values between -(2^31) and 2^31 - 1.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ApplyPolicy", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "BEFORE_RESOLVER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AFTER_RESOLVER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "ID", - "description": "The \u0060ID\u0060 scalar type represents a unique identifier, often used to refetch an object or as key for a cache. The ID type appears in a JSON response as a String; however, it is not intended to be human-readable. When expected as an input type, any string (such as \u0060\u00224\u0022\u0060) or integer (such as \u00604\u0060) input value will be accepted as an ID.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Long", - "description": "The \u0060Long\u0060 scalar type represents non-fractional signed whole 64-bit numeric values. Long can represent values between -(2^63) and 2^63 - 1.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "CustomerOrderSortKeys", - "description": "Define the order attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The order ID.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DATE", - "description": "The date the order was placed.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STATUS", - "description": "The order current status.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AMOUNT", - "description": "The total order value.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "OrderSortDirection", - "description": "Define the sort orientation of the result set.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "DESC", - "description": "The results will be sorted in an descending order.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ASC", - "description": "The results will be sorted in an ascending order.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductsConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "sortDirection", + "description": null, + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "ProductsEdge", + "kind": "ENUM", + "name": "SortDirection", "ofType": null } - } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BrandSortKeys", + "ofType": null + } + }, + "defaultValue": "ID" + } + ], + "type": { + "kind": "OBJECT", + "name": "BrandsConnection", + "ofType": null }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "buyList", + "description": "Retrieve a buylist by the given id.", + "args": [ + { + "name": "id", + "description": "The list ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "BuyList", + "ofType": null }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "calculatePrices", + "description": "Prices informations", + "args": [ + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ProductSortKeys", - "description": "Define the product attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NAME", - "description": "The product name.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SALES", - "description": "The sales number on a period of time.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PRICE", - "description": "The product variant price.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DISCOUNT", - "description": "The applied discount to the product variant price.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RANDOM", - "description": "Sort in a random way.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RELEASE_DATE", - "description": "The date the product was released.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STOCK", - "description": "The quantity in stock of the product variant.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "SortDirection", - "description": "Define the sort orientation of the result set.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ASC", - "description": "The results will be sorted in an ascending order.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DESC", - "description": "The results will be sorted in an descending order.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Decimal", - "description": "The built-in \u0060Decimal\u0060 scalar type.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ProductSearchSortKeys", - "description": "Define the product attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "RELEVANCE", - "description": "The relevance that the search engine gave to the possible result item based on own criteria.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NAME", - "description": "The product name.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SALES", - "description": "The sales number on a period of time.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PRICE", - "description": "The product variant price.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DISCOUNT", - "description": "The applied discount to the product variant price.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RANDOM", - "description": "Sort in a random way.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RELEASE_DATE", - "description": "The date the product was released.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "STOCK", - "description": "The quantity in stock of the product variant.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "AttributeFilterInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "attributeId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "products", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CalculatePricesProductsInput", + "ofType": null + } + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Prices", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "categories", + "description": "List of categories.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "defaultValue": null - }, - { - "name": "value", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PageInfo", - "description": "Information about pagination in a connection.", - "fields": [ - { - "name": "endCursor", - "description": "When paginating forwards, the cursor to continue.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "categoryIds", + "description": "Filter the list by specific category ids.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasNextPage", - "description": "Indicates whether more edges exist following the set defined by the clients arguments.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hasPreviousPage", - "description": "Indicates whether more edges exist prior the set defined by the clients arguments.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "startCursor", - "description": "When paginating backwards, the cursor to continue.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Product", - "description": "A product represents an item for sale in the store.", - "fields": [ - { - "name": "addToCartFromSpot", - "description": "Check if the product can be added to cart directly from spot.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "alias", - "description": "The product url alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "attributes", - "description": "List of the product attributes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductAttribute", - "ofType": null - } + { + "name": "onlyRoot", + "description": "Filter only root categories", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": "false" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "available", - "description": "Field to check if the product is available in stock.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "averageRating", - "description": "The product average rating. From 0 to 5.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CategorySortKeys", + "ofType": null + } + }, + "defaultValue": "ID" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "urls", + "description": "Filter the list by specific urls", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CategoriesConnection", + "ofType": null }, - { - "name": "buyBox", - "description": "BuyBox informations.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "BuyBox", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkout", + "description": "Get info from the checkout cart corresponding to the given ID.", + "args": [ + { + "name": "checkoutId", + "description": "The cart ID used for checkout operations.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "condition", - "description": "The product condition.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutLite", + "description": "Retrieve essential checkout details for a specific cart.", + "args": [ + { + "name": "checkoutId", + "description": "The cart ID", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CheckoutLite", + "ofType": null }, - { - "name": "createdAt", - "description": "The product creation date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contents", + "description": "List of contents.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deadline", - "description": "The product delivery deadline.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "display", - "description": "Check if the product should be displayed.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayOnlyPartner", - "description": "Check if the product should be displayed only for partners.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displaySearch", - "description": "Check if the product should be displayed on search.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ean", - "description": "The product\u0027s unique EAN.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "contentIds", + "description": "Filter the list by specific content ids.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "freeShipping", - "description": "Check if the product offers free shipping.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "images", - "description": "List of the product images.", - "args": [ - { - "name": "height", - "description": "The height of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "width", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Image", - "ofType": null - } + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ContentSortKeys", + "ofType": null + } + }, + "defaultValue": "ID" + } + ], + "type": { + "kind": "OBJECT", + "name": "ContentsConnection", + "ofType": null }, - { - "name": "informations", - "description": "List of the product insformations.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Information", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customer", + "description": "Get informations about a customer from the store.", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mainVariant", - "description": "Check if its the main variant.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "minimumOrderQuantity", - "description": "The product minimum quantity for an order.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerAccessTokenDetails", + "description": "Get informations about a customer access token.", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessTokenDetails", + "ofType": null }, - { - "name": "newRelease", - "description": "Check if the product is a new release.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eventList", + "description": "Retrieve an event list by the token.", + "args": [ + { + "name": "eventListToken", + "description": "The event list token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "EventList", + "ofType": null }, - { - "name": "numberOfVotes", - "description": "The number of votes that the average rating consists of.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eventListType", + "description": "Retrieves event types", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "EventListType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eventLists", + "description": "Retrieves a list of store events.", + "args": [ + { + "name": "eventDate", + "description": "The event date.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "parentId", - "description": "Parent product unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null + { + "name": "eventName", + "description": "The event name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "prices", - "description": "The product prices.", - "args": [], - "type": { + { + "name": "eventType", + "description": "The event type name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Prices", - "ofType": null + "name": "EventListStore", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hotsite", + "description": "Retrieve a single hotsite. A hotsite consists of products, banners and contents.", + "args": [ + { + "name": "hotsiteId", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productBrand", - "description": "Summarized informations about the brand of the product.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductBrand", - "ofType": null + { + "name": "partnerAccessToken", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "url", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SingleHotsite", + "ofType": null }, - { - "name": "productCategories", - "description": "Summarized informations about the categories of the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductCategory", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hotsites", + "description": "List of the shop's hotsites. A hotsite consists of products, banners and contents.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productId", - "description": "Product unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productName", - "description": "The product name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productSubscription", - "description": "Summarized informations about the subscription of the product.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductSubscription", - "ofType": null + { + "name": "hotsiteIds", + "description": "Filter the list by specific hotsite ids.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "promotions", - "description": "List of promotions this product belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Promotion", + { + "name": "partnerAccessToken", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "seller", - "description": "The product seller.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Seller", - "ofType": null + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "HotsiteSortKeys", + "ofType": null + } + }, + "defaultValue": "ID" + } + ], + "type": { + "kind": "OBJECT", + "name": "HotsitesConnection", + "ofType": null }, - { - "name": "similarProducts", - "description": "List of similar products. ", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SimilarProduct", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "informationGroupFields", + "description": "Get information group fields.", + "args": [ + { + "name": "type", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "EnumInformationGroup", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "InformationGroupFieldNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "menuGroups", + "description": "List of menu groups.", + "args": [ + { + "name": "partnerAccessToken", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sku", - "description": "The product\u0027s unique SKU.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "spotAttributes", - "description": "The values of the spot attribute.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "position", + "description": null, + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "spotInformation", - "description": "The product spot information.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "spotlight", - "description": "Check if the product is on spotlight.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "stock", - "description": "The available stock at the default distribution center.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "stocks", - "description": "List of the product stocks on different distribution centers.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Stock", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionGroups", - "description": "List of subscription groups this product belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SubscriptionGroup", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "telesales", - "description": "Check if the product is a telesale.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updatedAt", - "description": "The product last update date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "urlVideo", - "description": "The product video url.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "variantName", - "description": "The variant name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductsEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "QueryRoot", - "description": null, - "fields": [ - { - "name": "address", - "description": "Get informations about an address.", - "args": [ - { - "name": "cep", - "description": "The address zip code.", - "type": { - "kind": "SCALAR", - "name": "CEP", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "AddressNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "autocomplete", - "description": "Get query completion suggestion.", - "args": [ - { - "name": "limit", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { + { + "name": "url", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "query", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Autocomplete", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "banners", - "description": "List of banners.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { + "name": "MenuGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "newsletterInformationGroupFields", + "description": "Get newsletter information group fields.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "InformationGroupFieldNode", + "ofType": null + } + }, + "isDeprecated": true, + "deprecationReason": "Use the informationGroupFields" + }, + { + "name": "node", + "description": null, + "args": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "ID", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "bannerIds", - "description": "Filter the list by specific banner ids.", - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": null, + "args": [ + { + "name": "ids", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "LIST", "name": null, "ofType": { @@ -6994,14550 +10552,16007 @@ "name": null, "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "ID", "ofType": null } } - }, - "defaultValue": null + } }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partner", + "description": "Get single partner.", + "args": [ + { + "name": "partnerAccessToken", + "description": "Filter the partner by access token.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + } }, - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Partner", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partnerByRegion", + "description": "Get partner by region.", + "args": [ + { + "name": "input", + "description": "Filter the partner by cep or region ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "PartnerByRegionInput", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Partner", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partners", + "description": "List of partners.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "BannerSortKeys", - "ofType": null - } - }, - "defaultValue": "ID" - } - ], - "type": { - "kind": "OBJECT", - "name": "BannersConnection", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "brands", - "description": "List of brands", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { + { + "name": "alias", + "description": "Filter the list by specific alias.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "brandInput", - "description": "Brand input", - "type": { - "kind": "INPUT_OBJECT", - "name": "BrandFilterInput", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { + "defaultValue": null + }, + { + "name": "names", + "description": "Filter the list by specific names.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + } }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "BrandSortKeys", - "ofType": null - } - }, - "defaultValue": "ID" - } - ], - "type": { - "kind": "OBJECT", - "name": "BrandsConnection", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "buyList", - "description": "Retrieve a buylist by the given id.", - "args": [ - { - "name": "id", - "description": "The list ID.", - "type": { + { + "name": "priceTableIds", + "description": "Filter the list by specific price table ids.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "Int", "ofType": null } - }, - "defaultValue": null + } }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "SCALAR", - "name": "String", + "defaultValue": null + }, + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "BuyList", - "ofType": null + } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "PartnerSortKeys", + "ofType": null + } + }, + "defaultValue": "ID" + } + ], + "type": { + "kind": "OBJECT", + "name": "PartnersConnection", + "ofType": null }, - { - "name": "calculatePrices", - "description": "Prices informations", - "args": [ - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentMethods", + "description": "Returns the available payment methods for a given cart ID", + "args": [ + { + "name": "checkoutId", + "description": "The cart ID used for checking available payment methods.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Uuid", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "products", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CalculatePricesProductsInput", - "ofType": null - } - } - }, - "defaultValue": null - } - ], - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Prices", - "ofType": null + "name": "paymentMethod", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "product", + "description": "Retrieve a product by the given id.", + "args": [ + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "categories", - "description": "List of categories.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { + { + "name": "productId", + "description": "The product ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "categoryIds", - "description": "Filter the list by specific category ids.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SingleProduct", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productAIRecommendationsByCart", + "description": "Retrieve a list of product recommendations based on the customer's cart.", + "args": [ + { + "name": "checkoutId", + "description": "The cart ID", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Uuid", "ofType": null - }, - "defaultValue": null + } + }, + "defaultValue": null + }, + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": "The number of product recommendations.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + } }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "CategorySortKeys", - "ofType": null - } - }, - "defaultValue": "ID" - } - ], - "type": { + "defaultValue": "5" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "CategoriesConnection", + "name": "Product", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "checkout", - "description": "Get info from the checkout cart corresponding to the given ID.", - "args": [ - { - "name": "checkoutId", - "description": "The cart ID used for checkout operations.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productAIRecommendationsByOrder", + "description": "Retrieve a list of product recommendations based on the customer's orders.", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": "The number of product recommendations.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null - } - ], - "type": { + } + }, + "defaultValue": "5" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Checkout", + "name": "Product", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "contents", - "description": "List of contents.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productOptions", + "description": "Options available for the given product.", + "args": [ + { + "name": "productId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductOption", + "ofType": null + }, + "isDeprecated": true, + "deprecationReason": "Use the product query." + }, + { + "name": "productRecommendations", + "description": "Retrieve a list of recommended products by product id.", + "args": [ + { + "name": "algorithm", + "description": "Algorithm type.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProductRecommendationAlgorithm", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "contentIds", - "description": "Filter the list by specific content ids.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "defaultValue": "DEFAULT" + }, + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { + "defaultValue": null + }, + { + "name": "productId", + "description": "The product identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": "The number of product recommendations.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + } }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ContentSortKeys", - "ofType": null - } - }, - "defaultValue": "ID" - } - ], - "type": { - "kind": "OBJECT", - "name": "ContentsConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customer", - "description": "Get informations about a customer from the store.", - "args": [ - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { + "defaultValue": "5" + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Customer", + "name": "Product", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "hotsite", - "description": "Retrieve a single hotsite. A hotsite consists of products, banners and contents.", - "args": [ - { - "name": "hotsiteId", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "Retrieve a list of products by specific filters.", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "url", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SingleHotsite", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hotsites", - "description": "List of the shop\u0027s hotsites. A hotsite consists of products, banners and contents.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", + { + "name": "filters", + "description": "The product filters to apply.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ProductExplicitFiltersInput", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "hotsiteIds", - "description": "Filter the list by specific hotsite ids.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", + "defaultValue": null + }, + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", + "defaultValue": "ASC" + }, + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ProductSortKeys", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + "defaultValue": "NAME" + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductsConnection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "scripts", + "description": "Retrieve a list of scripts.", + "args": [ + { + "name": "id", + "description": "The script Id.", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The script name.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sortKey", - "description": null, - "type": { + "defaultValue": null + }, + { + "name": "pageType", + "description": "The script page type list.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "ENUM", - "name": "HotsiteSortKeys", + "name": "ScriptPageType", "ofType": null } - }, - "defaultValue": "ID" - } - ], - "type": { - "kind": "OBJECT", - "name": "HotsitesConnection", - "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "menuGroups", - "description": "List of menu groups.", - "args": [ - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + { + "name": "position", + "description": "The script position.", + "type": { + "kind": "ENUM", + "name": "ScriptPosition", + "ofType": null }, - { - "name": "position", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "url", + "description": "Url for available scripts.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "url", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "MenuGroup", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "newsletterInformationGroupFields", - "description": "Get newsletter information group fields.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "InformationGroupFieldNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": null, - "args": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": null, - "args": [ - { - "name": "ids", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - } - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partner", - "description": "Get single partner.", - "args": [ - { - "name": "partnerAccessToken", - "description": "Filter the partner by access token.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Partner", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partnerByRegion", - "description": "Get partner by region.", - "args": [ - { - "name": "input", - "description": "Filter the partner by cep or region ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "PartnerByRegionInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Partner", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partners", - "description": "List of partners.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "alias", - "description": "Filter the list by specific alias.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { + "name": "Script", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "search", + "description": "Search products with cursor pagination.", + "args": [ + { + "name": "autoSecondSearch", + "description": "Toggle to perform second search automatically when the primary search returns no products.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", + "defaultValue": "false" + }, + { + "name": "operation", + "description": "The operation to perform between query terms.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "Operation", "ofType": null - }, - "defaultValue": null - }, - { - "name": "names", - "description": "Filter the list by specific names.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "priceTableIds", - "description": "Filter the list by specific price table ids.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + } }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "PartnerSortKeys", - "ofType": null - } - }, - "defaultValue": "ID" - } - ], - "type": { - "kind": "OBJECT", - "name": "PartnersConnection", - "ofType": null + "defaultValue": "AND" }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "paymentMethods", - "description": "Returns the available payment methods for a given cart ID", - "args": [ - { - "name": "checkoutId", - "description": "The cart ID used for checking available payment methods.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "paymentMethod", + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "product", - "description": "Retrieve a product by the given id.", - "args": [ - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null }, - { - "name": "productId", - "description": "The product ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SingleProduct", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productOptions", - "description": "Options available for the given product.", - "args": [ - { - "name": "productId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductOption", - "ofType": null + "defaultValue": null }, - "isDeprecated": true, - "deprecationReason": "Use the product query." - }, - { - "name": "productRecommendations", - "description": "Retrieve a list of recommended products by product id.", - "args": [ - { - "name": "algorithm", - "description": "Algorithm type.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ProductRecommendationAlgorithm", - "ofType": null - } - }, - "defaultValue": "DEFAULT" - }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "productId", - "description": "The product identifier.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "quantity", - "description": "The number of product recommendations.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": "5" - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", + { + "name": "query", + "description": "The search query.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "Retrieve a list of products by specific filters.", - "args": [ - { - "name": "after", - "description": "Returns the elements in the list that come after the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "before", - "description": "Returns the elements in the list that come before the specified cursor.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "filters", - "description": "The product filters to apply.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ProductExplicitFiltersInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "first", - "description": "Returns the first _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "last", - "description": "Returns the last _n_ elements from the list.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { + "defaultValue": null + }, + { + "name": "useAI", + "description": "Toggle to perform additional research using GenAI.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null - }, - { - "name": "sortDirection", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - } - }, - "defaultValue": "ASC" + } }, - { - "name": "sortKey", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ProductSortKeys", - "ofType": null - } - }, - "defaultValue": "NAME" - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductsConnection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scripts", - "description": "Retrieve a list of scripts.", - "args": [ - { - "name": "name", - "description": "The script name.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "pageType", - "description": "The script page type list.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ScriptPageType", - "ofType": null - } - } - }, - "defaultValue": null - }, - { - "name": "position", - "description": "The script position.", - "type": { - "kind": "ENUM", - "name": "ScriptPosition", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "url", - "description": "Url for available scripts.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Script", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "search", - "description": "Search products with cursor pagination.", - "args": [ - { - "name": "operation", - "description": "The operation to perform between query terms.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "Operation", - "ofType": null - } - }, - "defaultValue": "AND" - }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "query", - "description": "The search query.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Search", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shippingQuotes", - "description": "Get the shipping quotes by providing CEP and checkout or product identifier.", - "args": [ - { - "name": "cep", - "description": "CEP to get the shipping quotes.", - "type": { - "kind": "SCALAR", - "name": "CEP", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "checkoutId", - "description": "Checkout identifier to get the shipping quotes.", - "type": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "productVariantId", - "description": "Product identifier to get the shipping quotes.", - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "quantity", - "description": "Quantity of the product to get the shipping quotes.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": "1" - }, - { - "name": "useSelectedAddress", - "description": "Use the selected address to get the shipping quotes.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ShippingQuote", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shop", - "description": "Store informations", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Shop", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shopSettings", - "description": "Store settings", - "args": [ - { - "name": "settingNames", - "description": "Setting names", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ShopSetting", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "uri", - "description": "Get the URI kind.", - "args": [ - { - "name": "url", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Uri", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Mutation", - "description": null, - "fields": [ - { - "name": "checkoutAddCoupon", - "description": "Add coupon to checkout", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "coupon", - "description": "The coupon.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "A customer\u0027s access token", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutAddMetadata", - "description": "Add metadata to checkout", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "A customer\u0027s access token", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "metadata", - "description": "The list of metadata to add", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutMetadataInput", - "ofType": null - } - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutAddMetadataForProductVariant", - "description": "Add metadata to a checkout product", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "A customer\u0027s access token", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "metadata", - "description": "The list of metadata to add", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutMetadataInput", - "ofType": null - } - } - }, - "defaultValue": null - }, - { - "name": "productVariantId", - "description": "The product to be modifed", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutAddProduct", - "description": "Add products to an existing checkout", - "args": [ - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "input", - "description": "Params to add products to an existing checkout", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutProductInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutAddressAssociate", - "description": "Associate the address with a checkout.", - "args": [ - { - "name": "addressId", - "description": "The address ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutClone", - "description": "Clones a cart by the given checkout ID, returns the newly created checkout ID", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "copyUser", - "description": "Flag indicating whether to copy the existing Customer information to the new Checkout. Default is false", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "defaultValue": "false" - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutComplete", - "description": "Completes a checkout", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "comments", - "description": "Order comments.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "paymentData", - "description": "Payment data.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutCustomerAssociate", - "description": "Associate the customer with a checkout.", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutGiftVariantSelection", - "description": "Selects the variant of a gift product", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "productVariantId", - "description": "The variant id to select.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutPartnerAssociate", - "description": "Associate the partner with a checkout.", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "partnerAccessToken", - "description": "The partner access token.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutRemoveCoupon", - "description": "Add coupon to checkout", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutRemoveProduct", - "description": "Remove products from an existing checkout", - "args": [ - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "input", - "description": "Params to remove products from an existing checkout", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutProductInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutSelectInstallment", - "description": "Select installment.", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "installmentNumber", - "description": "The number of installments.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "selectedPaymentMethodId", - "description": "The selected payment method ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutSelectPaymentMethod", - "description": "Select payment method.", - "args": [ - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "paymentMethodId", - "description": "The payment method ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "checkoutSelectShippingQuote", - "description": "Select shipping quote", - "args": [ - { - "name": "additionalInformation", - "description": "The additional information for in-store pickup.", - "type": { - "kind": "INPUT_OBJECT", - "name": "InStorePickupAdditionalInformationInput", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "checkoutId", - "description": "The checkout ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "deliveryScheduleInput", - "description": "The delivery schedule.", - "type": { - "kind": "INPUT_OBJECT", - "name": "DeliveryScheduleInput", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "shippingQuoteId", - "description": "The shipping quote unique identifier.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createCheckout", - "description": "Create a new checkout", - "args": [ - { - "name": "products", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutProductItemInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createNewsletterRegister", - "description": "Register an email in the newsletter.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "NewsletterInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "NewsletterNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createProductReview", - "description": "Adds a review to a product variant.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "ReviewCreateInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "createSearchTermRecord", - "description": "Record a searched term for admin reports", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "SearchRecordInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SearchRecord", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerAccessTokenCreate", - "description": "Creates a new customer access token with an expiration time.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CustomerAccessTokenInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerAccessTokenRenew", - "description": "Renews the expiration time of a customer access token. The token must not be expired.", - "args": [ - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerAddressCreate", - "description": "Create an address.", - "args": [ - { - "name": "address", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CreateCustomerAddressInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerAddressUpdate", - "description": "Change an existing address", - "args": [ - { - "name": "address", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UpdateCustomerAddressInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "id", - "description": "The customer address unique identifier.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerCompletePartialRegistration", - "description": "Allows the user to complete the required information for a partial registration.", - "args": [ - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "CustomerSimpleCreateInputGraphInput", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerCreate", - "description": "Creates a new customer register.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "CustomerCreateInput", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Customer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerEmailChange", - "description": "Changes user email.", - "args": [ - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "CustomerEmailChangeInput", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OperationResult", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerImpersonate", - "description": "Impersonates a customer, generating an access token with expiration time.", - "args": [ - { - "name": "customerAccessToken", - "description": "The customer access token.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "input", - "description": "The e-mail input.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerPasswordChange", - "description": "Changes user password.", - "args": [ - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "input", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "CustomerPasswordChangeInputGraphInput", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OperationResult", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerPasswordRecovery", - "description": "Sends a password recovery email to the user.", - "args": [ - { - "name": "input", - "description": "The input used to login. Can be either an email or a CPF/CNPJ, if the option is enabled on store settings.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OperationResult", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerSimpleLoginStart", - "description": "Returns the user associated with a simple login (CPF or Email) if exists, else return a New user.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SimpleLogin", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerSimpleLoginVerifyAnwser", - "description": "Verify if the answer to a simple login question is correct, returns a new question if the answer is incorrect", - "args": [ - { - "name": "anwserId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "input", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "questionId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "SimpleLogin", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerSocialLoginFacebook", - "description": "Returns the user associated with a Facebook account if exists, else return a New user.", - "args": [ - { - "name": "facebookAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerSocialLoginGoogle", - "description": "Returns the user associated with a Google account if exists, else return a New user.", - "args": [ - { - "name": "clientId", - "description": "The client Id returned from the google credential object.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "userCredential", - "description": "The user credential after authorizing through the google popup window.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerUpdate", - "description": "Updates a customer register.", - "args": [ - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CustomerUpdateInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "Customer", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partnerAccessTokenCreate", - "description": "Creates a new closed scope partner access token with an expiration time.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "PartnerAccessTokenInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "PartnerAccessToken", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productPriceAlert", - "description": "Add a price alert.", - "args": [ - { - "name": "input", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "AddPriceAlertInput", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "ProductPriceAlert", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productRestockAlert", - "description": "Creates an alert to notify when the product is back in stock.", - "args": [ - { - "name": "input", - "description": "Params to create an alert for product back in stock.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "RestockAlertInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "partnerAccessToken", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "RestockAlertNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sendGenericForm", - "description": "Send a generic form.", - "args": [ - { - "name": "body", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Any", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "file", - "description": null, - "type": { - "kind": "SCALAR", - "name": "Upload", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "OperationResult", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "updateAddress", - "description": "Change an existing address", - "args": [ - { - "name": "address", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "UpdateCustomerAddressInput", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "customerAccessToken", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "id", - "description": "The customer address unique identifier.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "ofType": null - }, - "isDeprecated": true, - "deprecationReason": "Use the CustomerAddressUpdate mutation." - }, - { - "name": "wishlistAddProduct", - "description": "Adds a product to the customer\u0027s wishlist.", - "args": [ - { - "name": "customerAccessToken", - "description": "A customer\u0027s access token", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "productId", - "description": "ID of the product to be added to the customer\u0027s wishlist", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "wishlistRemoveProduct", - "description": "Removes a product from the customer\u0027s wishlist.", - "args": [ - { - "name": "customerAccessToken", - "description": "A customer\u0027s access token", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "productId", - "description": "ID of the product to be removed from the customer\u0027s wishlist", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INTERFACE", - "name": "Node", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": [ - { - "kind": "OBJECT", - "name": "Checkout", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Customer", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Hotsite", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "SingleHotsite", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Brand", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ProductOption", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Category", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Customization", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "SingleProduct", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ProductVariant", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "MenuGroup", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Product", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Banner", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Content", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Attribute", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ProductAttribute", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Menu", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "Partner", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "ShippingQuote", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "paymentMethod", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "InformationGroupFieldNode", - "ofType": null - }, - { - "kind": "OBJECT", - "name": "BuyList", - "ofType": null - } - ] - }, - { - "kind": "OBJECT", - "name": "SelectedPaymentMethod", - "description": "The selected payment method details.", - "fields": [ - { - "name": "id", - "description": "The unique identifier for the selected payment method.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "installments", - "description": "The list of installments associated with the selected payment method.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SelectedPaymentMethodInstallment", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "selectedInstallment", - "description": "The selected installment.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "SelectedPaymentMethodInstallment", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutCustomer", - "description": "Represents a customer node in the checkout.", - "fields": [ - { - "name": "cnpj", - "description": "Taxpayer identification number for businesses.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cpf", - "description": "Brazilian individual taxpayer registry identification.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "creditLimit", - "description": "The credit limit of the customer.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "creditLimitBalance", - "description": "The credit limit balance of the customer.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerId", - "description": "Customer\u0027s unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customerName", - "description": "Customer\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": "The email address of the customer.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "phoneNumber", - "description": "Customer\u0027s phone number.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutAddress", - "description": "Represents an address node in the checkout.", - "fields": [ - { - "name": "addressNumber", - "description": "The street number of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cep", - "description": "The ZIP code of the address.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "city", - "description": "The city of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "complement", - "description": "The additional address information.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "neighborhood", - "description": "The neighborhood of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "referencePoint", - "description": "The reference point for the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "state", - "description": "The state of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "street", - "description": "The street name of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Metadata", - "description": "Some products can have metadata, like diferent types of custom information. A basic key value pair.", - "fields": [ - { - "name": "key", - "description": "Metadata key.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "Metadata value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "DateTime", - "description": "The \u0060DateTime\u0060 scalar represents an ISO-8601 compliant date time type.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderDelivery", - "description": "The delivery or store pickup details.", - "fields": [ - { - "name": "address", - "description": "The delivery or store pickup address.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CheckoutOrderAddress", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cost", - "description": "The cost of delivery or pickup.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deliveryTime", - "description": "The estimated delivery or pickup time, in days.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the recipient.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderPayment", - "description": "The checkout order payment.", - "fields": [ - { - "name": "invoice", - "description": "The bank invoice payment information.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CheckoutOrderInvoicePayment", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the payment method.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pix", - "description": "The Pix payment information.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CheckoutOrderPixPayment", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "OrderStatus", - "description": "Represents the status of an order.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "PAID", - "description": "Order has been paid.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AWAITING_PAYMENT", - "description": "Order is awaiting payment.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCELLED_TEMPORARILY_DENIED_CARD", - "description": "Order has been cancelled - Card Temporarily Denied.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCELLED_DENIED_CARD", - "description": "Order has been cancelled - Card Denied.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCELLED_FRAUD", - "description": "Order has been cancelled - Fraud.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCELLED_SUSPECT_FRAUD", - "description": "Order has been cancelled - Suspected Fraud.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCELLED_ORDER_CANCELLED", - "description": "Order has been cancelled.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CANCELLED", - "description": "Order has been cancelled.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SENT", - "description": "Order has been sent.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AUTHORIZED", - "description": "Order has been authorized.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SENT_INVOICED", - "description": "Order has been sent - Invoiced.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RETURNED", - "description": "Order has been returned.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DOCUMENTS_FOR_PURCHASE", - "description": "Documents needed for purchase.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "APPROVED_ANALYSIS", - "description": "Order has been approved in analysis.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "RECEIVED_GIFT_CARD", - "description": "Order has been received - Gift Card.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SEPARATED", - "description": "Order has been separated.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ORDERED", - "description": "Order has been placed.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DELIVERED", - "description": "Order has been delivered.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AWAITING_PAYMENT_CHANGE", - "description": "Order is awaiting change of payment method.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CHECKED_ORDER", - "description": "Order has been checked.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PICK_UP_IN_STORE", - "description": "Available for pick-up in store.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "DENIED_PAYMENT", - "description": "Payment denied, but the order has not been cancelled.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CREDITED", - "description": "Order has been credited.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderProduct", - "description": "Represents a node in the checkout order products.", - "fields": [ - { - "name": "adjustments", - "description": "The list of adjustments applied to the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutOrderProductAdjustment", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "attributes", - "description": "The list of attributes of the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CheckoutOrderProductAttribute", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "imageUrl", - "description": "The image URL of the product.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the product.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "productVariantId", - "description": "The ID of the product variant.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantity", - "description": "The quantity of the product.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The value of the product.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderAdjustment", - "description": "Represents an adjustment applied to checkout.", - "fields": [ - { - "name": "name", - "description": "The name of the adjustment.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The type of the adjustment.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The value of the adjustment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "DeliveryScheduleDetail", - "description": "The delivery schedule detail.", - "fields": [ - { - "name": "date", - "description": "The date of the delivery schedule.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endDateTime", - "description": "The end date and time of the delivery schedule.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "endTime", - "description": "The end time of the delivery schedule.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "startDateTime", - "description": "The start date and time of the delivery schedule.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "startTime", - "description": "The start time of the delivery schedule.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "Float", - "description": "The \u0060Float\u0060 scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerAddressNode", - "description": null, - "fields": [ - { - "name": "addressDetails", - "description": "Address details.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "addressNumber", - "description": "Address number.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "cep", - "description": "zip code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "city", - "description": "address city.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country", - "description": "Country.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "email", - "description": "The email of the customer address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the customer address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "neighborhood", - "description": "Address neighborhood.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "phone", - "description": "The phone of the customer address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "referencePoint", - "description": "Address reference point.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "state", - "description": "State.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "street", - "description": "Address street.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "defaultValue": "false" + } + ], + "type": { + "kind": "OBJECT", + "name": "Search", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerPartnerNode", - "description": null, - "fields": [ - { - "name": "alias", - "description": "The partner alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The partner\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partnerAccessToken", - "description": "The partner\u0027s access token.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "wishlist", - "description": null, - "fields": [ - { - "name": "products", - "description": "Wishlist products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerInformationGroupNode", - "description": null, - "fields": [ - { - "name": "exibitionName", - "description": "The group exibition name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fields", - "description": "The group fields.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "CustomerInformationGroupFieldNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The group name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerOrdersStatistics", - "description": null, - "fields": [ - { - "name": "productsQuantity", - "description": "The number of products the customer made from the number of orders.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantity", - "description": "The number of orders the customer made.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HotsiteSorting", - "description": null, - "fields": [ - { - "name": "direction", - "description": null, - "args": [], - "type": { - "kind": "ENUM", - "name": "SortDirection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "field", - "description": null, - "args": [], - "type": { - "kind": "ENUM", - "name": "ProductSortKeys", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "HotsiteSubtype", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "CATEGORY", - "description": "Hotsite created from a category.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BRAND", - "description": "Hotsite created from a brand.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PORTFOLIO", - "description": "Hotsite created from a portfolio.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BUY_LIST", - "description": "Hotsite created from a buy list (lista de compra).", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Banner", - "description": "A banner is usually an image used to show sales, highlight products, announcements or to redirect to another page or hotsite on click.", - "fields": [ - { - "name": "altText", - "description": "Banner\u0027s alternative text.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "bannerId", - "description": "Banner unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "bannerName", - "description": "Banner\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "bannerUrl", - "description": "URL where the banner is stored.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "creationDate", - "description": "The date the banner was created.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "displayOnAllPages", - "description": "Field to check if the banner should be displayed on all pages.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sellers", + "description": "List of sellers", + "args": [ + { + "name": "after", + "description": "Returns the elements in the list that come after the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayOnCategories", - "description": "Field to check if the banner should be displayed on category pages.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "before", + "description": "Returns the elements in the list that come before the specified cursor.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayOnSearches", - "description": "Field to check if the banner should be displayed on search pages.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "first", + "description": "Returns the first _n_ elements from the list.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayOnWebsite", - "description": "Field to check if the banner should be displayed on the website.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "last", + "description": "Returns the last _n_ elements from the list.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayToPartners", - "description": "Field to check if the banner should be displayed to partners.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "sellerName", + "description": "Seller's name or corporate name", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "height", - "description": "The banner\u0027s height in px.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + { + "name": "sortDirection", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + } + }, + "defaultValue": "ASC" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "sortKey", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ResellerSortKeys", + "ofType": null + } + }, + "defaultValue": "NAME" + } + ], + "type": { + "kind": "OBJECT", + "name": "SellersConnection", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingQuoteGroups", + "description": "Get the shipping quote groups by providing CEP and checkout or products.", + "args": [ + { + "name": "cep", + "description": "CEP to get the shipping quotes.", + "type": { + "kind": "SCALAR", + "name": "CEP", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "openNewTab", - "description": "Field to check if the banner URL should open in another tab on click.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "checkoutId", + "description": "Checkout identifier to get the shipping quotes.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "useSelectedAddress", + "description": "Use the selected address to get the shipping quotes.", + "type": { "kind": "SCALAR", "name": "Boolean", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "order", - "description": "The displaying order of the banner.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ShippingQuoteGroup", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingQuotes", + "description": "Get the shipping quotes by providing CEP and checkout or product identifier.", + "args": [ + { + "name": "cep", + "description": "CEP to get the shipping quotes.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "CEP", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "position", - "description": "The displaying position of the banner.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "searchTerms", - "description": "A list of terms to display the banner on search.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "checkoutId", + "description": "Checkout identifier to get the shipping quotes.", + "type": { "kind": "SCALAR", - "name": "String", + "name": "Uuid", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The banner\u0027s title.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "urlOnClick", - "description": "URL to be redirected on click.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "width", - "description": "The banner\u0027s width in px.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Content", - "description": "Contents are used to show things to the user.", - "fields": [ - { - "name": "content", - "description": "The content in html to be displayed.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "contentId", - "description": "Content unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "productVariantId", + "description": "Product identifier to get the shipping quotes.", + "type": { "kind": "SCALAR", "name": "Long", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "creationDate", - "description": "The date the content was created.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "height", - "description": "The content\u0027s height in px.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + { + "name": "products", + "description": "List of Products to get the shipping quotes.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "productsInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "position", - "description": "The content\u0027s position.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "quantity", + "description": "Quantity of the product to get the shipping quotes.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": "1" }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "useSelectedAddress", + "description": "Use the selected address to get the shipping quotes.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ShippingQuote", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shop", + "description": "Store informations", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Shop", + "ofType": null }, - { - "name": "searchTerms", - "description": "A list of terms to display the content on search.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shopSetting", + "description": "Returns a single store setting", + "args": [ + { + "name": "settingName", + "description": "Setting name", + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The content\u0027s title.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "width", - "description": "The content\u0027s width in px.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ShopSetting", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SEO", - "description": "Entity SEO information.", - "fields": [ - { - "name": "content", - "description": "Content of SEO.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "httpEquiv", - "description": "Equivalent SEO type for HTTP.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "Name of SEO.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "scheme", - "description": "Scheme for SEO.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "type", - "description": "Type of SEO.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Breadcrumb", - "description": "Informations about breadcrumb.", - "fields": [ - { - "name": "link", - "description": "Breadcrumb link.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shopSettings", + "description": "Store settings", + "args": [ + { + "name": "settingNames", + "description": "Setting names", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ShopSetting", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "uri", + "description": "Get the URI kind.", + "args": [ + { + "name": "partnerAccessToken", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "url", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Uri", + "ofType": null }, - { - "name": "text", - "description": "Breadcrumb text.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Mutation", + "description": null, + "fields": [ + { + "name": "checkoutAddCoupon", + "description": "Add coupon to checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductAggregations", - "description": null, - "fields": [ - { - "name": "filters", - "description": "List of product filters which can be used to filter subsequent queries.", - "args": [ - { - "name": "position", - "description": "The filter position.", - "type": { - "kind": "ENUM", - "name": "FilterPosition", + { + "name": "coupon", + "description": "The coupon.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SearchFilter", - "ofType": null - } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "maximumPrice", - "description": "Minimum price of the products.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "A customer's access token", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "minimumPrice", - "description": "Maximum price of the products.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "priceRanges", - "description": "List of price ranges for the selected products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PriceRange", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutAddKit", + "description": "Add kit to an existing checkout", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "order", - "description": null, - "fields": [ - { - "name": "coupon", - "description": "The coupon for discounts.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": "Params to add kit to an existing checkout", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "currentAccount", - "description": "Current account value used for the order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "date", - "description": "The date when te order was placed.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutAddMetadata", + "description": "Add metadata to checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": "A customer's access token", + "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "deliveryAddress", - "description": "The address where the order will be delivered.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "OrderDeliveryAddressNode", - "ofType": null + { + "name": "metadata", + "description": "The list of metadata to add", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutMetadataInput", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "discount", - "description": "Order discount amount, if any.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "interestFee", - "description": "Order interest fee, if any.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutAddMetadataForProductVariant", + "description": "Add metadata to a checkout product", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": "A customer's access token", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null + }, + { + "name": "metadata", + "description": "The list of metadata to add", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutMetadataInput", + "ofType": null + } + } + }, + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The product to be modifed", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "invoices", - "description": "Information about order invoices.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderInvoiceNode", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutAddProduct", + "description": "Add products to an existing checkout", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "notes", - "description": "Information about order notes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderNoteNode", + { + "name": "input", + "description": "Params to add products to an existing checkout", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutAddressAssociate", + "description": "Associate the address with a checkout.", + "args": [ + { + "name": "addressId", + "description": "The address ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "orderId", - "description": "Order unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutClone", + "description": "Clones a cart by the given checkout ID, returns the newly created checkout ID", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "copyUser", + "description": "Flag indicating whether to copy the existing Customer information to the new Checkout. Default is false", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": "false" + }, + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "paymentDate", - "description": "The date when the order was payed.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutComplete", + "description": "Completes a checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "payments", - "description": "Information about payments.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderPaymentNode", + { + "name": "comments", + "description": "Order comments.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "products", - "description": "Products belonging to the order.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderProductNode", + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "promotions", - "description": "List of promotions applied to the order.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "paymentData", + "description": "Payment data.", + "type": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null } - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shippingFee", - "description": "The shipping fee.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "shippings", - "description": "Information about order shippings.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderShippingNode", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "status", - "description": "The order current status.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "OrderStatusNode", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutCustomerAssociate", + "description": "Associate the customer with a checkout.", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "statusHistory", - "description": "List of the order status history.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderStatusNode", - "ofType": null - } + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subtotal", - "description": "Order subtotal value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "total", - "description": "Order total value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutDeleteSuggestedCard", + "description": "Delete a suggested card", + "args": [ + { + "name": "cardKey", + "description": "The card key", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "trackings", - "description": "Information about order trackings.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderTrackingNode", - "ofType": null - } + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "forbiddenTerm", - "description": "Informations about a forbidden search term.", - "fields": [ - { - "name": "suggested", - "description": "The suggested search term instead.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "text", - "description": "The text to display about the term.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "paymentMethodId", + "description": "The payment method ID", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Attribute", - "description": "Attributes available for the variant products from the given productId.", - "fields": [ - { - "name": "attributeId", - "description": "The id of the attribute.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayType", - "description": "The display type of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The type of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "values", - "description": "The values of the attribute.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AttributeValue", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Review", - "description": "A product review written by a customer.", - "fields": [ - { - "name": "customer", - "description": "The reviewer name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "email", - "description": "The reviewer e-mail.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutGiftVariantSelection", + "description": "Selects the variant of a gift product", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "rating", - "description": "The review rating.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "review", - "description": "The review content.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "productVariantId", + "description": "The variant id to select.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "reviewDate", - "description": "The review date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "DateTime", + "name": "String", "ofType": null - } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutPartnerAssociate", + "description": "Associate the partner with a checkout.", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeSelection", - "description": "Attributes available for the variant products from the given productId.", - "fields": [ - { - "name": "canBeMatrix", - "description": "Check if the current product attributes can be rendered as a matrix.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "candidateVariant", - "description": "The candidate variant given the current input filters. Variant may be from brother product Id.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductVariant", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "matrix", - "description": "Informations about the attribute matrix.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "AttributeMatrix", - "ofType": null + { + "name": "partnerAccessToken", + "description": "The partner access token.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "selectedVariant", - "description": "The selected variant given the current input filters. Variant may be from brother product Id.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductVariant", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutPartnerDisassociate", + "description": "Disassociates the checkout from the partner and returns a new checkout.", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "selections", - "description": "Attributes available for the variant products from the given productId.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AttributeSelectionOption", + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Image", - "description": "Informations about an image of a product.", - "fields": [ - { - "name": "fileName", - "description": "The name of the image file.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "mini", - "description": "Check if the image is used for the product main image.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "order", - "description": "Numeric order the image should be displayed.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutRemoveCoupon", + "description": "Remove coupon to checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "print", - "description": "Check if the image is used for the product prints only.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "url", - "description": "The url to retrieve the image", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Promotion", - "description": "Information about promotions of a product.", - "fields": [ - { - "name": "content", - "description": "The promotion html content.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutRemoveKit", + "description": "Remove kit from an existing checkout", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "disclosureType", - "description": "Where the promotion is shown (spot, product page, etc..).", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": "Params to remove kit from an existing checkout", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "fullStampUrl", - "description": "The stamp URL of the promotion.", - "args": [ - { - "name": "height", - "description": "The height of the image.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutRemoveMetadata", + "description": "Removes metadata keys from a checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Uuid", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "width", - "description": "The width of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The promotion id.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "A customer's access token", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "stamp", - "description": "The stamp of the promotion.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "keys", + "description": "The list of metadata keys to remove", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "title", - "description": "The promotion title.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutRemoveProduct", + "description": "Remove products from an existing checkout", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductBrand", - "description": null, - "fields": [ - { - "name": "alias", - "description": "The hotsite url alias fot this brand.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": "Params to remove products from an existing checkout", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "fullUrlLogo", - "description": "The full brand logo URL.", - "args": [ - { - "name": "height", - "description": "The height of the image.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutRemoveProductCustomization", + "description": "Remove Customization to Checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Uuid", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "width", - "description": "The width of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The brand id.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "logoUrl", - "description": "The url that contains the brand logo image.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the brand.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "customizationId", + "description": "The product customization unique identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Prices", - "description": "The prices of the product.", - "fields": [ - { - "name": "bestInstallment", - "description": "The best installment option available.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "BestInstallment", - "ofType": null + { + "name": "productVariantId", + "description": "The ID of the variant to be removed.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "discountPercentage", - "description": "The amount of discount in percentage.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "discounted", - "description": "Wether the current price is discounted.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutRemoveProductSubscription", + "description": "Remove Subscription to Checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "installmentPlans", - "description": "List of the possibles installment plans.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "InstallmentPlan", - "ofType": null - } + { + "name": "productVariantId", + "description": "The ID of the variant to be removed.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "listPrice", - "description": "The listed regular price of the product.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutReset", + "description": "Resets a specific area of a checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "multiplicationFactor", - "description": "The multiplication factor used for items that are sold by quantity.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Float", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "types", + "description": "The reset types to apply", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "CheckoutResetType", + "ofType": null + } + } + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "price", - "description": "The current working price.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutSelectInstallment", + "description": "Select installment.", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "priceTables", - "description": "List of the product different price tables. \n\n Only returned when using the partnerAccessToken or public price tables.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PriceTable", - "ofType": null - } + { + "name": "installmentNumber", + "description": "The number of installments.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "wholesalePrices", - "description": "Lists the different price options when buying the item over the given quantity.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "WholesalePrices", + { + "name": "orderId", + "description": "The order ID.", + "type": { + "kind": "SCALAR", + "name": "Long", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductSubscription", - "description": null, - "fields": [ - { - "name": "discount", - "description": "The amount of discount if this product is sold as a subscription.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "selectedPaymentMethodId", + "description": "The selected payment method ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "price", - "description": "The price of the product when sold as a subscription.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutSelectPaymentMethod", + "description": "Select payment method.", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "subscriptionOnly", - "description": "Wether this product is sold only as a subscrition.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductAttribute", - "description": "The attributes of the product.", - "fields": [ - { - "name": "attributeId", - "description": "The id of the attribute.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "orderId", + "description": "The order ID.", + "type": { "kind": "SCALAR", "name": "Long", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "displayType", - "description": "The display type of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The type of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The value of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "paymentMethodId", + "description": "The payment method ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Stock", - "description": "Information about a product stock in a particular distribution center.", - "fields": [ - { - "name": "id", - "description": "The id of the distribution center.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "items", - "description": "The number of physical items in stock at this DC.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutSelectShippingQuote", + "description": "Select shipping quote", + "args": [ + { + "name": "additionalInformation", + "description": "The additional information for in-store pickup.", + "type": { + "kind": "INPUT_OBJECT", + "name": "InStorePickupAdditionalInformationInput", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the distribution center.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductCategory", - "description": "Information about the category of a product.", - "fields": [ - { - "name": "active", - "description": "Wether the category is currently active.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "googleCategories", - "description": "The categories in google format.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "deliveryScheduleInput", + "description": "The delivery schedule.", + "type": { + "kind": "INPUT_OBJECT", + "name": "DeliveryScheduleInput", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "hierarchy", - "description": "The category hierarchy.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "distributionCenterId", + "description": "The distribution center ID.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The id of the category.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "shippingQuoteId", + "description": "The shipping quote unique identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "main", - "description": "Wether this category is the main category for this product.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutUpdateProduct", + "description": "Update a product of an existing checkout", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The category name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": "Params of the updated product of the existing checkout", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductUpdateInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "url", - "description": "The category hotsite url alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "checkoutUseCheckingAccount", + "description": "Use balance checking account checkout", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Information", - "description": "Information registred to the product.", - "fields": [ - { - "name": "id", - "description": "The information id.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "title", - "description": "The information title.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The information type.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "useBalance", + "description": "Use checking account balance", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "value", - "description": "The information value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createCheckout", + "description": "Create a new checkout", + "args": [ + { + "name": "products", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductItemInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SubscriptionGroup", - "description": null, - "fields": [ - { - "name": "recurringTypes", - "description": "The recurring types for this subscription group.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SubscriptionRecurringType", + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null }, - { - "name": "status", - "description": "The status name of the group.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createNewsletterRegister", + "description": "Register an email in the newsletter.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "NewsletterInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "statusId", - "description": "The status id of the group.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "NewsletterNode", + "ofType": null }, - { - "name": "subscriptionGroupId", - "description": "The subscription group id.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createProductReview", + "description": "Adds a review to a product variant.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "ReviewCreateInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Review", + "ofType": null }, - { - "name": "subscriptionOnly", - "description": "Wether the product is only avaible for subscription.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "createSearchTermRecord", + "description": "Record a searched term for admin reports", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "SearchRecordInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SimilarProduct", - "description": "Information about a similar product.", - "fields": [ - { - "name": "alias", - "description": "The url alias of this similar product.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SearchRecord", + "ofType": null }, - { - "name": "image", - "description": "The file name of the similar product image.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerAccessTokenCreate", + "description": "Creates a new customer access token with an expiration time.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CustomerAccessTokenInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null }, - { - "name": "imageUrl", - "description": "The URL of the similar product image.", - "args": [ - { - "name": "h", - "description": "The height of the image the url will return.", - "type": { + "isDeprecated": true, + "deprecationReason": "Use the CustomerAuthenticatedLogin mutation." + }, + { + "name": "customerAccessTokenRenew", + "description": "Renews the expiration time of a customer access token. The token must not be expired.", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "w", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerAddressCreate", + "description": "Create an address.", + "args": [ + { + "name": "address", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CreateCustomerAddressInput", "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The name of the similar product.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BuyBox", - "description": "BuyBox informations.", - "fields": [ - { - "name": "installmentPlans", - "description": "List of the possibles installment plans.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "InstallmentPlan", + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "maximumPrice", - "description": "Maximum price among sellers.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null }, - { - "name": "minimumPrice", - "description": "Minimum price among sellers.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerAddressRemove", + "description": "Delete an existing address, if it is not the only registered address", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantityOffers", - "description": "Quantity of offers.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + { + "name": "id", + "description": "The customer address unique identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "sellers", - "description": "List of sellers.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Seller", + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Seller", - "description": "Seller informations.", - "fields": [ - { - "name": "name", - "description": "Seller name", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SellerOffer", - "description": "The seller\u0027s product offer", - "fields": [ - { - "name": "name", - "description": null, - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "prices", - "description": "The product prices.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "SellerPrices", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PhysicalStore", - "description": "Informations about the physical store.", - "fields": [ - { - "name": "additionalText", - "description": "Additional text.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerAddressUpdate", + "description": "Change an existing address", + "args": [ + { + "name": "address", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "UpdateCustomerAddressInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "address", - "description": "Physical store address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "addressDetails", - "description": "Physical store address details.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "id", + "description": "The customer address unique identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null }, - { - "name": "addressNumber", - "description": "Physical store address number.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerAuthenticatedLogin", + "description": "Creates a new customer access token with an expiration time.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CustomerAuthenticateInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null }, - { - "name": "city", - "description": "Physical store address city.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerCompletePartialRegistration", + "description": "Allows the user to complete the required information for a partial registration.", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "country", - "description": "Physical store country.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "CustomerSimpleCreateInputGraphInput", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "ddd", - "description": "Physical store DDD.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null }, - { - "name": "deliveryDeadline", - "description": "Delivery deadline.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerCreate", + "description": "Creates a new customer register.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "CustomerCreateInput", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "email", - "description": "Physical store email.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerEmailChange", + "description": "Changes user email.", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "latitude", - "description": "Physical store latitude.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "CustomerEmailChangeInput", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "longitude", - "description": "Physical store longitude.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerImpersonate", + "description": "Impersonates a customer, generating an access token with expiration time.", + "args": [ + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "Physical store name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": "The e-mail input.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null }, - { - "name": "neighborhood", - "description": "Physical store address neighborhood.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerPasswordChange", + "description": "Changes user password.", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "phoneNumber", - "description": "Physical store phone number.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "CustomerPasswordChangeInput", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "physicalStoreId", - "description": "Physical store ID.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "pickup", - "description": "If the physical store allows pickup.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerPasswordChangeByRecovery", + "description": "Change user password by recovery.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "INPUT_OBJECT", + "name": "CustomerPasswordChangeByRecoveryInput", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pickupDeadline", - "description": "Pickup deadline.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "state", - "description": "Physical store state.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "zipCode", - "description": "Physical store zip code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Menu", - "description": "Informations about menu items.", - "fields": [ - { - "name": "cssClass", - "description": "Menu css class to apply.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "fullImageUrl", - "description": "The full image URL.", - "args": [ - { - "name": "height", - "description": "The height of the image.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerPasswordRecovery", + "description": "Sends a password recovery email to the user.", + "args": [ + { + "name": "input", + "description": "The input used to login. Can be either an email or a CPF/CNPJ, if the option is enabled on store settings.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "width", - "description": "The width of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSimpleLoginStart", + "description": "Returns the user associated with a simple login (CPF or Email) if exists, else return a New user.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SimpleLogin", + "ofType": null }, - { - "name": "imageUrl", - "description": "Menu image url address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSimpleLoginVerifyAnwser", + "description": "Verify if the answer to a simple login question is correct, returns a new question if the answer is incorrect", + "args": [ + { + "name": "answerId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "level", - "description": "Menu hierarchy level.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "input", + "description": null, + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "link", - "description": "Menu link address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "questionId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "SimpleLogin", + "ofType": null }, - { - "name": "menuGroupId", - "description": "Menu group identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSocialLoginFacebook", + "description": "Returns the user associated with a Facebook account if exists, else return a New user.", + "args": [ + { + "name": "facebookAccessToken", + "description": null, + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "menuId", - "description": "Menu identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null }, - { - "name": "name", - "description": "Menu name.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSocialLoginGoogle", + "description": "Returns the user associated with a Google account if exists, else return a New user.", + "args": [ + { + "name": "clientId", + "description": "[Deprecated: Google no longer sends this information in the authentication process] The client Id returned from the google credential object.", + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "openNewTab", - "description": "Menu hierarchy level.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "order", - "description": "Menu position order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "userCredential", + "description": "The user credential after authorizing through the google popup window.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null }, - { - "name": "parentMenuId", - "description": "Parent menu identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSubscriptionAddressChange", + "description": "Allows a customer to change the delivery address for an existing subscription.", + "args": [ + { + "name": "addressId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "text", - "description": "Menu extra text.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderAdjustNode", - "description": null, - "fields": [ - { - "name": "name", - "description": "The adjust name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "subscriptionId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "note", - "description": "Note about the adjust.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSubscriptionProductAdd", + "description": "Add products to an existing subscription", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "Type of adjust.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null + { + "name": "products", + "description": "Products to be added to an existing subscription.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "SubscriptionProductsInput", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "Amount to be adjusted.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderAttributeNode", - "description": null, - "fields": [ - { - "name": "name", - "description": "The attribute name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "subscriptionId", + "description": "Subscription identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "value", - "description": "The attribute value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSubscriptionProductRemove", + "description": "Remove products to an existing subscription", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPackagingNode", - "description": null, - "fields": [ - { - "name": "cost", - "description": "The packaging cost.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "The packaging description.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "subscriptionId", + "description": "Subscription identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "subscriptionProducts", + "description": "Products to be removed from an existing subscription.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "RemoveSubscriptionProductInput", + "ofType": null + } + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "message", - "description": "The message added to the packaging.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerSubscriptionUpdateStatus", + "description": "Allows a customer to change an existing subscription status.", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "status", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "Status", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "subscriptionId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "name", - "description": "The packaging name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerUpdate", + "description": "Updates a customer register.", + "args": [ + { + "name": "customerAccessToken", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderCustomizationNode", - "description": null, - "fields": [ - { - "name": "cost", - "description": "The customization cost.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Float", - "ofType": null + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CustomerUpdateInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "Customer", + "ofType": null }, - { - "name": "name", - "description": "The customization name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eventListAddProduct", + "description": "Adds products to the event list.", + "args": [ + { + "name": "eventListToken", + "description": "The event list token", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "products", + "description": "Products to be added", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "EventListAddProductInput", + "ofType": null + } + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "value", - "description": "The customization value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orderChangePayment", + "description": "Allows changing the payment method of a specific order", + "args": [ + { + "name": "checkoutId", + "description": "The checkout ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderTrackingNode", - "description": null, - "fields": [ - { - "name": "code", - "description": "The tracking code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "customerAccessToken", + "description": "The customer access token.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "url", - "description": "The URL for tracking.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "orderId", + "description": "The order ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderSellerNode", - "description": null, - "fields": [ - { - "name": "name", - "description": "The seller\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + { + "name": "paymentData", + "description": "Payment data.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutShippingDeadlineNode", - "description": null, - "fields": [ - { - "name": "deadline", - "description": "The shipping deadline", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "description", - "description": "The shipping description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "secondDescription", - "description": "The shipping second description", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partnerAccessTokenCreate", + "description": "Creates a new closed scope partner access token with an expiration time.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "PartnerAccessTokenInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "PartnerAccessToken", + "ofType": null }, - { - "name": "secondTitle", - "description": "The shipping second title", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productCounterOfferSubmit", + "description": "Submits a counteroffer for a product.", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CounterOfferInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "title", - "description": "The shipping title", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutProductAttributeNode", - "description": null, - "fields": [ - { - "name": "name", - "description": "The attribute name", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productFriendRecommend", + "description": "Mutation to recommend a product to a friend", + "args": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "FriendRecommendInput", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The attribute type", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", - "name": "Int", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null }, - { - "name": "value", - "description": "The attribute value", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "CEP", - "description": "Represents a CEP", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BannersConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productPriceAlert", + "description": "Add a price alert.", + "args": [ + { + "name": "input", + "description": null, + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "BannersEdge", + "kind": "INPUT_OBJECT", + "name": "AddPriceAlertInput", "ofType": null } - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Banner", + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "ProductPriceAlert", + "ofType": null }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BrandsConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productRestockAlert", + "description": "Creates an alert to notify when the product is back in stock.", + "args": [ + { + "name": "input", + "description": "Params to create an alert for product back in stock.", + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "BrandsEdge", + "kind": "INPUT_OBJECT", + "name": "RestockAlertInput", "ofType": null } - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Brand", + { + "name": "partnerAccessToken", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "RestockAlertNode", + "ofType": null }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sendGenericForm", + "description": "Send a generic form.", + "args": [ + { + "name": "body", + "description": null, + "type": { + "kind": "SCALAR", + "name": "Any", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "totalCount", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "file", + "description": null, + "type": { "kind": "SCALAR", - "name": "Int", + "name": "Upload", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CategoriesConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "OperationResult", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateAddress", + "description": "Change an existing address", + "args": [ + { + "name": "address", + "description": null, + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "CategoriesEdge", + "kind": "INPUT_OBJECT", + "name": "UpdateCustomerAddressInput", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Category", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ContentsConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "customerAccessToken", + "description": null, + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "ContentsEdge", + "kind": "SCALAR", + "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Content", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HotsitesConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + { + "name": "id", + "description": "The customer address unique identifier.", + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "HotsitesEdge", + "kind": "SCALAR", + "name": "ID", "ofType": null } - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Hotsite", + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PartnersConnection", - "description": "A connection to a list of items.", - "fields": [ - { - "name": "edges", - "description": "A list of edges.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { + "isDeprecated": true, + "deprecationReason": "Use the CustomerAddressUpdate mutation." + }, + { + "name": "wishlistAddProduct", + "description": "Adds a product to the customer's wishlist.", + "args": [ + { + "name": "customerAccessToken", + "description": "A customer's access token", + "type": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "PartnersEdge", + "kind": "SCALAR", + "name": "String", "ofType": null } - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "nodes", - "description": "A flattened list of the nodes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Partner", - "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "pageInfo", - "description": "Information to aid in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "PageInfo", - "ofType": null - } + { + "name": "productId", + "description": "ID of the product to be added to the customer's wishlist", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BannersEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Banner", + "name": "Product", "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wishlistRemoveProduct", + "description": "Removes a product from the customer's wishlist.", + "args": [ + { + "name": "customerAccessToken", + "description": "A customer's access token", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BrandsEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "productId", + "description": "ID of the product to be removed from the customer's wishlist", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "The google recaptcha token.", + "type": { "kind": "SCALAR", "name": "String", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Brand", + "name": "Product", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CategoriesEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INTERFACE", + "name": "Node", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": [ + { + "kind": "OBJECT", + "name": "Checkout", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Customer", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Hotsite", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SingleHotsite", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Brand", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProductOption", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Category", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Customization", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "SingleProduct", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "BuyList", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProductVariant", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "MenuGroup", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Product", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Partner", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Banner", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Content", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Attribute", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ProductAttribute", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "Menu", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "ShippingQuote", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "paymentMethod", + "ofType": null + }, + { + "kind": "OBJECT", + "name": "InformationGroupFieldNode", + "ofType": null + } + ] + }, + { + "kind": "OBJECT", + "name": "CheckoutShippingQuoteGroupNode", + "description": null, + "fields": [ + { + "name": "distributionCenter", + "description": "The distribution center.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "DistributionCenter", + "ofType": null }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The products related to the shipping quote group.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Category", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ContentsEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "name": "ShippingQuoteGroupProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedShipping", + "description": "Selected Shipping.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ShippingNode", + "ofType": null }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SelectedPaymentMethod", + "description": "The selected payment method details.", + "fields": [ + { + "name": "html", + "description": "The payment html.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The unique identifier for the selected payment method.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installments", + "description": "The list of installments associated with the selected payment method.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Content", + "name": "SelectedPaymentMethodInstallment", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "HotsitesEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentMethodId", + "description": "The payment Method Id.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "scripts", + "description": "Payment related scripts.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedInstallment", + "description": "The selected installment.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SelectedPaymentMethodInstallment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "suggestedCards", + "description": "The suggested cards.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "OBJECT", - "name": "Hotsite", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Partner", - "description": "Partners are used to assign specific products or price tables depending on its scope.", - "fields": [ - { - "name": "alias", - "description": "The partner alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "name": "SuggestedCard", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutAddress", + "description": "Represents an address node in the checkout.", + "fields": [ + { + "name": "addressNumber", + "description": "The street number of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "endDate", - "description": "The partner is valid until this date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "fullUrlLogo", - "description": "The full partner logo URL.", - "args": [ - { - "name": "height", - "description": "The height of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cep", + "description": "The ZIP code of the address.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "city", + "description": "The city of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "complement", + "description": "The additional address information.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "logoUrl", - "description": "The partner logo\u0027s URL.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "name", - "description": "The partner\u0027s name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "neighborhood", + "description": "The neighborhood of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "origin", - "description": "The partner\u0027s origin.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "receiverName", + "description": "Receiver's name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "referencePoint", + "description": "The reference point for the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "partnerAccessToken", - "description": "The partner\u0027s access token.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "street", + "description": "The street name of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutKit", + "description": null, + "fields": [ + { + "name": "ajustedPrice", + "description": "The price adjusted with promotions and other price changes", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "partnerId", - "description": "Partner unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "alias", + "description": "The kit alias", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "portfolioId", - "description": "Portfolio identifier assigned to this partner.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The kit URL image", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "priceTableId", - "description": "Price table identifier assigned to this partner.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kitGroupId", + "description": "The kit unique identifier", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "startDate", - "description": "The partner is valid from this date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kitId", + "description": "The kit identifier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } }, - { - "name": "type", - "description": "The type of scoped the partner is used.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The kit list price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The kit name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PartnersEdge", - "description": "An edge in a connection.", - "fields": [ - { - "name": "cursor", - "description": "A cursor for use in pagination.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null }, - { - "name": "node", - "description": "The item at the end of the edge.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Partner", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The kit price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "FilterPosition", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "VERTICAL", - "description": "Vertical filter position.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "HORIZONTAL", - "description": "Horizontal filter position.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BOTH", - "description": "Both filter position.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SearchFilter", - "description": "Aggregated filters of a list of products.", - "fields": [ - { - "name": "field", - "description": "The name of the field.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The products contained in this kit", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutProductNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The kit quantity", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "origin", - "description": "The origin of the field.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalAdjustedPrice", + "description": "The total price adjusted with promotions and other price changes", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "values", - "description": "List of the values of the field.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SearchFilterItem", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerInformationGroupFieldNode", - "description": null, - "fields": [ - { - "name": "name", - "description": "The field name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalListPrice", + "description": "The total list price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "order", - "description": "The field order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Metadata", + "description": "Some products can have metadata, like diferent types of custom information. A basic key value pair.", + "fields": [ + { + "name": "key", + "description": "Metadata key.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "required", - "description": "If the field is required.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "Metadata value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "DateTime", + "description": "The `DateTime` scalar represents an ISO-8601 compliant date time type.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderDelivery", + "description": "The delivery or store pickup details.", + "fields": [ + { + "name": "address", + "description": "The delivery or store pickup address.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutOrderAddress", + "ofType": null }, - { - "name": "value", - "description": "The field value.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cost", + "description": "The cost of delivery or pickup.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderProductAdjustment", - "description": "Represents an adjustment applied to a product in the checkout order.", - "fields": [ - { - "name": "additionalInformation", - "description": "Additional information about the adjustment.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryTime", + "description": "The estimated delivery or pickup time, in days.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryTimeInHours", + "description": "The estimated delivery or pickup time, in hours.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the recipient.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderPayment", + "description": "The checkout order payment.", + "fields": [ + { + "name": "card", + "description": "The card payment information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutOrderCardPayment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invoice", + "description": "The bank invoice payment information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutOrderInvoicePayment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the payment method.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pix", + "description": "The Pix payment information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutOrderPixPayment", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "OrderStatus", + "description": "Represents the status of an order.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PAID", + "description": "Order has been paid.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AWAITING_PAYMENT", + "description": "Order is awaiting payment.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELLED_TEMPORARILY_DENIED_CARD", + "description": "Order has been cancelled - Card Temporarily Denied.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELLED_DENIED_CARD", + "description": "Order has been cancelled - Card Denied.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELLED_FRAUD", + "description": "Order has been cancelled - Fraud.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELLED_SUSPECT_FRAUD", + "description": "Order has been cancelled - Suspected Fraud.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELLED_ORDER_CANCELLED", + "description": "Order has been cancelled.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELLED", + "description": "Order has been cancelled.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SENT", + "description": "Order has been sent.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AUTHORIZED", + "description": "Order has been authorized.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SENT_INVOICED", + "description": "Order has been sent - Invoiced.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RETURNED", + "description": "Order has been returned.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DOCUMENTS_FOR_PURCHASE", + "description": "Documents needed for purchase.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "APPROVED_ANALYSIS", + "description": "Order has been approved in analysis.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "RECEIVED_GIFT_CARD", + "description": "Order has been received - Gift Card.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SEPARATED", + "description": "Order has been separated.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ORDERED", + "description": "Order has been placed.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DELIVERED", + "description": "Order has been delivered.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AWAITING_PAYMENT_CHANGE", + "description": "Order is awaiting change of payment method.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CHECKED_ORDER", + "description": "Order has been checked.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PICK_UP_IN_STORE", + "description": "Available for pick-up in store.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "DENIED_PAYMENT", + "description": "Payment denied, but the order has not been cancelled.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CREDITED", + "description": "Order has been credited.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderProduct", + "description": "Represents a node in the checkout order products.", + "fields": [ + { + "name": "adjustments", + "description": "The list of adjustments applied to the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutOrderProductAdjustment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "attributes", + "description": "The list of attributes of the product.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutOrderProductAttribute", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The image URL of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The name of the adjustment.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "The ID of the product variant.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "type", - "description": "The type of the adjustment.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The quantity of the product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The value of the adjustment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderProductAttribute", - "description": "Represents an attribute of a product.", - "fields": [ - { - "name": "name", - "description": "The name of the attribute.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "unitValue", + "description": "The unit value of the product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The value of the attribute.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderPixPayment", - "description": "This represents a Pix payment node in the checkout order.", - "fields": [ - { - "name": "qrCode", - "description": "The QR code.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderAdjustment", + "description": "Represents an adjustment applied to checkout.", + "fields": [ + { + "name": "name", + "description": "The name of the adjustment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type of the adjustment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the adjustment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "qrCodeExpirationDate", - "description": "The expiration date of the QR code.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeliveryScheduleDetail", + "description": "The delivery schedule detail.", + "fields": [ + { + "name": "date", + "description": "The date of the delivery schedule.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endDateTime", + "description": "The end date and time of the delivery schedule.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endTime", + "description": "The end time of the delivery schedule.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "qrCodeUrl", - "description": "The image URL of the QR code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderInvoicePayment", - "description": "The invoice payment information.", - "fields": [ - { - "name": "digitableLine", - "description": "The digitable line.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startDateTime", + "description": "The start date and time of the delivery schedule.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startTime", + "description": "The start time of the delivery schedule.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "paymentLink", - "description": "The payment link.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CheckoutOrderAddress", - "description": "The delivery or store Pickup Address.", - "fields": [ - { - "name": "address", - "description": "The street address.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "Float", + "description": "The `Float` scalar type represents signed double-precision fractional values as specified by [IEEE 754](http://en.wikipedia.org/wiki/IEEE_floating_point).", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DistributionCenter", + "description": "A distribution center.", + "fields": [ + { + "name": "id", + "description": "The distribution center unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sellerName", + "description": "The distribution center seller name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ShippingQuoteGroupProduct", + "description": "The product informations related to the shipping.", + "fields": [ + { + "name": "productVariantId", + "description": "The product unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "cep", - "description": "The ZIP code.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "GroupShippingQuote", + "description": "The shipping quotes for group.", + "fields": [ + { + "name": "deadline", + "description": "The shipping deadline.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineInHours", + "description": "The shipping deadline, in hours.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The shipping name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingQuoteId", + "description": "The shipping quote unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The shipping type.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "city", - "description": "The city.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The shipping value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Float", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerAddressNode", + "description": null, + "fields": [ + { + "name": "address", + "description": "Address street.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "address2", + "description": "Address street 2.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addressDetails", + "description": "Address details.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addressNumber", + "description": "Address number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cep", + "description": "zip code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "city", + "description": "address city.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "country", + "description": "Country.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The email of the customer address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "complement", - "description": "Additional information or details about the address.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the customer address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": true, + "deprecationReason": "Use the 'receiverName' field to get the receiver name." + }, + { + "name": "neighborhood", + "description": "Address neighborhood.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "phone", + "description": "The phone of the customer address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "receiverName", + "description": "The name of the customer address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "referencePoint", + "description": "Address reference point.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "State.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "street", + "description": "Address street.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": true, + "deprecationReason": "Use the 'address' field to get the address." + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Partner", + "description": "Partners are used to assign specific products or price tables depending on its scope.", + "fields": [ + { + "name": "alias", + "description": "The partner alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endDate", + "description": "The partner is valid until this date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "isPickupStore", - "description": "Indicates whether the order is for store pickup.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullUrlLogo", + "description": "The full partner logo URL.", + "args": [ + { + "name": "height", + "description": "The height of the image.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null + { + "name": "width", + "description": "The width of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoUrl", + "description": "The partner logo's URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The partner's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "origin", + "description": "The partner's origin.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partnerAccessToken", + "description": "The partner's access token.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partnerId", + "description": "Partner unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "neighborhood", - "description": "The neighborhood.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "portfolioId", + "description": "Portfolio identifier assigned to this partner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "pickupStoreText", - "description": ".", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "priceTableId", + "description": "Price table identifier assigned to this partner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SelectedPaymentMethodInstallment", - "description": "Details of an installment of the selected payment method.", - "fields": [ - { - "name": "adjustment", - "description": "The adjustment value applied to the installment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "number", - "description": "The installment number.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "total", - "description": "The total value of the installment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The individual value of each installment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "SearchRecordInput", - "description": "The information to be saved for reports.", - "fields": null, - "inputFields": [ - { - "name": "operation", - "description": "The search operation (And, Or)", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "startDate", + "description": "The partner is valid from this date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type of scoped the partner is used.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "page", - "description": "The current page", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "wishlist", + "description": null, + "fields": [ + { + "name": "products", + "description": "Wishlist products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Product", + "ofType": null + } }, - { - "name": "pageSize", - "description": "How many products show in page", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerInformationGroupNode", + "description": null, + "fields": [ + { + "name": "exibitionName", + "description": "The group exibition name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fields", + "description": "The group fields.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CustomerInformationGroupFieldNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The group name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "pageUrl", - "description": "The client search page url", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerCheckingAccountHistoryNode", + "description": null, + "fields": [ + { + "name": "date", + "description": "Customer's checking account history date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "historic", + "description": "Description of the customer's checking account history.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "query", - "description": "The user search query", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "Type of customer's checking account history.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "TypeCheckingAccount", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "Value of customer's checking account history.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "totalResults", - "description": "How many products the search returned", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SearchRecord", - "description": "The response data", - "fields": [ - { - "name": "date", - "description": "The date time of the processed request", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderDigitalProductNode", + "description": null, + "fields": [ + { + "name": "content", + "description": "The content of the digital product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "isSuccess", - "description": "If the record was successful", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "date", + "description": "The order date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The product name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "query", - "description": "The searched query", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "orderId", + "description": "Order unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "RestockAlertInput", - "description": "Back in stock registration input parameters.", - "fields": null, - "inputFields": [ - { - "name": "email", - "description": "Email to be notified.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + } }, - { - "name": "name", - "description": "Name of the person to be notified.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "salePrice", + "description": "The product sale price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "productVariantId", - "description": "The product variant id of the product to be notified.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "RestockAlertNode", - "description": null, - "fields": [ - { - "name": "email", - "description": "Email to be notified.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerOrdersStatistics", + "description": null, + "fields": [ + { + "name": "productsQuantity", + "description": "The number of products the customer made from the number of orders.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": "Name of the person to be notified.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The number of orders the customer made.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productVariantId", - "description": "The product variant id.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderKitNode", + "description": null, + "fields": [ + { + "name": "alias", + "description": "The kit alias", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "requestDate", - "description": "Date the alert was requested.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "AddPriceAlertInput", - "description": "Price alert input parameters.", - "fields": null, - "inputFields": [ - { - "name": "email", - "description": "The alerted\u0027s email.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The kit URL image", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The alerted\u0027s name.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kitGroupId", + "description": "The kit unique identifier", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productVariantId", - "description": "The product variant id to create the price alert.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kitId", + "description": "The kit identifier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The kit list price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The kit name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "targetPrice", - "description": "The target price to alert.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ProductPriceAlert", - "description": "A product price alert.", - "fields": [ - { - "name": "email", - "description": "The alerted\u0027s email.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The kit price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The products contained in this kit", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderProductNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The kit quantity", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalListPrice", + "description": "The total list price", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderNoteNode", + "description": null, + "fields": [ + { + "name": "date", + "description": "Date the note was added to the order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "note", + "description": "The note added to the order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "user", + "description": "The user who added the note to the order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderDeliveryAddressNode", + "description": null, + "fields": [ + { + "name": "addressNumber", + "description": "The street number of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cep", + "description": "The ZIP code of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "city", + "description": "The city of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "complement", + "description": "The additional address information.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "country", + "description": "The country of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "neighboorhood", + "description": "The neighborhood of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "receiverName", + "description": "The receiver's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "referencePoint", + "description": "The reference point for the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "The state of the address, abbreviated.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "street", + "description": "The street name of the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderShippingNode", + "description": null, + "fields": [ + { + "name": "deadline", + "description": "Limit date of delivery, in days.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineInHours", + "description": "Limit date of delivery, in hours.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineText", + "description": "Deadline text message.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "distributionCenterId", + "description": "Distribution center unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickUpId", + "description": "The order pick up unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The products belonging to the order.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderShippingProductNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "promotion", + "description": "Amount discounted from shipping costs, if any.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "refConnector", + "description": "Shipping company connector identifier code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "scheduleFrom", + "description": "Start date of shipping schedule.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "scheduleUntil", + "description": "Limit date of shipping schedule.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingFee", + "description": "Shipping fee value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingName", + "description": "The shipping name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingTableId", + "description": "Shipping rate table unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "total", + "description": "The total value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "volume", + "description": "Order package size.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "weight", + "description": "The order weight, in grams.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderInvoiceNode", + "description": null, + "fields": [ + { + "name": "accessKey", + "description": "The invoice access key.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "invoiceCode", + "description": "The invoice identifier code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "serialDigit", + "description": "The invoice serial digit.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The invoice URL.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderPaymentNode", + "description": null, + "fields": [ + { + "name": "additionalInfo", + "description": "Additional information for the payment.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "OrderPaymentAdditionalInfoNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "boleto", + "description": "The boleto information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrderPaymentBoletoNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "card", + "description": "The card information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrderPaymentCardNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discount", + "description": "Order discounted value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fees", + "description": "Order additional fees value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installmentValue", + "description": "Value per installment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installments", + "description": "Number of installments.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "Message about payment transaction.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentOption", + "description": "The chosen payment option for the order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pix", + "description": "The pix information.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "OrderPaymentPixNode", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "Current payment status.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "total", + "description": "Order total value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderTrackingNode", + "description": null, + "fields": [ + { + "name": "code", + "description": "The tracking code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The URL for tracking.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderStatusNode", + "description": null, + "fields": [ + { + "name": "changeDate", + "description": "The date when status has changed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "Order status.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The alerted\u0027s name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "statusId", + "description": "Status unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "priceAlertId", - "description": "The price alert ID.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderSubscriptionNode", + "description": null, + "fields": [ + { + "name": "recurringDays", + "description": "The length of the order signature period.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "productVariantId", - "description": "The product variant ID.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recurringName", + "description": "The order subscription period type.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "requestDate", - "description": "The request date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroupId", + "description": "The order signing group identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "targetPrice", - "description": "The target price.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ReviewCreateInput", - "description": "Review input parameters.", - "fields": null, - "inputFields": [ - { - "name": "email", - "description": "The reviewer\u0027s email.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionId", + "description": "subscription unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "name", - "description": "The reviewer\u0027s name.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionOrderId", + "description": "The subscription's order identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "productVariantId", - "description": "The product variant id to add the review to.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The subscription fee for the order.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "rating", - "description": "The review rating.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerSubscriptionPayment", + "description": null, + "fields": [ + { + "name": "card", + "description": "The details of the payment card associated with the subscription.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerSubscriptionPaymentCard", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type of payment for the subscription.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "recaptchaToken", - "description": "The google recaptcha token.", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerSubscriptionRecurring", + "description": null, + "fields": [ + { + "name": "days", + "description": "The number of days between recurring payments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null - }, - { - "name": "review", - "description": "The review content.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "NewsletterInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "informationGroupValues", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "InformationGroupValueInput", - "ofType": null - } - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The description of the recurring subscription.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the recurring subscription.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "recaptchaToken", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recurringId", + "description": "The recurring subscription id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "NewsletterNode", - "description": null, - "fields": [ - { - "name": "createDate", - "description": "Newsletter creation date.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "email", - "description": "The newsletter receiver email.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removed", + "description": "Indicates whether the recurring subscription is removed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": "The newsletter receiver name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerSubscriptionProduct", + "description": null, + "fields": [ + { + "name": "productVariantId", + "description": "The id of the product variant associated with the subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "updateDate", - "description": "Newsletter update date.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The quantity of the product variant in the subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CustomerSimpleCreateInputGraphInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "birthDate", - "description": "The date of birth of the customer.", - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "removed", + "description": "Indicates whether the product variant is removed from the subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "cnpj", - "description": "The Brazilian tax identification number for corporations.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionProductId", + "description": "The id of the subscription product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "corporateName", - "description": "The legal name of the corporate customer.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The monetary value of the product variant in the subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HotsiteSorting", + "description": null, + "fields": [ + { + "name": "direction", + "description": null, + "args": [], + "type": { + "kind": "ENUM", + "name": "SortDirection", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "field", + "description": null, + "args": [], + "type": { + "kind": "ENUM", + "name": "ProductSortKeys", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "HotsiteSubtype", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "CATEGORY", + "description": "Hotsite created from a category.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BRAND", + "description": "Hotsite created from a brand.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PORTFOLIO", + "description": "Hotsite created from a portfolio.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BUY_LIST", + "description": "Hotsite created from a buy list (lista de compra).", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Banner", + "description": "A banner is usually an image used to show sales, highlight products, announcements or to redirect to another page or hotsite on click.", + "fields": [ + { + "name": "altText", + "description": "Banner's alternative text.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "cpf", - "description": "The Brazilian tax identification number for individuals.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bannerId", + "description": "Banner unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bannerName", + "description": "Banner's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "customerType", - "description": "Indicates if it is a natural person or company profile.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "EntityType", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "bannerUrl", + "description": "URL where the banner is stored.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creationDate", + "description": "The date the banner was created.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "email", - "description": "The email of the customer.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnAllPages", + "description": "Field to check if the banner should be displayed on all pages.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "fullName", - "description": "The full name of the customer.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnCategories", + "description": "Field to check if the banner should be displayed on category pages.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "isStateRegistrationExempt", - "description": "Indicates if the customer is state registration exempt.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnSearches", + "description": "Field to check if the banner should be displayed on search pages.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "primaryPhoneAreaCode", - "description": "The area code for the customer\u0027s primary phone number.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayOnWebsite", + "description": "Field to check if the banner should be displayed on the website.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "primaryPhoneNumber", - "description": "The customer\u0027s primary phone number.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayToPartners", + "description": "Field to check if the banner should be displayed to partners.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "height", + "description": "The banner's height in px.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "stateRegistration", - "description": "The state registration number for businesses.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "openNewTab", + "description": "Field to check if the banner URL should open in another tab on click.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SimpleLogin", - "description": null, - "fields": [ - { - "name": "customerAccessToken", - "description": "The customer access token", - "args": [], - "type": { - "kind": "OBJECT", - "name": "CustomerAccessToken", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "The displaying order of the banner.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The displaying position of the banner.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "question", - "description": "The simple login question to answer", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Question", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "searchTerms", + "description": "A list of terms to display the banner on search.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The banner's title.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlOnClick", + "description": "URL to be redirected on click.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "width", + "description": "The banner's width in px.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Content", + "description": "Contents are used to show things to the user.", + "fields": [ + { + "name": "content", + "description": "The content in html to be displayed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "contentId", + "description": "Content unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "creationDate", + "description": "The date the content was created.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "type", - "description": "The simple login type", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "SimpleLoginType", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CustomerEmailChangeInput", - "description": "The input to change the user email.", - "fields": null, - "inputFields": [ - { - "name": "newEmail", - "description": "The new email.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CustomerPasswordChangeInputGraphInput", - "description": "The input to change the user password.", - "fields": null, - "inputFields": [ - { - "name": "currentPassword", - "description": "The current password.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "height", + "description": "The content's height in px.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The content's position.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "searchTerms", + "description": "A list of terms to display the content on search.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The content's title.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "width", + "description": "The content's width in px.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SEO", + "description": "Entity SEO information.", + "fields": [ + { + "name": "content", + "description": "Content of SEO.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "httpEquiv", + "description": "Equivalent SEO type for HTTP.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Name of SEO.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "newPassword", - "description": "The new password.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "scheme", + "description": "Scheme for SEO.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "Type of SEO.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Breadcrumb", + "description": "Informations about breadcrumb.", + "fields": [ + { + "name": "link", + "description": "Breadcrumb link.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": "Breadcrumb text.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductAggregations", + "description": null, + "fields": [ + { + "name": "filters", + "description": "List of product filters which can be used to filter subsequent queries.", + "args": [ + { + "name": "position", + "description": "The filter position.", + "type": { + "kind": "ENUM", + "name": "FilterPosition", "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CustomerUpdateInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "birthDate", - "description": "The date of birth of the customer.", - "type": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SearchFilter", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maximumPrice", + "description": "Minimum price of the products.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "cnpj", - "description": "The Brazilian tax identification number for corporations.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimumPrice", + "description": "Maximum price of the products.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "priceRanges", + "description": "List of price ranges for the selected products.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PriceRange", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "forbiddenTerm", + "description": "Informations about a forbidden search term.", + "fields": [ + { + "name": "suggested", + "description": "The suggested search term instead.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "corporateName", - "description": "The legal name of the corporate customer.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": "The text to display about the term.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "cpf", - "description": "The Brazilian tax identification number for individuals.", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Attribute", + "description": "Attributes available for the variant products from the given productId.", + "fields": [ + { + "name": "attributeId", + "description": "The id of the attribute.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayType", + "description": "The display type of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "customerType", - "description": "Indicates if it is a natural person or company profile.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "EntityType", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "fullName", - "description": "The full name of the customer.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "gender", - "description": "The gender of the customer.", - "type": { - "kind": "ENUM", - "name": "Gender", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "primaryPhoneAreaCode", - "description": "The area code for the customer\u0027s primary phone number.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "The values of the attribute.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AttributeValue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Review", + "description": "A product review written by a customer.", + "fields": [ + { + "name": "customer", + "description": "The reviewer name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "primaryPhoneNumber", - "description": "The customer\u0027s primary phone number.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The reviewer e-mail.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "rg", - "description": "The Brazilian register identification number for individuals.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "rating", + "description": "The review rating.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "review", + "description": "The review content.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "secondaryPhoneAreaCode", - "description": "The area code for the customer\u0027s secondary phone number.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "reviewDate", + "description": "The review date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "secondaryPhoneNumber", - "description": "The customer\u0027s secondary phone number.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BuyTogetherGroup", + "description": "BuyTogetherGroups informations.", + "fields": [ + { + "name": "name", + "description": "BuyTogether name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "stateRegistration", - "description": "The state registration number for businesses.", - "type": { - "kind": "SCALAR", - "name": "String", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "BuyTogether products", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SingleProduct", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CustomerCreateInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "address", - "description": "The street address for the registered address.", - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "BuyTogether type", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "BuyTogetherType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeSelection", + "description": "Attributes available for the variant products from the given productId.", + "fields": [ + { + "name": "canBeMatrix", + "description": "Check if the current product attributes can be rendered as a matrix.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "candidateVariant", + "description": "The candidate variant given the current input filters. Variant may be from brother product Id.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductVariant", + "ofType": null }, - { - "name": "address2", - "description": "The street address for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "matrix", + "description": "Informations about the attribute matrix.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "AttributeMatrix", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selectedVariant", + "description": "The selected variant given the current input filters. Variant may be from brother product Id.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ProductVariant", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selections", + "description": "Attributes available for the variant products from the given productId.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AttributeSelectionOption", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "DeadlineAlert", + "description": "Deadline alert informations.", + "fields": [ + { + "name": "deadline", + "description": "Deadline alert time", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "Deadline alert description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondDeadline", + "description": "Second deadline alert time", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondDescription", + "description": "Second deadline alert description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondTitle", + "description": "Second deadline alert title", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "Deadline alert title", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Image", + "description": "Informations about an image of a product.", + "fields": [ + { + "name": "fileName", + "description": "The name of the image file.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "mini", + "description": "Check if the image is used for the product main image.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "addressComplement", - "description": "Any additional information related to the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "Numeric order the image should be displayed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "addressNumber", - "description": "The building number for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "print", + "description": "Check if the image is used for the product prints only.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The url to retrieve the image", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Promotion", + "description": "Information about promotions of a product.", + "fields": [ + { + "name": "content", + "description": "The promotion html content.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "disclosureType", + "description": "Where the promotion is shown (spot, product page, etc..).", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "birthDate", - "description": "The date of birth of the customer.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "endDate", + "description": "The end date for the promotion.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "DateTime", "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullStampUrl", + "description": "The stamp URL of the promotion.", + "args": [ + { + "name": "height", + "description": "The height of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "defaultValue": null + { + "name": "width", + "description": "The width of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "cep", - "description": "The CEP for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The promotion id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stamp", + "description": "The stamp of the promotion.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The promotion title.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductBrand", + "description": null, + "fields": [ + { + "name": "alias", + "description": "The hotsite url alias fot this brand.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullUrlLogo", + "description": "The full brand logo URL.", + "args": [ + { + "name": "height", + "description": "The height of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "defaultValue": null + { + "name": "width", + "description": "The width of the image.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "city", - "description": "The city for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The brand id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoUrl", + "description": "The url that contains the brand logo image.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the brand.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Prices", + "description": "The prices of the product.", + "fields": [ + { + "name": "bestInstallment", + "description": "The best installment option available.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "BestInstallment", + "ofType": null }, - { - "name": "cnpj", - "description": "The Brazilian tax identification number for corporations.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discountPercentage", + "description": "The amount of discount in percentage.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "corporateName", - "description": "The legal name of the corporate customer.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "discounted", + "description": "Wether the current price is discounted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installmentPlans", + "description": "List of the possibles installment plans.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "InstallmentPlan", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The listed regular price of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "country", - "description": "The country for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "multiplicationFactor", + "description": "The multiplication factor used for items that are sold by quantity.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Float", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "cpf", - "description": "The Brazilian tax identification number for individuals.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The current working price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null - }, - { - "name": "customerType", - "description": "Indicates if it is a natural person or company profile.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "EntityType", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "email", - "description": "The email of the customer.", - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "priceTables", + "description": "List of the product different price tables. \n\n Only returned when using the partnerAccessToken or public price tables.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PriceTable", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "wholesalePrices", + "description": "Lists the different price options when buying the item over the given quantity.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "WholesalePrices", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductSubscription", + "description": null, + "fields": [ + { + "name": "discount", + "description": "The amount of discount if this product is sold as a subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The price of the product when sold as a subscription.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "fullName", - "description": "The full name of the customer.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionOnly", + "description": "Wether this product is sold only as a subscrition.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "gender", - "description": "The gender of the customer.", - "type": { - "kind": "ENUM", - "name": "Gender", + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductAttribute", + "description": "The attributes of the product.", + "fields": [ + { + "name": "attributeId", + "description": "The id of the attribute.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayType", + "description": "The display type of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "isStateRegistrationExempt", - "description": "Indicates if the customer is state registration exempt.", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Stock", + "description": "Information about a product stock in a particular distribution center.", + "fields": [ + { + "name": "id", + "description": "The id of the distribution center.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "neighborhood", - "description": "The neighborhood for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "items", + "description": "The number of physical items in stock at this DC.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the distribution center.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "newsletter", - "description": "Indicates if the customer has subscribed to the newsletter.", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductCategory", + "description": "Information about the category of a product.", + "fields": [ + { + "name": "active", + "description": "Wether the category is currently active.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "googleCategories", + "description": "The categories in google format.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "password", - "description": "The password for the customer\u0027s account.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "hierarchy", + "description": "The category hierarchy.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "passwordConfirmation", - "description": "The password confirmation for the customer\u0027s account.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The id of the category.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "primaryPhoneAreaCode", - "description": "The area code for the customer\u0027s primary phone number.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "main", + "description": "Wether this category is the main category for this product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The category name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "primaryPhoneNumber", - "description": "The customer\u0027s primary phone number.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The category hotsite url alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Information", + "description": "Information registred to the product.", + "fields": [ + { + "name": "id", + "description": "The information id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The information title.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The information type.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The information value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SubscriptionGroup", + "description": null, + "fields": [ + { + "name": "recurringTypes", + "description": "The recurring types for this subscription group.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SubscriptionRecurringType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "status", + "description": "The status name of the group.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "receiverName", - "description": "The name of the receiver for the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "statusId", + "description": "The status id of the group.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "reference", - "description": "A reference point or description to help locate the registered address.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroupId", + "description": "The subscription group id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "reseller", - "description": "Indicates if the customer is a reseller.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionOnly", + "description": "Wether the product is only avaible for subscription.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "secondaryPhoneAreaCode", - "description": "The area code for the customer\u0027s secondary phone number.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SimilarProduct", + "description": "Information about a similar product.", + "fields": [ + { + "name": "alias", + "description": "The url alias of this similar product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "secondaryPhoneNumber", - "description": "The customer\u0027s secondary phone number.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "image", + "description": "The file name of the similar product image.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The URL of the similar product image.", + "args": [ + { + "name": "h", + "description": "The height of the image the url will return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null }, - "defaultValue": null + { + "name": "w", + "description": "The width of the image the url will return.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "state", - "description": "The state for the registered address.", - "type": { - "kind": "SCALAR", - "name": "String", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the similar product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BuyBox", + "description": "BuyBox informations.", + "fields": [ + { + "name": "installmentPlans", + "description": "List of the possibles installment plans.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "InstallmentPlan", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maximumPrice", + "description": "Maximum price among sellers.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "minimumPrice", + "description": "Minimum price among sellers.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantityOffers", + "description": "Quantity of offers.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sellers", + "description": "List of sellers.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Seller", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Seller", + "description": "Seller informations.", + "fields": [ + { + "name": "name", + "description": "Seller name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "stateRegistration", - "description": "The state registration number for businesses.", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BuyListProduct", + "description": "Contains the id and quantity of a product in the buy list.", + "fields": [ + { + "name": "includeSameParent", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "PartnerAccessTokenInput", - "description": "The input to authenticate closed scope partners.", - "fields": null, - "inputFields": [ - { - "name": "password", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "username", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PartnerAccessToken", - "description": null, - "fields": [ - { - "name": "token", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productId", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "validUntil", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CustomerAccessTokenInput", - "description": "The input to authenticate a user.", - "fields": null, - "inputFields": [ - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + } }, - { - "name": "password", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "CustomerAccessToken", - "description": null, - "fields": [ - { - "name": "isMaster", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SellerOffer", + "description": "The seller's product offer", + "fields": [ + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "prices", + "description": "The product prices.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "SellerPrices", + "ofType": null }, - { - "name": "token", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stock", + "description": "The stock of the product variant.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "type", - "description": "The user login type", - "args": [], - "type": { - "kind": "ENUM", - "name": "LoginType", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PhysicalStore", + "description": "Informations about the physical store.", + "fields": [ + { + "name": "additionalText", + "description": "Additional text.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "validUntil", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OperationResult", - "description": "Result of the operation.", - "fields": [ - { - "name": "isSuccess", - "description": "If the operation is a success.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CreateCustomerAddressInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "addressDetails", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "address", + "description": "Physical store address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addressDetails", + "description": "Physical store address details.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "addressNumber", + "description": "Physical store address number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "city", + "description": "Physical store address city.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "country", + "description": "Physical store country.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "ddd", + "description": "Physical store DDD.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "addressNumber", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliveryDeadline", + "description": "Delivery deadline.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "Physical store email.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "cep", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "CEP", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "latitude", + "description": "Physical store latitude.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "city", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "longitude", + "description": "Physical store longitude.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "country", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "CountryCode", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Physical store name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "email", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "EmailAddress", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "neighborhood", + "description": "Physical store address neighborhood.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "phoneNumber", + "description": "Physical store phone number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "neighborhood", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "physicalStoreId", + "description": "Physical store ID.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, - { - "name": "phone", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickup", + "description": "If the physical store allows pickup.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } }, - { - "name": "referencePoint", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupDeadline", + "description": "Pickup deadline.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Physical store state.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "state", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "zipCode", + "description": "Physical store zip code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Menu", + "description": "Informations about menu items.", + "fields": [ + { + "name": "cssClass", + "description": "Menu css class to apply.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fullImageUrl", + "description": "The full image URL.", + "args": [ + { + "name": "height", + "description": "The height of the image.", + "type": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "defaultValue": null - }, - { - "name": "street", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "width", + "description": "The width of the image.", + "type": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "UpdateCustomerAddressInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "addressDetails", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "addressNumber", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "cep", - "description": null, - "type": { - "kind": "SCALAR", - "name": "CEP", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "Menu image url address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "city", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "level", + "description": "Menu hierarchy level.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "link", + "description": "Menu link address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "country", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "menuGroupId", + "description": "Menu group identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "CountryCode", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "email", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "menuId", + "description": "Menu identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "EmailAddress", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "name", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Menu name.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "neighborhood", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "openNewTab", + "description": "Menu hierarchy level.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "phone", - "description": null, - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "Menu position order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "parentMenuId", + "description": "Parent menu identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "referencePoint", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "text", + "description": "Menu extra text.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "state", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderAdjustNode", + "description": null, + "fields": [ + { + "name": "name", + "description": "The adjust name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "street", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CheckoutMetadataInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "key", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "note", + "description": "Note about the adjust.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "value", - "description": null, - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PriceRange", - "description": "Range of prices for this product.", - "fields": [ - { - "name": "quantity", - "description": "The quantity of products in this range.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "Type of adjust.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "range", - "description": "The price range.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "InStorePickupAdditionalInformationInput", - "description": "The additional information about in-store pickup", - "fields": null, - "inputFields": [ - { - "name": "document", - "description": "The document", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "Amount to be adjusted.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderAttributeNode", + "description": null, + "fields": [ + { + "name": "name", + "description": "The attribute name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The attribute value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The name", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderPackagingNode", + "description": null, + "fields": [ + { + "name": "cost", + "description": "The packaging cost.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "DeliveryScheduleInput", - "description": "Input for delivery scheduling.", - "fields": null, - "inputFields": [ - { - "name": "date", - "description": "The date.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The packaging description.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "periodId", - "description": "The period ID.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CheckoutProductInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "id", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "message", + "description": "The message added to the packaging.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "products", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutProductItemInput", - "ofType": null - } - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CheckoutProductItemInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "customization", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutCustomizationInput", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The packaging name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "metadata", - "description": null, - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "INPUT_OBJECT", - "name": "CheckoutMetadataInput", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderCustomizationNode", + "description": null, + "fields": [ + { + "name": "cost", + "description": "The customization cost.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Float", + "ofType": null }, - { - "name": "productVariantId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The customization name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "quantity", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The customization value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "subscription", - "description": null, - "type": { - "kind": "INPUT_OBJECT", - "name": "CheckoutSubscriptionInput", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Uri", - "description": "Node of URI Kind.", - "fields": [ - { - "name": "hotsiteSubtype", - "description": "The origin of the hotsite.", - "args": [], - "type": { - "kind": "ENUM", - "name": "HotsiteSubtype", + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderSellerNode", + "description": null, + "fields": [ + { + "name": "name", + "description": "The seller's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutShippingDeadlineNode", + "description": null, + "fields": [ + { + "name": "deadline", + "description": "The shipping deadline", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "description", + "description": "The shipping description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "kind", - "description": "Path kind.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "UriKind", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondDescription", + "description": "The shipping second description", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "partnerSubtype", - "description": "The partner subtype.", - "args": [], - "type": { - "kind": "ENUM", - "name": "PartnerSubtype", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "secondTitle", + "description": "The shipping second title", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productAlias", - "description": "Product alias.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "title", + "description": "The shipping title", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productCategoriesIds", - "description": "Product categories IDs.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductAttributeNode", + "description": null, + "fields": [ + { + "name": "name", + "description": "The attribute name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "redirectCode", - "description": "Redirect status code.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The attribute type", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The attribute value", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "redirectUrl", - "description": "Url to redirect.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ShopSetting", - "description": "Store setting.", - "fields": [ - { - "name": "name", - "description": "Setting name", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductSubscription", + "description": "Information for the subscription of a product in checkout.", + "fields": [ + { + "name": "availableSubscriptions", + "description": "The available subscriptions.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutProductSubscriptionItemNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selected", + "description": "The selected subscription.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CheckoutProductSubscriptionItemNode", + "ofType": null }, - { - "name": "value", - "description": "Setting value", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ShippingQuote", - "description": "A shipping quote.", - "fields": [ - { - "name": "deadline", - "description": "The shipping deadline.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductAdjustmentNode", + "description": null, + "fields": [ + { + "name": "observation", + "description": "The observation referent adjustment in Product", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "deliverySchedules", - "description": "The available time slots for scheduling the delivery of the shipping quote.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "deliverySchedule", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type that was applied in product adjustment", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value that was applied to the product adjustment", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": "The shipping name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductSellerNode", + "description": null, + "fields": [ + { + "name": "distributionCenterId", + "description": "The distribution center ID.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "products", - "description": "The products related to the shipping.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ShippingProduct", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sellerName", + "description": "The seller name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductCustomizationNode", + "description": null, + "fields": [ + { + "name": "availableCustomizations", + "description": "The available product customizations.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Customization", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The product customization unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null }, - { - "name": "shippingQuoteId", - "description": "The shipping quote unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "The product customization values.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "CheckoutProductCustomizationValueNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "CEP", + "description": "Represents a CEP", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BannersConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Uuid", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "type", - "description": "The shipping type.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", + "ofType": { + "kind": "OBJECT", + "name": "BannersEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Banner", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The shipping value.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BrandsConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Float", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", - "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Operation", - "description": "Types of operations to perform between query terms.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "AND", - "description": "Performs AND operation between query terms.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "OR", - "description": "Performs OR operation between query terms.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ScriptPageType", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ALL", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "HOME", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SEARCH", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CATEGORY", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BRAND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PRODUCT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ScriptPosition", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "HEADER_START", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "HEADER_END", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BODY_START", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BODY_END", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FOOTER_START", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FOOTER_END", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Script", - "description": "Returns the scripts registered in the script manager.", - "fields": [ - { - "name": "content", - "description": "The script content.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", + "kind": "OBJECT", + "name": "BrandsEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Brand", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "name", - "description": "The script name.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "pageType", - "description": "The script page type.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CategoriesConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "ENUM", - "name": "ScriptPageType", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "position", - "description": "The script position.", - "args": [], - "type": { + "kind": "OBJECT", + "name": "CategoriesEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Category", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContentsConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "ENUM", - "name": "ScriptPosition", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "priority", - "description": "The script priority.", - "args": [], - "type": { + "kind": "OBJECT", + "name": "ContentsEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Content", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HotsitesConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CalculatePricesProductsInput", - "description": "The products to calculate prices.", - "fields": null, - "inputFields": [ - { - "name": "productVariantId", - "description": null, - "type": { + "kind": "OBJECT", + "name": "HotsitesEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Hotsite", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PartnersConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - }, - { - "name": "quantity", - "description": null, - "type": { + "kind": "OBJECT", + "name": "PartnersEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Partner", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SellersConnection", + "description": "A connection to a list of items.", + "fields": [ + { + "name": "edges", + "description": "A list of edges.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ProductRecommendationAlgorithm", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "DEFAULT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "ProductExplicitFiltersInput", - "description": "Filter product results based on giving attributes.", - "fields": null, - "inputFields": [ - { - "name": "attributes", - "description": "The set of attributes do filter.", - "type": { - "kind": "INPUT_OBJECT", - "name": "AttributeInput", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "available", - "description": "Choose if you want to retrieve only the available products in stock.", - "type": { + "kind": "OBJECT", + "name": "SellersEdge", + "ofType": null + } + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "nodes", + "description": "A flattened list of the nodes.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ResellerNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageInfo", + "description": "Information to aid in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "PageInfo", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "totalCount", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - }, - "defaultValue": null - }, - { - "name": "brandId", - "description": "The set of brand IDs which the result item brand ID must be included in.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + } }, - { - "name": "categoryId", - "description": "The set of category IDs which the result item category ID must be included in.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BannersEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Banner", + "ofType": null }, - { - "name": "ean", - "description": "The set of EANs which the result item EAN must be included.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BrandsEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Brand", + "ofType": null }, - { - "name": "hasImages", - "description": "Retrieve the product variant only if it contains images.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CategoriesEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Category", + "ofType": null }, - { - "name": "mainVariant", - "description": "Retrieve the product variant only if it is the main product variant.", - "type": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ContentsEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Content", + "ofType": null }, - { - "name": "prices", - "description": "The set of prices to filter.", - "type": { - "kind": "INPUT_OBJECT", - "name": "PricesInput", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "HotsitesEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Hotsite", + "ofType": null }, - { - "name": "productId", - "description": "The product unique identifier (you may provide a list of IDs if needed).", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PartnersEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Partner", + "ofType": null }, - { - "name": "productVariantId", - "description": "The product variant unique identifier (you may provide a list of IDs if needed).", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ResellerNode", + "description": null, + "fields": [ + { + "name": "cnpj", + "description": "Taxpayer identification number for businesses", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sameParentAs", - "description": "A product ID or a list of IDs to search for other products with the same parent ID.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "corporateName", + "description": "The registered name of the company", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sku", - "description": "The set of SKUs which the result item SKU must be included.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The seller's name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "stock_gte", - "description": "Show products with a quantity of available products in stock greater than or equal to the given number.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "sellerId", + "description": "Seller unique identifier", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "stock_lte", - "description": "Show products with a quantity of available products in stock less than or equal to the given number.", - "type": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SellersEdge", + "description": "An edge in a connection.", + "fields": [ + { + "name": "cursor", + "description": "A cursor for use in pagination.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "node", + "description": "The item at the end of the edge.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "ResellerNode", + "ofType": null }, - { - "name": "stocks", - "description": "The set of stocks to filter.", - "type": { - "kind": "INPUT_OBJECT", - "name": "StocksInput", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerSubscriptionPaymentCard", + "description": null, + "fields": [ + { + "name": "brand", + "description": "The brand of the payment card (e.g., Visa, MasterCard).", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "updatedAt_gte", - "description": "Retrieve products which the last update date is greater than or equal to the given date.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "expiration", + "description": "The expiration date of the payment card.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "updatedAt_lte", - "description": "Retrieve products which the last update date is less than or equal to the given date.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "paymentMethod", - "description": null, - "fields": [ - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "imageUrl", - "description": "The url link that displays for the payment.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The masked or truncated number of the payment card.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderPaymentPixNode", + "description": null, + "fields": [ + { + "name": "qrCode", + "description": "The QR code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "qrCodeExpirationDate", + "description": "The expiration date of the QR code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "qrCodeUrl", + "description": "The image URL of the QR code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderPaymentBoletoNode", + "description": null, + "fields": [ + { + "name": "digitableLine", + "description": "The digitable line.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentLink", + "description": "The payment link.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderPaymentCardNode", + "description": null, + "fields": [ + { + "name": "brand", + "description": "The brand of the card.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "maskedNumber", + "description": "The masked credit card number with only the last 4 digits displayed.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderPaymentAdditionalInfoNode", + "description": null, + "fields": [ + { + "name": "key", + "description": "Additional information key.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "Additional information value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OrderShippingProductNode", + "description": null, + "fields": [ + { + "name": "distributionCenterId", + "description": "Distribution center unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null }, - { - "name": "name", - "description": "The name of the payment method.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The product price.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "Variant unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "PartnerByRegionInput", - "description": "Input for partners.", - "fields": null, - "inputFields": [ - { - "name": "cep", - "description": "CEP to get the regional partners.", - "type": { - "kind": "SCALAR", - "name": "CEP", - "ofType": null - }, - "defaultValue": null }, - { - "name": "regionId", - "description": "Region ID to get the regional partners.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "Quantity of the given product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "Int", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "PartnerSortKeys", - "description": "Define the partner attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The partner unique identifier.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NAME", - "description": "The partner name.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "InformationGroupFieldNode", - "description": null, - "fields": [ - { - "name": "displayType", - "description": "The information group field display type.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "TypeCheckingAccount", + "description": "Represents the Type of Customer's Checking Account.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "Credit", + "description": "Credit", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "Debit", + "description": "Debit", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerInformationGroupFieldNode", + "description": null, + "fields": [ + { + "name": "name", + "description": "The field name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "The field order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "fieldName", - "description": "The information group field name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "required", + "description": "If the field is required.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The field value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderProductAdjustment", + "description": "Represents an adjustment applied to a product in the checkout order.", + "fields": [ + { + "name": "additionalInformation", + "description": "Additional information about the adjustment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the adjustment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The type of the adjustment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the adjustment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "order", - "description": "The information group field order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderProductAttribute", + "description": "Represents an attribute of a product.", + "fields": [ + { + "name": "name", + "description": "The name of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "required", - "description": "If the information group field is required.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "values", - "description": "The information group field preset values.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "InformationGroupFieldValueNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderCardPayment", + "description": "This represents a Card payment node in the checkout order.", + "fields": [ + { + "name": "brand", + "description": "The brand card.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "HotsiteSortKeys", - "description": "Define the hotsite attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The hotsite id.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NAME", - "description": "The hotsite name.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "URL", - "description": "The hotsite url.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "ContentSortKeys", - "description": "Define the content attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The content\u0027s unique identifier.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CreationDate", - "description": "The content\u0027s creation date.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "CategorySortKeys", - "description": "Define the category attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The category unique identifier.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NAME", - "description": "The category name.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BuyList", - "description": "A buy list represents a list of items for sale in the store.", - "fields": [ - { - "name": "addToCartFromSpot", - "description": "Check if the product can be added to cart directly from spot.", - "args": [], - "type": { + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cardInterest", + "description": "The interest generated by the card.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "alias", - "description": "The product url alias.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installments", + "description": "The installments generated for the card.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The cardholder name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "attributeSelections", - "description": "Information about the possible selection attributes.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "AttributeSelection", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The final four numbers on the card.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "attributes", - "description": "List of the product attributes.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductAttribute", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderPixPayment", + "description": "This represents a Pix payment node in the checkout order.", + "fields": [ + { + "name": "qrCode", + "description": "The QR code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "qrCodeExpirationDate", + "description": "The expiration date of the QR code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "qrCodeUrl", + "description": "The image URL of the QR code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderInvoicePayment", + "description": "The invoice payment information.", + "fields": [ + { + "name": "digitableLine", + "description": "The digitable line.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "paymentLink", + "description": "The payment link.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutOrderAddress", + "description": "The delivery or store Pickup Address.", + "fields": [ + { + "name": "address", + "description": "The street address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "cep", + "description": "The ZIP code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "city", + "description": "The city.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "complement", + "description": "Additional information or details about the address.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "available", - "description": "Field to check if the product is available in stock.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isPickupStore", + "description": "Indicates whether the order is for store pickup.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "averageRating", - "description": "The product average rating. From 0 to 5.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "neighborhood", + "description": "The neighborhood.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "breadcrumbs", - "description": "List of product breadcrumbs.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Breadcrumb", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pickupStoreText", + "description": ".", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "buyBox", - "description": "BuyBox informations.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "BuyBox", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SuggestedCard", + "description": null, + "fields": [ + { + "name": "brand", + "description": "Credit card brand.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "buyListId", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "key", + "description": "Credit card key.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "buyListProducts", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "BuyListProduct", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Customer name on credit card.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "buyTogether", - "description": "Buy together products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SingleProduct", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "Credit card number.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "condition", - "description": "The product condition.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SelectedPaymentMethodInstallment", + "description": "Details of an installment of the selected payment method.", + "fields": [ + { + "name": "adjustment", + "description": "The adjustment value applied to the installment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Float", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "createdAt", - "description": "The product creation date.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The installment number.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "customizations", - "description": "A list of customizations available for the given products.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Customization", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "deadline", - "description": "The product delivery deadline.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "total", + "description": "The total value of the installment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Float", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "display", - "description": "Check if the product should be displayed.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The individual value of each installment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Float", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RemoveSubscriptionProductInput", + "description": "Represents the product to be removed from the subscription.", + "fields": null, + "inputFields": [ + { + "name": "quantity", + "description": "The quantity to be removed for the product. Removes all if not passed", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "displayOnlyPartner", - "description": "Check if the product should be displayed only for partners.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "subscriptionProductId", + "description": "The Id of the product within the subscription to be removed.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "displaySearch", - "description": "Check if the product should be displayed on search.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "SubscriptionProductsInput", + "description": "Represents the product to be applied to the subscription.", + "fields": null, + "inputFields": [ + { + "name": "productVariantId", + "description": "The variant Id of the product.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "ean", - "description": "The product\u0027s unique EAN.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": "The quantity of the product.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "Status", + "description": "The subscription status to update.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ACTIVE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PAUSED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CANCELED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "SearchRecordInput", + "description": "The information to be saved for reports.", + "fields": null, + "inputFields": [ + { + "name": "operation", + "description": "The search operation (And, Or)", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "freeShipping", - "description": "Check if the product offers free shipping.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "page", + "description": "The current page", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "id", - "description": "The node unique identifier.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "pageSize", + "description": "How many products show in page", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "ID", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "images", - "description": "List of the product images.", - "args": [ - { - "name": "height", - "description": "The height of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Image", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "pageUrl", + "description": "The client search page url", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "informations", - "description": "List of the product insformations.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Information", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "query", + "description": "The user search query", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "mainVariant", - "description": "Check if its the main variant.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "totalResults", + "description": "How many products the search returned", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "minimumOrderQuantity", - "description": "The product minimum quantity for an order.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SearchRecord", + "description": "The response data", + "fields": [ + { + "name": "date", + "description": "The date time of the processed request", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "newRelease", - "description": "Check if the product is a new release.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isSuccess", + "description": "If the record was successful", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "query", + "description": "The searched query", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CounterOfferInput", + "description": "Input data for submitting a counter offer for a product.", + "fields": null, + "inputFields": [ + { + "name": "additionalInfo", + "description": "Any additional information or comments provided by the user regarding the counter offer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "email", + "description": "The email address of the user submitting the counter offer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "numberOfVotes", - "description": "The number of votes that the average rating consists of.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "price", + "description": "The proposed price by the user for the product.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "parallelOptions", - "description": "Product parallel options information.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The unique identifier of the product variant for which the counter offer is made.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "url", + "description": "URL linking to the page or the location where the product is listed.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "FriendRecommendInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "buyListId", + "description": "The buy list id", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "fromEmail", + "description": "Email of who is recommending a product", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } }, - { - "name": "parentId", - "description": "Parent product unique identifier.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "fromName", + "description": "Who is recommending", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "prices", - "description": "The product prices.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Prices", + "defaultValue": null + }, + { + "name": "message", + "description": "The message", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "productId", + "description": "The Product Id", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "toEmail", + "description": "Email of the person who will receive a product recommendation", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productBrand", - "description": "Summarized informations about the brand of the product.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductBrand", + "defaultValue": null + }, + { + "name": "toName", + "description": "Name of the person who will receive a product recommendation", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productCategories", - "description": "Summarized informations about the categories of the product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "ProductCategory", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "RestockAlertInput", + "description": "Back in stock registration input parameters.", + "fields": null, + "inputFields": [ + { + "name": "email", + "description": "Email to be notified.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "Name of the person to be notified.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productId", - "description": "Product unique identifier.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The product variant id of the product to be notified.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "RestockAlertNode", + "description": null, + "fields": [ + { + "name": "email", + "description": "Email to be notified.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "Name of the person to be notified.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "productName", - "description": "The product name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "The product variant id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productSubscription", - "description": "Summarized informations about the subscription of the product.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "ProductSubscription", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestDate", + "description": "Date the alert was requested.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AddPriceAlertInput", + "description": "Price alert input parameters.", + "fields": null, + "inputFields": [ + { + "name": "email", + "description": "The alerted's email.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The alerted's name.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The product variant id to create the price alert.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "promotions", - "description": "List of promotions this product belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Promotion", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "reviews", - "description": "List of customer reviews for this product.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Review", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "[Deprecated: use the root field] The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "seller", - "description": "The product seller.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "Seller", + "defaultValue": null + }, + { + "name": "targetPrice", + "description": "The target price to alert.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "seo", - "description": "Product SEO informations.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SEO", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ProductPriceAlert", + "description": "A product price alert.", + "fields": [ + { + "name": "email", + "description": "The alerted's email.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "similarProducts", - "description": "List of similar products. ", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SimilarProduct", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The alerted's name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "sku", - "description": "The product\u0027s unique SKU.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "priceAlertId", + "description": "The price alert ID.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "spotAttributes", - "description": "The values of the spot attribute.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": "The product variant ID.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } }, - { - "name": "spotInformation", - "description": "The product spot information.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "requestDate", + "description": "The request date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "spotlight", - "description": "Check if the product is on spotlight.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "targetPrice", + "description": "The target price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "stock", - "description": "The available stock at the default distribution center.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ReviewCreateInput", + "description": "Review input parameters.", + "fields": null, + "inputFields": [ + { + "name": "email", + "description": "The reviewer's email.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The reviewer's name.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The product variant id to add the review to.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "stocks", - "description": "List of the product stocks on different distribution centers.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Stock", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "rating", + "description": "The review rating.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, - { - "name": "subscriptionGroups", - "description": "List of subscription groups this product belongs to.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SubscriptionGroup", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "[Deprecated: use the root field] The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "telesales", - "description": "Check if the product is a telesale.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "review", + "description": "The review content.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "updatedAt", - "description": "The product last update date.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "NewsletterInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "email", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "gender", + "description": "The receiver gender. Default is null.", + "type": { + "kind": "ENUM", + "name": "Gender", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "informationGroupValues", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "InformationGroupValueInput", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "urlVideo", - "description": "The product video url.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + }, + { + "name": "recaptchaToken", + "description": "[Deprecated: use the root field] The google recaptcha token.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "variantName", - "description": "The variant name.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "NewsletterNode", + "description": null, + "fields": [ + { + "name": "createDate", + "description": "Newsletter creation date.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [ - { - "kind": "INTERFACE", - "name": "Node", + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "email", + "description": "The newsletter receiver email.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", "ofType": null - } - ], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "BrandSortKeys", - "description": "Define the brand attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The brand unique identifier.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NAME", - "description": "The brand name.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "BrandFilterInput", - "description": "Filter brand results based on giving attributes.", - "fields": null, - "inputFields": [ - { - "name": "brandIds", - "description": "Its unique identifier (you may provide a list of IDs if needed).", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null }, - { - "name": "groupIds", - "description": "Its brand group unique identifier (you may provide a list of IDs if needed).", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "gender", + "description": "Newsletter receiver gender.", + "args": [], + "type": { + "kind": "ENUM", + "name": "Gender", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The newsletter receiver name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "updateDate", + "description": "Newsletter update date.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerSimpleCreateInputGraphInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "birthDate", + "description": "The date of birth of the customer.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "cnpj", + "description": "The Brazilian tax identification number for corporations.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "corporateName", + "description": "The legal name of the corporate customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "cpf", + "description": "The Brazilian tax identification number for individuals.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "customerType", + "description": "Indicates if it is a natural person or company profile.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "EntityType", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "email", + "description": "The email of the customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "fullName", + "description": "The full name of the customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "isStateRegistrationExempt", + "description": "Indicates if the customer is state registration exempt.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "primaryPhoneAreaCode", + "description": "The area code for the customer's primary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "primaryPhoneNumber", + "description": "The customer's primary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "stateRegistration", + "description": "The state registration number for businesses.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SimpleLogin", + "description": null, + "fields": [ + { + "name": "customerAccessToken", + "description": "The customer access token", + "args": [], + "type": { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "question", + "description": "The simple login question to answer", + "args": [], + "type": { + "kind": "OBJECT", + "name": "Question", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The simple login type", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "SimpleLoginType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerEmailChangeInput", + "description": "The input to change the user email.", + "fields": null, + "inputFields": [ + { + "name": "newEmail", + "description": "The new email.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerPasswordChangeInput", + "description": "The input to change the user password.", + "fields": null, + "inputFields": [ + { + "name": "currentPassword", + "description": "The current password.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "newPassword", + "description": "The new password.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "newPasswordConfirmation", + "description": "New password confirmation.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerPasswordChangeByRecoveryInput", + "description": "The input to change the user password by recovery.", + "fields": null, + "inputFields": [ + { + "name": "key", + "description": "Key generated for password recovery.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "newPassword", + "description": "The new password.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "newPasswordConfirmation", + "description": "New password confirmation.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "birthDate", + "description": "The date of birth of the customer.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "corporateName", + "description": "The legal name of the corporate customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "fullName", + "description": "The full name of the customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "gender", + "description": "The gender of the customer.", + "type": { + "kind": "ENUM", + "name": "Gender", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "informationGroupValues", + "description": "The customer information group values.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "InformationGroupValueInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "primaryPhoneNumber", + "description": "The customer's primary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "primaryPhoneNumberInternational", + "description": "The customer's primary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "rg", + "description": "The Brazilian register identification number for individuals.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "secondaryPhoneNumber", + "description": "The customer's secondary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "secondaryPhoneNumberInternational", + "description": "The customer's secondary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "stateRegistration", + "description": "The state registration number for businesses.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerCreateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "address", + "description": "The street address for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "address2", + "description": "The street address for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "addressComplement", + "description": "Any additional information related to the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "addressNumber", + "description": "The building number for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "birthDate", + "description": "The date of birth of the customer.", + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "cep", + "description": "The CEP for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "city", + "description": "The city for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "cnpj", + "description": "The Brazilian tax identification number for corporations.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "corporateName", + "description": "The legal name of the corporate customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "country", + "description": "The country for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "cpf", + "description": "The Brazilian tax identification number for individuals.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "customerType", + "description": "Indicates if it is a natural person or company profile.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "EntityType", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "email", + "description": "The email of the customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "fullName", + "description": "The full name of the customer.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "gender", + "description": "The gender of the customer.", + "type": { + "kind": "ENUM", + "name": "Gender", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "informationGroupValues", + "description": "The customer information group values.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "InformationGroupValueInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "isStateRegistrationExempt", + "description": "Indicates if the customer is state registration exempt.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "groupNames", - "description": "The set of group brand names which the result item name must be included in.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "defaultValue": null + }, + { + "name": "neighborhood", + "description": "The neighborhood for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "names", - "description": "The set of brand names which the result item name must be included in.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "BannerSortKeys", - "description": "Define the banner attribute which the result set will be sorted on.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "ID", - "description": "The banner\u0027s unique identifier.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CREATION_DATE", - "description": "The banner\u0027s creation date.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Autocomplete", - "description": "Get query completion suggestion.", - "fields": [ - { - "name": "products", - "description": "Suggested products based on the current query.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Product", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "newsletter", + "description": "Indicates if the customer has subscribed to the newsletter.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "suggestions", - "description": "List of possible query completions.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AddressNode", - "description": null, - "fields": [ - { - "name": "cep", - "description": "Zip code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "password", + "description": "The password for the customer's account.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "city", - "description": "Address city.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "passwordConfirmation", + "description": "The password confirmation for the customer's account.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "country", - "description": "Address country.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "primaryPhoneAreaCode", + "description": "The area code for the customer's primary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "neighborhood", - "description": "Address neighborhood.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "primaryPhoneNumber", + "description": "The customer's primary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "state", - "description": "Address state.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "receiverName", + "description": "The name of the receiver for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "street", - "description": "Address street.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderNoteNode", - "description": null, - "fields": [ - { - "name": "date", - "description": "Date the note was added to the order.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "reference", + "description": "A reference point or description to help locate the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "note", - "description": "The note added to the order.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "reseller", + "description": "Indicates if the customer is a reseller.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "user", - "description": "The user who added the note to the order.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderDeliveryAddressNode", - "description": null, - "fields": [ - { - "name": "addressNumber", - "description": "The street number of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "secondaryPhoneAreaCode", + "description": "The area code for the customer's secondary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "cep", - "description": "The ZIP code of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "secondaryPhoneNumber", + "description": "The customer's secondary phone number.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "city", - "description": "The city of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "state", + "description": "The state for the registered address.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "complement", - "description": "The additional address information.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "stateRegistration", + "description": "The state registration number for businesses.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "country", - "description": "The country of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "PartnerAccessTokenInput", + "description": "The input to authenticate closed scope partners.", + "fields": null, + "inputFields": [ + { + "name": "password", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "username", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PartnerAccessToken", + "description": null, + "fields": [ + { + "name": "token", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "neighboorhood", - "description": "The neighborhood of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "validUntil", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null }, - { - "name": "receiverName", - "description": "The receiver\u0027s name.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerAuthenticateInput", + "description": "The input to authenticate a user.", + "fields": null, + "inputFields": [ + { + "name": "input", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "password", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CustomerAccessTokenInput", + "description": "The input to authenticate a user.", + "fields": null, + "inputFields": [ + { + "name": "email", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "password", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerAccessToken", + "description": null, + "fields": [ + { + "name": "isMaster", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "legacyToken", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "referencePoint", - "description": "The reference point for the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "token", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "state", - "description": "The state of the address, abbreviated.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The user login type", + "args": [], + "type": { + "kind": "ENUM", + "name": "LoginType", + "ofType": null }, - { - "name": "street", - "description": "The street name of the address.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderShippingNode", - "description": null, - "fields": [ - { - "name": "deadline", - "description": "Limit date of delivery, in days.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "validUntil", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "deadlineText", - "description": "Deadline text message.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "EventListAddProductInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "productVariantId", + "description": "The unique identifier of the product variant.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "distributionCenterId", - "description": "Distribution center unique identifier.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": "The quantity of the product to be added.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "pickUpId", - "description": "The order pick up unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CreateCustomerAddressInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "address", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "products", - "description": "The products belonging to the order.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderShippingProductNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "address2", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "promotion", - "description": "Amount discounted from shipping costs, if any.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "addressDetails", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "addressNumber", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "cep", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "CEP", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "refConnector", - "description": "Shipping company connector identifier code.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "city", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "scheduleFrom", - "description": "Start date of shipping schedule.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "country", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "CountryCode", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "scheduleUntil", - "description": "Limit date of shipping schedule.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "email", + "description": null, + "type": { + "kind": "SCALAR", + "name": "EmailAddress", + "ofType": null }, - { - "name": "shippingFee", - "description": "Shipping fee value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "shippingName", - "description": "The shipping name.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "neighborhood", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "shippingTableId", - "description": "Shipping rate table unique identifier.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "phone", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "total", - "description": "The total value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "receiverName", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "volume", - "description": "Order package size.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "referencePoint", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "weight", - "description": "The order weight, in grams.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderInvoiceNode", - "description": null, - "fields": [ - { - "name": "accessKey", - "description": "The invoice access key.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "state", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "invoiceCode", - "description": "The invoice identifier code.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "street", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "serialDigit", - "description": "The invoice serial digit.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "UpdateCustomerAddressInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "address", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "url", - "description": "The invoice URL.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPaymentNode", - "description": null, - "fields": [ - { - "name": "additionalInfo", - "description": "Additional information for the payment.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "OrderPaymentAdditionalInfoNode", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "address2", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "boleto", - "description": "The boleto information.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "OrderPaymentBoletoNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "addressDetails", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "card", - "description": "The card information.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "OrderPaymentCardNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "addressNumber", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "discount", - "description": "Order discounted value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "cep", + "description": null, + "type": { + "kind": "SCALAR", + "name": "CEP", + "ofType": null }, - { - "name": "fees", - "description": "Order additional fees value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "city", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "country", + "description": null, + "type": { + "kind": "SCALAR", + "name": "CountryCode", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "email", + "description": null, + "type": { + "kind": "SCALAR", + "name": "EmailAddress", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "name", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "neighborhood", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "phone", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "receiverName", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "referencePoint", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "state", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "street", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "installmentValue", - "description": "Value per installment.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "id", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "kitGroupId", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "installments", - "description": "Number of installments.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "kitId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + }, + { + "name": "products", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitProductInput", + "ofType": null + } }, - { - "name": "message", - "description": "Message about payment transaction.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "paymentOption", - "description": "The chosen payment option for the order.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CheckoutResetType", + "description": "The checkout areas available to reset", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PAYMENT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "OperationResult", + "description": "Result of the operation.", + "fields": [ + { + "name": "isSuccess", + "description": "If the operation is a success.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "pix", - "description": "The pix information.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "OrderPaymentPixNode", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutMetadataInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "key", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "status", - "description": "Current payment status.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "value", + "description": null, + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "total", - "description": "Order total value.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderStatusNode", - "description": null, - "fields": [ - { - "name": "changeDate", - "description": "The date when status has changed.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "InStorePickupAdditionalInformationInput", + "description": "The additional information about in-store pickup", + "fields": null, + "inputFields": [ + { + "name": "document", + "description": "The document", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "name", + "description": "The name", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SearchFilter", + "description": "Aggregated filters of a list of products.", + "fields": [ + { + "name": "field", + "description": "The name of the field.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "origin", + "description": "The origin of the field.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "List of the values of the field.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SearchFilterItem", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "DeliveryScheduleInput", + "description": "Input for delivery scheduling.", + "fields": null, + "inputFields": [ + { + "name": "date", + "description": "The date.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "DateTime", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "status", - "description": "Order status.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "periodId", + "description": "The period ID.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "statusId", - "description": "Status unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeValue", - "description": "Attributes values with variants", - "fields": [ - { - "name": "productVariants", - "description": "Product variants that have the attribute.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The checkout unique identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "product", + "description": "The checkout product.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductItemUpdateInput", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The checkout unique identifier.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "products", + "description": "The checkout products.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "LIST", "name": null, "ofType": { - "kind": "OBJECT", - "name": "ProductVariant", + "kind": "INPUT_OBJECT", + "name": "CheckoutProductItemInput", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The value of the attribute.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductItemInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "customization", + "description": "The customizations of the product.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutCustomizationInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customizationId", + "description": "The ID represents all customizations applied to the product.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "metadata", + "description": "The metadata of the product.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutMetadataInput", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeSelectionOption", - "description": "Attributes available for the variant products from the given productId.", - "fields": [ - { - "name": "attributeId", - "description": "The id of the attribute.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "displayType", - "description": "The display type of the attribute.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The ID of the product variant.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": "The name of the attribute.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": "The quantity of the product.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "values", - "description": "The values of the attribute.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AttributeSelectionOptionValue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "subscription", + "description": "Product subscriptions related to checkout.", + "type": { + "kind": "INPUT_OBJECT", + "name": "CheckoutSubscriptionInput", + "ofType": null }, - { - "name": "varyByParent", - "description": "If the attributes varies by parent.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeMatrix", - "description": null, - "fields": [ - { - "name": "column", - "description": "Information about the column attribute.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "AttributeMatrixInfo", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Uri", + "description": "Node of URI Kind.", + "fields": [ + { + "name": "hotsiteSubtype", + "description": "The origin of the hotsite.", + "args": [], + "type": { + "kind": "ENUM", + "name": "HotsiteSubtype", + "ofType": null }, - { - "name": "data", - "description": "The matrix products data. List of rows.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AttributeMatrixProduct", - "ofType": null - } - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "kind", + "description": "Path kind.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "UriKind", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "partnerSubtype", + "description": "The partner subtype.", + "args": [], + "type": { + "kind": "ENUM", + "name": "PartnerSubtype", + "ofType": null }, - { - "name": "row", - "description": "Information about the row attribute.", - "args": [], - "type": { - "kind": "OBJECT", - "name": "AttributeMatrixInfo", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BestInstallment", - "description": null, - "fields": [ - { - "name": "discount", - "description": "Wether the installment has discount.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productAlias", + "description": "Product alias.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productCategoriesIds", + "description": "Product categories IDs.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "displayName", - "description": "The custom display name of the best installment plan option.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "redirectCode", + "description": "Redirect status code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "fees", - "description": "Wether the installment has fees.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "redirectUrl", + "description": "Url to redirect.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ShopSetting", + "description": "Store setting.", + "fields": [ + { + "name": "name", + "description": "Setting name", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "Setting value", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The name of the best installment plan option.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "productsInput", + "description": "The list of products to quote shipping.", + "fields": null, + "inputFields": [ + { + "name": "productVariantId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "number", - "description": "The number of installments.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + }, + { + "name": "quantity", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, - { - "name": "value", - "description": "The value of the installment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "InstallmentPlan", - "description": null, - "fields": [ - { - "name": "displayName", - "description": "The custom display name of this installment plan.", - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ShippingQuote", + "description": "A shipping quote.", + "fields": [ + { + "name": "deadline", + "description": "The shipping deadline.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deadlineInHours", + "description": "The shipping deadline in hours.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null }, - { - "name": "installments", - "description": "List of the installments.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Installment", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "deliverySchedules", + "description": "The available time slots for scheduling the delivery of the shipping quote.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "deliverySchedule", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The shipping name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "products", + "description": "The products related to the shipping.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ShippingProduct", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "shippingQuoteId", + "description": "The shipping quote unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Uuid", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The shipping type.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "name", - "description": "The name of this installment plan.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The shipping value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Float", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "PriceTable", - "description": null, - "fields": [ - { - "name": "discountPercentage", - "description": "The amount of discount in percentage.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "id", - "description": "The id of this price table.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ResellerSortKeys", + "description": "Define the reseller attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "Reseller unique identifier", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "The reseller's name", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "Operation", + "description": "Types of operations to perform between query terms.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "AND", + "description": "Performs AND operation between query terms.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "OR", + "description": "Performs OR operation between query terms.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ScriptPageType", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ALL", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HOME", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SEARCH", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CATEGORY", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BRAND", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PRODUCT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ScriptPosition", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "HEADER_START", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HEADER_END", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BODY_START", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BODY_END", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FOOTER_START", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FOOTER_END", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Script", + "description": "Returns the scripts registered in the script manager.", + "fields": [ + { + "name": "content", + "description": "The script content.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "listPrice", - "description": "The listed regular price of this table.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The script id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The script name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "price", - "description": "The current working price of this table.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "WholesalePrices", - "description": null, - "fields": [ - { - "name": "price", - "description": "The wholesale price.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "pageType", + "description": "The script page type.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ScriptPageType", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "position", + "description": "The script position.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ScriptPosition", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "priority", + "description": "The script priority.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, - { - "name": "quantity", - "description": "The minimum quantity required for the wholesale price to be applied", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SubscriptionRecurringType", - "description": null, - "fields": [ - { - "name": "days", - "description": "The number of days of the recurring type.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CalculatePricesProductsInput", + "description": "The products to calculate prices.", + "fields": null, + "inputFields": [ + { + "name": "productVariantId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } }, - { - "name": "name", - "description": "The recurring type display name.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "quantity", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ProductRecommendationAlgorithm", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "DEFAULT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "ProductExplicitFiltersInput", + "description": "Filter product results based on giving attributes.", + "fields": null, + "inputFields": [ + { + "name": "attributes", + "description": "The set of attributes do filter.", + "type": { + "kind": "INPUT_OBJECT", + "name": "AttributeInput", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "available", + "description": "Choose if you want to retrieve only the available products in stock.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null }, - { - "name": "recurringTypeId", - "description": "The recurring type id.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "brandId", + "description": "The set of brand IDs which the result item brand ID must be included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -21545,227 +26560,869 @@ "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SellerPrices", - "description": "The prices of the product.", - "fields": [ - { - "name": "installmentPlans", - "description": "List of the possibles installment plans.", - "args": [], - "type": { - "kind": "LIST", + } + }, + "defaultValue": null + }, + { + "name": "categoryId", + "description": "The set of category IDs which the result item category ID must be included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "NON_NULL", "name": null, "ofType": { - "kind": "OBJECT", - "name": "SellerInstallmentPlan", + "kind": "SCALAR", + "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "listPrice", - "description": "The listed regular price of the product.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "ean", + "description": "The set of EANs which the result item EAN must be included.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "price", - "description": "The current working price.", - "args": [], - "type": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "EmailAddress", - "description": "The EmailAddress scalar type constitutes a valid email address, represented as a UTF-8 character sequence. The scalar follows the specification defined by the HTML Spec https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "SCALAR", - "name": "CountryCode", - "description": "String representing a country code", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SellerInstallmentPlan", - "description": null, - "fields": [ - { - "name": "displayName", - "description": "The custom display name of this installment plan.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "externalParentId", + "description": "An external parent ID or a list of IDs to search for products with the external parent ID.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "installments", - "description": "List of the installments.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "SellerInstallment", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Installment", - "description": null, - "fields": [ - { - "name": "discount", - "description": "Wether the installment has discount.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "hasImages", + "description": "Retrieve the product variant only if it contains images.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "ignoreDisplayRules", + "description": "Ignores the display rules when searching for products.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "mainVariant", + "description": "Retrieve the product variant only if it is the main product variant.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "parentId", + "description": "A parent ID or a list of IDs to search for products with the parent ID.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "fees", - "description": "Wether the installment has fees.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "prices", + "description": "The set of prices to filter.", + "type": { + "kind": "INPUT_OBJECT", + "name": "PricesInput", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "productId", + "description": "The product unique identifier (you may provide a list of IDs if needed).", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "number", - "description": "The number of installments.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The product variant unique identifier (you may provide a list of IDs if needed).", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The value of the installment.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "sameParentAs", + "description": "A product ID or a list of IDs to search for other products with the same parent ID.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeMatrixProduct", - "description": null, - "fields": [ - { - "name": "available", - "description": null, - "args": [], - "type": { + } + }, + "defaultValue": null + }, + { + "name": "search", + "description": "Search products.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "sku", + "description": "The set of SKUs which the result item SKU must be included.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "stock_gte", + "description": "Show products with a quantity of available products in stock greater than or equal to the given number.", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "stock_lte", + "description": "Show products with a quantity of available products in stock less than or equal to the given number.", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "stocks", + "description": "The set of stocks to filter.", + "type": { + "kind": "INPUT_OBJECT", + "name": "StocksInput", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "subscriptionGroupId", + "description": "The subscription group IDs to search for products inside those groups.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Boolean", + "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + }, + { + "name": "updatedAt_gte", + "description": "Retrieve products which the last update date is greater than or equal to the given date.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "updatedAt_lte", + "description": "Retrieve products which the last update date is less than or equal to the given date.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "paymentMethod", + "description": null, + "fields": [ + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "imageUrl", + "description": "The url link that displays for the payment.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the payment method.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "PartnerByRegionInput", + "description": "Input for partners.", + "fields": null, + "inputFields": [ + { + "name": "cep", + "description": "CEP to get the regional partners.", + "type": { + "kind": "SCALAR", + "name": "CEP", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "regionId", + "description": "Region ID to get the regional partners.", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PartnerSortKeys", + "description": "Define the partner attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The partner unique identifier.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "The partner name.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "EnumInformationGroup", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PESSOA_FISICA", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PESSOA_JURIDICA", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NEWSLETTER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "InformationGroupFieldNode", + "description": null, + "fields": [ + { + "name": "displayType", + "description": "The information group field display type.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fieldName", + "description": "The information group field name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The node unique identifier.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "order", + "description": "The information group field order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "required", + "description": "If the information group field is required.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "The information group field preset values.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "InformationGroupFieldValueNode", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [ + { + "kind": "INTERFACE", + "name": "Node", + "ofType": null + } + ], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "HotsiteSortKeys", + "description": "Define the hotsite attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The hotsite id.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "The hotsite name.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "URL", + "description": "The hotsite url.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "EventListStore", + "description": "Represents a list of store events.", + "fields": [ + { + "name": "date", + "description": "Date of the event", + "args": [], + "type": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "eventType", + "description": "Event type name of the event", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "logoUrl", + "description": "URL of the event's logo", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "url", + "description": "The URL of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "EventListType", + "description": "Represents a list of events types.", + "fields": [ + { + "name": "logoUrl", + "description": "The URL of the event's logo.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "urlPath", + "description": "The URL path of the event.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CustomerAccessTokenDetails", + "description": null, + "fields": [ + { + "name": "customerId", + "description": "The customer id", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "identifier", + "description": "The identifier linked to the access token", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "isMaster", + "description": "Specifies whether the user is a master user", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "origin", + "description": "The user login origin", + "args": [], + "type": { + "kind": "ENUM", + "name": "LoginOrigin", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "type", + "description": "The user login type", + "args": [], + "type": { + "kind": "ENUM", + "name": "LoginType", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "validUntil", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "DateTime", + "ofType": null + } }, - { - "name": "productVariantId", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "ContentSortKeys", + "description": "Define the content attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The content's unique identifier.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CreationDate", + "description": "The content's creation date.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutLite", + "description": null, + "fields": [ + { + "name": "completed", + "description": "Indicates if the checkout is completed.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "customerId", + "description": "The customer ID associated with the checkout.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "CategorySortKeys", + "description": "Define the category attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The category unique identifier.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "The category name.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "BrandSortKeys", + "description": "Define the brand attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The brand unique identifier.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NAME", + "description": "The brand name.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "BrandFilterInput", + "description": "Filter brand results based on giving attributes.", + "fields": null, + "inputFields": [ + { + "name": "brandIds", + "description": "Its unique identifier (you may provide a list of IDs if needed).", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -21773,15 +27430,17 @@ "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "stock", - "description": null, - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "groupIds", + "description": "Its brand group unique identifier (you may provide a list of IDs if needed).", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -21789,870 +27448,1527 @@ "name": "Long", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeMatrixInfo", - "description": null, - "fields": [ - { - "name": "displayType", - "description": null, - "args": [], - "type": { + } + }, + "defaultValue": null + }, + { + "name": "groupNames", + "description": "The set of group brand names which the result item name must be included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "name", - "description": null, - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "names", + "description": "The set of brand names which the result item name must be included in.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "values", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "AttributeMatrixRowColumnInfoValue", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeSelectionOptionValue", - "description": null, - "fields": [ - { - "name": "alias", - "description": null, - "args": [], - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "BannerSortKeys", + "description": "Define the banner attribute which the result set will be sorted on.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "ID", + "description": "The banner's unique identifier.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CREATION_DATE", + "description": "The banner's creation date.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Autocomplete", + "description": "Get query completion suggestion.", + "fields": [ + { + "name": "products", + "description": "Suggested products based on the current query.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Product", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "suggestions", + "description": "List of possible query completions.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "available", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "printUrl", - "description": null, - "args": [ - { - "name": "height", - "description": "The height of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AddressNode", + "description": null, + "fields": [ + { + "name": "cep", + "description": "Zip code.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "city", + "description": "Address city.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "country", + "description": "Address country.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "neighborhood", + "description": "Address neighborhood.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "state", + "description": "Address state.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "street", + "description": "Address street.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "FilterPosition", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "VERTICAL", + "description": "Vertical filter position.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HORIZONTAL", + "description": "Horizontal filter position.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BOTH", + "description": "Both filter position.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PriceRange", + "description": "Range of prices for this product.", + "fields": [ + { + "name": "quantity", + "description": "The quantity of products in this range.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "range", + "description": "The price range.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "selected", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeValue", + "description": "Attributes values with variants", + "fields": [ + { + "name": "productVariants", + "description": "Product variants that have the attribute.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "ProductVariant", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "BuyTogetherType", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PRODUCT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CAROUSEL", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeSelectionOption", + "description": "Attributes available for the variant products from the given productId.", + "fields": [ + { + "name": "attributeId", + "description": "The id of the attribute.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayType", + "description": "The display type of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": "The values of the attribute.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AttributeSelectionOptionValue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "varyByParent", + "description": "If the attributes varies by parent.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeMatrix", + "description": null, + "fields": [ + { + "name": "column", + "description": "Information about the column attribute.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "AttributeMatrixInfo", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "data", + "description": "The matrix products data. List of rows.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "LIST", "name": null, "ofType": { - "kind": "SCALAR", - "name": "Boolean", + "kind": "OBJECT", + "name": "AttributeMatrixProduct", "ofType": null } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "row", + "description": "Information about the row attribute.", + "args": [], + "type": { + "kind": "OBJECT", + "name": "AttributeMatrixInfo", + "ofType": null }, - { - "name": "value", - "description": "The value of the attribute.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "BestInstallment", + "description": null, + "fields": [ + { + "name": "discount", + "description": "Wether the installment has discount.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPaymentPixNode", - "description": null, - "fields": [ - { - "name": "qrCode", - "description": "The QR code.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "displayName", + "description": "The custom display name of the best installment plan option.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fees", + "description": "Wether the installment has fees.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of the best installment plan option.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The number of installments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the installment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "InstallmentPlan", + "description": null, + "fields": [ + { + "name": "displayName", + "description": "The custom display name of this installment plan.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installments", + "description": "List of the installments.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Installment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The name of this installment plan.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "qrCodeExpirationDate", - "description": "The expiration date of the QR code.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "PriceTable", + "description": null, + "fields": [ + { + "name": "discountPercentage", + "description": "The amount of discount in percentage.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "DateTime", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "qrCodeUrl", - "description": "The image URL of the QR code.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The id of this price table.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPaymentBoletoNode", - "description": null, - "fields": [ - { - "name": "digitableLine", - "description": "The digitable line.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The listed regular price of this table.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The current working price of this table.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "paymentLink", - "description": "The payment link.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "WholesalePrices", + "description": null, + "fields": [ + { + "name": "price", + "description": "The wholesale price.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPaymentCardNode", - "description": null, - "fields": [ - { - "name": "brand", - "description": "The brand of the card.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The minimum quantity required for the wholesale price to be applied", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "maskedNumber", - "description": "The masked credit card number with only the last 4 digits displayed.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SubscriptionRecurringType", + "description": null, + "fields": [ + { + "name": "days", + "description": "The number of days of the recurring type.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderPaymentAdditionalInfoNode", - "description": null, - "fields": [ - { - "name": "key", - "description": "Additional information key.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The recurring type display name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recurringTypeId", + "description": "The recurring type id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SellerPrices", + "description": "The prices of the product.", + "fields": [ + { + "name": "installmentPlans", + "description": "List of the possibles installment plans.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SellerInstallmentPlan", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "listPrice", + "description": "The listed regular price of the product.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "price", + "description": "The current working price.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "value", - "description": "Additional information value.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductSubscriptionItemNode", + "description": null, + "fields": [ + { + "name": "name", + "description": "Display text.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recurringDays", + "description": "The number of days of the recurring type.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "OrderShippingProductNode", - "description": null, - "fields": [ - { - "name": "distributionCenterId", - "description": "Distribution center unique identifier.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "recurringTypeId", + "description": "The recurring type id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selected", + "description": "If selected.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } }, - { - "name": "price", - "description": "The product price.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroupDiscount", + "description": "Subscription group discount value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "productVariantId", - "description": "Variant unique identifier.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "subscriptionGroupId", + "description": "The subscription group id.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantity", - "description": "Quantity of the given product.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "BuyListProduct", - "description": "Contains the id and quantity of a product in the buy list.", - "fields": [ - { - "name": "productId", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "quantity", - "description": null, - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "InformationGroupFieldValueNode", - "description": null, - "fields": [ - { - "name": "order", - "description": "The information group field value order.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": "The information group field value.", - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "CheckoutProductCustomizationValueNode", + "description": null, + "fields": [ + { + "name": "cost", + "description": "The product customization cost.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "StocksInput", - "description": "Input to specify the range of stocks, distribution center ID, and distribution center name to return.", - "fields": null, - "inputFields": [ - { - "name": "dcId", - "description": "The distribution center Ids to match.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": "The product customization name.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "dcName", - "description": "The distribution center names to match.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The product customization value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "EmailAddress", + "description": "The EmailAddress scalar type constitutes a valid email address, represented as a UTF-8 character sequence. The scalar follows the specification defined by the HTML Spec https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "SCALAR", + "name": "CountryCode", + "description": "String representing a country code", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SellerInstallmentPlan", + "description": null, + "fields": [ + { + "name": "displayName", + "description": "The custom display name of this installment plan.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "stock_gte", - "description": "The product stock must be greater than or equal to.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "installments", + "description": "List of the installments.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "SellerInstallment", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Installment", + "description": null, + "fields": [ + { + "name": "discount", + "description": "Wether the installment has discount.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "stock_lte", - "description": "The product stock must be lesser than or equal to.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fees", + "description": "Wether the installment has fees.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Long", + "name": "Boolean", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "PricesInput", - "description": "Input to specify the range of prices to return.", - "fields": null, - "inputFields": [ - { - "name": "discount_gte", - "description": "The product discount must be greater than or equal to.", - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The number of installments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "Int", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "discount_lte", - "description": "The product discount must be lesser than or equal to.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the installment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Decimal", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "discounted", - "description": "Return only products where the listed price is more than the price.", - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeMatrixProduct", + "description": null, + "fields": [ + { + "name": "available", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "price_gte", - "description": "The product price must be greater than or equal to.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "productVariantId", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "Long", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "price_lte", - "description": "The product price must be lesser than or equal to.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "stock", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "Decimal", + "name": "Long", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "AttributeInput", - "description": "Input to specify which attributes to match.", - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The attribute Ids to match.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - } - }, - "defaultValue": null + } }, - { - "name": "name", - "description": "The attribute name to match.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeMatrixInfo", + "description": null, + "fields": [ + { + "name": "displayType", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "type", - "description": "The attribute type to match.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "name", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "value", - "description": "The attribute value to match", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "deliverySchedule", - "description": "A representation of available time slots for scheduling a delivery.", - "fields": [ - { - "name": "date", - "description": "The date of the delivery schedule.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "DateTime", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "values", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "AttributeMatrixRowColumnInfoValue", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeSelectionOptionValue", + "description": null, + "fields": [ + { + "name": "alias", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "periods", - "description": "The list of time periods available for scheduling a delivery.", - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "period", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "ShippingProduct", - "description": "The product informations related to the shipping.", - "fields": [ - { - "name": "productVariantId", - "description": "The product unique identifier.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "available", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "printUrl", + "description": null, + "args": [ + { + "name": "height", + "description": "The height of the image the url will return.", + "type": { "kind": "SCALAR", "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "value", - "description": "The shipping value related to the product.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "width", + "description": "The width of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "Float", + "name": "Int", "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "PartnerSubtype", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "OPEN", - "description": "Partner \u0027open\u0027 subtype.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CLOSED", - "description": "Partner \u0027closed\u0027 subtype.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "CLIENT", - "description": "Partner \u0027client\u0027 subtype.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "UriKind", - "description": null, - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "PRODUCT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "HOTSITE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "REDIRECT", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "NOT_FOUND", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "PARTNER", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "BUY_LIST", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CheckoutSubscriptionInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "recurringTypeId", - "description": null, - "type": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "selected", + "description": null, + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the attribute.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "LoginOrigin", + "description": "The user login origin.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "SOCIAL", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SIMPLE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "InformationGroupFieldValueNode", + "description": null, + "fields": [ + { + "name": "order", + "description": "The information group field value order.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The information group field value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "StocksInput", + "description": "Input to specify the range of stocks, distribution center ID, and distribution center name to return.", + "fields": null, + "inputFields": [ + { + "name": "dcId", + "description": "The distribution center Ids to match.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { "kind": "SCALAR", - "name": "Int", + "name": "Long", "ofType": null } - }, - "defaultValue": null + } + }, + "defaultValue": null + }, + { + "name": "dcName", + "description": "The distribution center names to match.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "stock_gte", + "description": "The product stock must be greater than or equal to.", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "stock_lte", + "description": "The product stock must be lesser than or equal to.", + "type": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "PricesInput", + "description": "Input to specify the range of prices to return.", + "fields": null, + "inputFields": [ + { + "name": "discount_gte", + "description": "The product discount must be greater than or equal to.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "discount_lte", + "description": "The product discount must be lesser than or equal to.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "discounted", + "description": "Return only products where the listed price is more than the price.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "price_gte", + "description": "The product price must be greater than or equal to.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "price_lte", + "description": "The product price must be lesser than or equal to.", + "type": { + "kind": "SCALAR", + "name": "Decimal", + "ofType": null }, - { - "name": "subscriptionGroupId", - "description": null, - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "CheckoutCustomizationInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "customizationId", - "description": null, - "type": { + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "AttributeInput", + "description": "Input to specify which attributes to match.", + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The attribute Ids to match.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -22660,675 +28976,1067 @@ "name": "Long", "ofType": null } - }, - "defaultValue": null + } }, - { - "name": "value", - "description": null, - "type": { + "defaultValue": null + }, + { + "name": "name", + "description": "The attribute name to match.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "LoginType", - "description": "The user login type.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NEW", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SIMPLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "AUTHENTICATED", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "Gender", - "description": "The customer\u0027s gender.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "MALE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "FEMALE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Question", - "description": null, - "fields": [ - { - "name": "answers", - "description": null, - "args": [], - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "OBJECT", - "name": "Answer", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "question", - "description": null, - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "type", + "description": "The attribute type to match.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "questionId", - "description": null, - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "value", + "description": "The attribute value to match", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "SCALAR", "name": "String", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "SimpleLoginType", - "description": "The simple login type.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "NEW", - "description": null, - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "SIMPLE", - "description": null, - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "ENUM", - "name": "EntityType", - "description": "Define the entity type of the customer registration.", - "fields": null, - "inputFields": null, - "interfaces": null, - "enumValues": [ - { - "name": "PERSON", - "description": "An individual person, a physical person.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "COMPANY", - "description": "Legal entity, a company, business, organization.", - "isDeprecated": false, - "deprecationReason": null - }, - { - "name": "INTERNATIONAL", - "description": "An international person, a legal international entity.", - "isDeprecated": false, - "deprecationReason": null - } - ], - "possibleTypes": null - }, - { - "kind": "INPUT_OBJECT", - "name": "InformationGroupValueInput", - "description": null, - "fields": null, - "inputFields": [ - { - "name": "id", - "description": "The information group field unique identifier.", - "type": { - "kind": "SCALAR", - "name": "ID", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "value", - "description": "The information group field value.", - "type": { + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "deliverySchedule", + "description": "A representation of available time slots for scheduling a delivery.", + "fields": [ + { + "name": "date", + "description": "The date of the delivery schedule.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "DateTime", "ofType": null - }, - "defaultValue": null - } - ], - "interfaces": null, - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SearchFilterItem", - "description": "Details of a filter value.", - "fields": [ - { - "name": "name", - "description": "The name of the value.", - "args": [], - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "periods", + "description": "The list of time periods available for scheduling a delivery.", + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "period", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "ShippingProduct", + "description": "The product informations related to the shipping.", + "fields": [ + { + "name": "productVariantId", + "description": "The product unique identifier.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "quantity", - "description": "The quantity of product with this value.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "Answer", - "description": null, - "fields": [ - { - "name": "id", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The shipping value related to the product.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Float", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "PartnerSubtype", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "OPEN", + "description": "Partner 'open' subtype.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLOSED", + "description": "Partner 'closed' subtype.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "CLIENT", + "description": "Partner 'client' subtype.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "UriKind", + "description": null, + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PRODUCT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "HOTSITE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "REDIRECT", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "NOT_FOUND", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "PARTNER", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "BUY_LIST", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutSubscriptionInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "recurringTypeId", + "description": "The recurring type id.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "period", - "description": "Represents a time period available for scheduling a delivery.", - "fields": [ - { - "name": "end", - "description": "The end time of the time period.", - "args": [], - "type": { + } + }, + "defaultValue": null + }, + { + "name": "subscriptionGroupId", + "description": "The subscription group id.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "id", - "description": "The unique identifier of the time period.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Long", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutCustomizationInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "customizationId", + "description": "The ID of a customization type related to the product.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "value", + "description": "The value of the applied customization.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutProductItemUpdateInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "customization", + "description": "The customizations of the product.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutCustomizationInput", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "customizationId", + "description": "The ID represents all customizations applied to the product. If it is a new customization, this field must be null, otherwise it must be inserted and must have the value.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "start", - "description": "The start time of the time period.", - "args": [], - "type": { + "defaultValue": null + }, + { + "name": "productVariantId", + "description": "The ID of the product variant.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "AttributeMatrixRowColumnInfoValue", - "description": null, - "fields": [ - { - "name": "printUrl", - "description": null, - "args": [ - { - "name": "height", - "description": "The height of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - }, - { - "name": "width", - "description": "The width of the image the url will return.", - "type": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - }, - "defaultValue": null - } - ], - "type": { + } + }, + "defaultValue": null + }, + { + "name": "quantity", + "description": "The quantity of the product.", + "type": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "subscription", + "description": "The checkout subscription.", + "type": { + "kind": "INPUT_OBJECT", + "name": "CheckoutSubscriptionInput", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SearchFilterItem", + "description": "Details of a filter value.", + "fields": [ + { + "name": "name", + "description": "The name of the value.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "quantity", + "description": "The quantity of product with this value.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Int", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null + } }, - { - "name": "value", - "description": null, - "args": [], - "type": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitProductInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "productId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Long", "ofType": null - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - }, - { - "kind": "OBJECT", - "name": "SellerInstallment", - "description": null, - "fields": [ - { - "name": "discount", - "description": "Wether the installment has discount.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + } + }, + "defaultValue": null + }, + { + "name": "variants", + "description": null, + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitVariantInput", + "ofType": null + } }, - { - "name": "fees", - "description": "Wether the installment has fees.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Boolean", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "LoginType", + "description": "The user login type.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NEW", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SIMPLE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "AUTHENTICATED", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Question", + "description": null, + "fields": [ + { + "name": "answers", + "description": null, + "args": [], + "type": { + "kind": "LIST", + "name": null, + "ofType": { + "kind": "OBJECT", + "name": "Answer", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "question", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "number", - "description": "The number of installments.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "questionId", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null }, - { - "name": "value", - "description": "The value of the installment.", - "args": [], - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Decimal", - "ofType": null - } - }, - "isDeprecated": false, - "deprecationReason": null - } - ], - "inputFields": null, - "interfaces": [], - "enumValues": null, - "possibleTypes": null - } - ], - "directives": [ - { - "name": "skip", - "description": "Directs the executor to skip this field or fragment when the \u0060if\u0060 argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Skipped when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "SimpleLoginType", + "description": "The simple login type.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "NEW", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "SIMPLE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "EntityType", + "description": "Define the entity type of the customer registration.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "PERSON", + "description": "An individual person, a physical person.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "COMPANY", + "description": "Legal entity, a company, business, organization.", + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "INTERNATIONAL", + "description": "An international person, a legal international entity.", + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "ENUM", + "name": "Gender", + "description": "The customer's gender.", + "fields": null, + "inputFields": null, + "interfaces": null, + "enumValues": [ + { + "name": "MALE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "FEMALE", + "description": null, + "isDeprecated": false, + "deprecationReason": null + } + ], + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "InformationGroupValueInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "id", + "description": "The information group field unique identifier.", + "type": { + "kind": "SCALAR", + "name": "ID", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "value", + "description": "The information group field value.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "Answer", + "description": null, + "fields": [ + { + "name": "id", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "INPUT_OBJECT", + "name": "CheckoutKitVariantInput", + "description": null, + "fields": null, + "inputFields": [ + { + "name": "productVariantId", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "defaultValue": null + }, + { + "name": "quantity", + "description": null, + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": null + } + ], + "interfaces": null, + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "period", + "description": "Represents a time period available for scheduling a delivery.", + "fields": [ + { + "name": "end", + "description": "The end time of the time period.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "id", + "description": "The unique identifier of the time period.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Long", + "ofType": null + } + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "start", + "description": "The start time of the time period.", + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "AttributeMatrixRowColumnInfoValue", + "description": null, + "fields": [ + { + "name": "printUrl", + "description": null, + "args": [ + { + "name": "height", + "description": "The height of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } + }, + "defaultValue": null }, - "defaultValue": null - } - ] - }, - { - "name": "include", - "description": "Directs the executor to include this field or fragment only when the \u0060if\u0060 argument is true.", - "locations": [ - "FIELD", - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Included when true.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { + { + "name": "width", + "description": "The width of the image the url will return.", + "type": { "kind": "SCALAR", - "name": "Boolean", + "name": "Int", "ofType": null - } - }, - "defaultValue": null - } - ] - }, - { - "name": "defer", - "description": "The \u0060@defer\u0060 directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with \u0060@defer\u0060 directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. \u0060@include\u0060 and \u0060@skip\u0060 take precedence over \u0060@defer\u0060.", - "locations": [ - "FRAGMENT_SPREAD", - "INLINE_FRAGMENT" - ], - "args": [ - { - "name": "if", - "description": "Deferred when true.", - "type": { + }, + "defaultValue": null + } + ], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": null, + "args": [], + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + }, + { + "kind": "OBJECT", + "name": "SellerInstallment", + "description": null, + "fields": [ + { + "name": "discount", + "description": "Wether the installment has discount.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "label", - "description": "If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to.", - "type": { - "kind": "SCALAR", - "name": "String", - "ofType": null - }, - "defaultValue": null - } - ] - }, - { - "name": "stream", - "description": "The \u0060@stream\u0060 directive may be provided for a field of \u0060List\u0060 type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. \u0060@include\u0060 and \u0060@skip\u0060 take precedence over \u0060@stream\u0060.", - "locations": [ - "FIELD" - ], - "args": [ - { - "name": "if", - "description": "Streamed when true.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "fees", + "description": "Wether the installment has fees.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "initialCount", - "description": "The initial elements that shall be send down to the consumer.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "Int", - "ofType": null - } - }, - "defaultValue": "0" + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "number", + "description": "The number of installments.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } }, - { - "name": "label", - "description": "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to.", - "type": { + "isDeprecated": false, + "deprecationReason": null + }, + { + "name": "value", + "description": "The value of the installment.", + "args": [], + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Decimal", "ofType": null - }, - "defaultValue": null - } - ] - }, - { - "name": "deprecated", - "description": "The @deprecated directive is used within the type system definition language to indicate deprecated portions of a GraphQL service\u2019s schema,such as deprecated fields on a type or deprecated enum values.", - "locations": [ - "FIELD_DEFINITION", - "ENUM_VALUE" - ], - "args": [ - { - "name": "reason", - "description": "Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).", - "type": { + } + }, + "isDeprecated": false, + "deprecationReason": null + } + ], + "inputFields": null, + "interfaces": [], + "enumValues": null, + "possibleTypes": null + } + ], + "directives": [ + { + "name": "skip", + "description": "Directs the executor to skip this field or fragment when the `if` argument is true.", + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Skipped when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": "\u0022No longer supported.\u0022" - } - ] - }, - { - "name": "authorize", - "description": null, - "locations": [ - "SCHEMA", - "OBJECT", - "FIELD_DEFINITION" - ], - "args": [ - { - "name": "apply", - "description": "Defines when when the resolver shall be executed.By default the resolver is executed after the policy has determined that the current user is allowed to access the field.", - "type": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "ENUM", - "name": "ApplyPolicy", - "ofType": null - } - }, - "defaultValue": "BEFORE_RESOLVER" + } }, - { - "name": "policy", - "description": "The name of the authorization policy that determines access to the annotated resource.", - "type": { + "defaultValue": null + } + ] + }, + { + "name": "include", + "description": "Directs the executor to include this field or fragment only when the `if` argument is true.", + "locations": [ + "FIELD", + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Included when true.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { "kind": "SCALAR", - "name": "String", + "name": "Boolean", "ofType": null - }, - "defaultValue": null + } }, - { - "name": "roles", - "description": "Roles that are allowed to access the annotated resource.", - "type": { - "kind": "LIST", - "name": null, - "ofType": { - "kind": "NON_NULL", - "name": null, - "ofType": { - "kind": "SCALAR", - "name": "String", - "ofType": null - } - } - }, - "defaultValue": null - } - ] - }, - { - "name": "specifiedBy", - "description": "The \u0060@specifiedBy\u0060 directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions.", - "locations": [ - "SCALAR" - ], - "args": [ - { - "name": "url", - "description": "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types.", - "type": { + "defaultValue": null + } + ] + }, + { + "name": "defer", + "description": "The `@defer` directive may be provided for fragment spreads and inline fragments to inform the executor to delay the execution of the current fragment to indicate deprioritization of the current fragment. A query with `@defer` directive will cause the request to potentially return multiple responses, where non-deferred data is delivered in the initial response and data deferred is delivered in a subsequent response. `@include` and `@skip` take precedence over `@defer`.", + "locations": [ + "FRAGMENT_SPREAD", + "INLINE_FRAGMENT" + ], + "args": [ + { + "name": "if", + "description": "Deferred when true.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "label", + "description": "If this argument label has a value other than null, it will be passed on to the result of this defer directive. This label is intended to give client applications a way to identify to which fragment a deferred result belongs to.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ] + }, + { + "name": "stream", + "description": "The `@stream` directive may be provided for a field of `List` type so that the backend can leverage technology such as asynchronous iterators to provide a partial list in the initial response, and additional list items in subsequent responses. `@include` and `@skip` take precedence over `@stream`.", + "locations": [ + "FIELD" + ], + "args": [ + { + "name": "if", + "description": "Streamed when true.", + "type": { + "kind": "SCALAR", + "name": "Boolean", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "initialCount", + "description": "The initial elements that shall be send down to the consumer.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "Int", + "ofType": null + } + }, + "defaultValue": "0" + }, + { + "name": "label", + "description": "If this argument label has a value other than null, it will be passed on to the result of this stream directive. This label is intended to give client applications a way to identify to which fragment a streamed result belongs to.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + } + ] + }, + { + "name": "deprecated", + "description": "The @deprecated directive is used within the type system definition language to indicate deprecated portions of a GraphQL service’s schema,such as deprecated fields on a type or deprecated enum values.", + "locations": [ + "FIELD_DEFINITION", + "ENUM_VALUE" + ], + "args": [ + { + "name": "reason", + "description": "Deprecations include a reason for why it is deprecated, which is formatted using Markdown syntax (as specified by CommonMark).", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": "\"No longer supported.\"" + } + ] + }, + { + "name": "authorize", + "description": null, + "locations": [ + "SCHEMA", + "OBJECT", + "FIELD_DEFINITION" + ], + "args": [ + { + "name": "apply", + "description": "Defines when when the resolver shall be executed.By default the resolver is executed after the policy has determined that the current user is allowed to access the field.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "ENUM", + "name": "ApplyPolicy", + "ofType": null + } + }, + "defaultValue": "BEFORE_RESOLVER" + }, + { + "name": "policy", + "description": "The name of the authorization policy that determines access to the annotated resource.", + "type": { + "kind": "SCALAR", + "name": "String", + "ofType": null + }, + "defaultValue": null + }, + { + "name": "roles", + "description": "Roles that are allowed to access the annotated resource.", + "type": { + "kind": "LIST", + "name": null, + "ofType": { "kind": "NON_NULL", "name": null, "ofType": { @@ -23336,12 +30044,35 @@ "name": "String", "ofType": null } - }, - "defaultValue": null - } - ] - } - ] - } + } + }, + "defaultValue": null + } + ] + }, + { + "name": "specifiedBy", + "description": "The `@specifiedBy` directive is used within the type system definition language to provide a URL for specifying the behavior of custom scalar definitions.", + "locations": [ + "SCALAR" + ], + "args": [ + { + "name": "url", + "description": "The specifiedBy URL points to a human-readable specification. This field will only read a result for scalar types.", + "type": { + "kind": "NON_NULL", + "name": null, + "ofType": { + "kind": "SCALAR", + "name": "String", + "ofType": null + } + }, + "defaultValue": null + } + ] + } + ] } } diff --git a/wake/utils/openapi/wake.openapi.gen.ts b/wake/utils/openapi/wake.openapi.gen.ts index a5e0910a7..0422781c6 100644 --- a/wake/utils/openapi/wake.openapi.gen.ts +++ b/wake/utils/openapi/wake.openapi.gen.ts @@ -1,9991 +1,9858 @@ + +// deno-fmt-ignore-file // deno-lint-ignore-file no-explicit-any ban-types ban-unused-ignore // // DO NOT EDIT. This file is generated by deco. // This file SHOULD be checked into source version control. // To generate this file: deno task start -// +// + export interface OpenAPI { - /** - * Últimos Pedidos - */ - "GET /dashboard/pedidos": { - response: { - pedidoId?: number; - situacaoPedidoId?: number; - situacaoNome?: string; - data?: string; - dataFormatado?: string; - hora?: string; - valorTotal?: string; - }[]; - }; - /** - * Lista de hotsites vinculados ao banner - */ - "GET /banners/:bannerId/hotsites": { - response: { - exibirEmTodosHotSites?: boolean; - hotSites?: { - hotSiteId?: number; - }[]; - }; - }; - /** - * Vincula hotsites com um banner específico - */ - "POST /banners/:bannerId/hotsites": { - body: { - /** - * lista de identificadores de hotsites a serem vinculados ao banner - */ - RAW_BODY?: { - /** - * Id do hotsite (optional) - */ - hotSiteId?: number; - }[]; - }; - }; - /** - * Atualiza a exibição do banner nos hotsites, se deve ser em todos ou não - */ - "PUT /banners/:bannerId/hotsites": { - body: { - /** - * Exibição do banner nos hotsites - */ - exibirEmTodosHotsites?: boolean; - }; - }; - /** - * Deleta o vinculo de um ou mais hotsites com um banner específico - */ - "DELETE /banners/:bannerId/hotsites": { - body: { - /** - * Lista de identificadores de hotsites para desvincular do banner (optional) - */ - listaHotsites?: { - /** - * Id do hotsite para vinculo com banner - */ - hotSiteId?: { - /** - * Id do hotsite para vinculo com banner - */ - hotSiteId?: any[]; - }[]; - }; - }; - }; - /** - * Retorna se o usuário ativou o recebimento de newsletter - */ - "GET /usuarios/:email/comunicacao": { - response: { - recebimentoNewsletter?: boolean; - }; - }; - /** - * Atualiza a comunicação de um usuário via newsletter - */ - "PUT /usuarios/:email/comunicacao": { - body: { - /** - * Novo status da comunicação via new ajuste realisletter - */ - recebimentoNewsletter?: boolean; - }; - }; - /** - * Buscar autor por id - */ - "GET /autores/:autorId": {}; - /** - * Atualizar autor - */ - "PUT /autores/:autorId": { - body: { - /** - * Nome do Autor - */ - nome?: string; - /** - * Status do autor - */ - ativo?: boolean; - }; - }; - /** - * Deletar autor - */ - "DELETE /autores/:autorId": {}; - /** - * Retorna lista contendo os Id's dos pedidos do usuário - */ - "GET /usuarios/:email/pedidos": { - response: { - pedidoId?: number; - links?: { - href?: string; - rel?: string; - method?: string; - }[]; - }[]; - }; - /** - * Usuário encontrado - */ - "GET /usuarios/cpf/:cpf": { - response: { - usuarioId?: number; - bloqueado?: boolean; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - avatar?: string; - ip?: string; - aprovado?: boolean; - }; - }; - /** - * Loja Física - */ - "GET /lojasFisicas/:lojaFisicaId": { - response: { - lojaId?: number; - nome?: string; - ddd?: number; - telefone?: string; - email?: string; - cep?: string; - logradouro?: string; - numero?: string; - complemento?: string; - bairro?: string; - cidade?: string; - estadoId?: number; - prazoEntrega?: number; - prazoMaximoRetirada?: number; - ativo?: boolean; - valido?: boolean; - textoComplementar?: string; - retirarNaLoja?: boolean; - latitude?: number; - longitude?: number; - centroDistribuicaoId?: number; - centroDistribuicao?: { - centroDistribuicaoId?: number; - prazoEntrega?: number; - }[]; - }; - }; - /** - * Atualiza uma Loja Física - */ - "PUT /lojasFisicas/:lojaFisicaId": { - body: { - /** - * Id da loja (optional) - */ - lojaId?: number; - /** - * Nome da loja (optional) - */ - nome?: string; - /** - * DDD da localidade de destino da loja (optional) - */ - ddd?: number; - /** - * Telefone da loja (optional) - */ - telefone?: string; - /** - * E-mail de contato da loja (optional) - */ - email?: string; - /** - * CEP do endereço da loja (optional) - */ - cep?: string; - /** - * Logradouro do endereço da loja (optional) - */ - logradouro?: string; - /** - * Número de localização do endereço da loja (optional) - */ - numero?: string; - /** - * Complemento para localização da loja (optional) - */ - complemento?: string; - /** - * Bairro do endereço do loja (optional) - */ - bairro?: string; - /** - * Cidade em que a loja se encontra (optional) - */ - cidade?: string; - /** - * Id do estado em que a loja se encontra (optional) - */ - estadoId?: number; - /** - * Prazo de entrega (optional) - */ - prazoEntrega?: number; - /** - * Prazo máximo para retirada (optional) - */ - prazoMaximoRetirada?: number; - /** - * Status da loja (optional) - */ - ativo?: boolean; - /** - * Valido (optional) - */ - valido?: boolean; - /** - * Informações complementares da loja (optional) - */ - textoComplementar?: string; - /** - * Se a retirada na loja será ativada (optional) - */ - retirarNaLoja?: boolean; - /** - * Latitude (optional) - */ - latitude?: number; - /** - * Longitude (optional) - */ - longitude?: number; - /** - * Lista com os Identificadores dos centros de distribuição que serão vinculados a loja física (optional) - */ - centroDistribuicao?: { - /** - * Id do centro de distribuição - */ - centroDistribuicaoId?: number; - /** - * Prazo de entrega - */ - prazoEntrega?: number; - }[]; - }; - }; - /** - * Remove uma Loja Física - */ - "DELETE /lojasFisicas/:lojaFisicaId": {}; - /** - * Atributo encontrado - */ - "GET /atributos/:nome": { - response: { - nome?: string; - tipo?: string; - tipoExibicao?: string; - prioridade?: number; - }; - }; - /** - * Atualiza um atributo - */ - "PUT /atributos/:nome": { - body: { - /** - * Nome do atributo (optional) - */ - nome?: string; - /** - * Tipo do atributo (optional) - */ - tipo?: - | "Selecao" - | "Filtro" - | "Comparacao" - | "Configuracao" - | "ExclusivoGoogle"; - /** - * Tipo de exibição (optional) - */ - tipoExibicao?: - | "Combo" - | "Div" - | "DivComCor" - | "DivComFotoDoProdutoVariante" - | "Javascript"; - /** - * Prioridade do atributo (optional) - */ - prioridade?: number; - }; - }; - /** - * Deleta um atributo - */ - "DELETE /atributos/:nome": {}; - /** - * Lista de resellers - */ - "GET /resellers": { - response: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }[]; - }; - /** - * Insere um novo Seller no marketplace - */ - "POST /resellers": { - body: { - /** - * Razão Social/Nome do Reseller - */ - razaoSocial?: string; - /** - * CNPJ do Seller - */ - cnpj?: string; - /** - * Inscrição Estadual do Seller - */ - inscricaoEstadual?: string; - /** - * Seller isento de inscrição estadual - */ - isento?: boolean; - /** - * Email de contato do Seller - */ - email?: string; - /** - * Telefone de contato do seller com ddd (xx) xxxx-xxxx - */ - telefone?: string; - /** - * Tipo de autonomia do vendedor - */ - tipoAutonomia?: "ComAutonomia" | "SemAutonomia"; - /** - * Seller Ativo - */ - ativo?: boolean; - /** - * Se irá ter Split de frete boolean. Default:false - */ - split?: boolean; - /** - * Se o produto deverá ser apresentado em BuyBox (apenas para Seller's e Marketplace's TrayCorp) boolean. Default:false, - */ - buyBox?: boolean; - /** - * Se os produtos deverão sem ativados automaticamente no marketplace boolean. Default:false, - */ - ativacaoAutomaticaProdutos?: boolean; - /** - * Cep do Seller (utilizado para o calculo de frete) - */ - cep?: string; - }; - }; - /** - * Atualiza um novo Seller no marketplace - */ - "PUT /resellers": { - searchParams: { - /** - * Valor único utilizado para identificar o seller - */ - resellerId?: number; - }; - body: { - /** - * Razão Social/Nome do Reseller - */ - razaoSocial?: string; - /** - * CNPJ do Seller - */ - cnpj?: string; - /** - * Inscrição Estadual do Seller - */ - inscricaoEstadual?: string; - /** - * Seller isento de inscrição estadual - */ - isento?: boolean; - /** - * Email de contato do Seller - */ - email?: string; - /** - * Telefone de contato do seller com ddd (xx) xxxx-xxxx - */ - telefone?: string; - /** - * Tipo de autonomia do vendedor - */ - tipoAutonomia?: "ComAutonomia" | "SemAutonomia"; - /** - * Seller Ativo - */ - ativo?: boolean; - /** - * Se irá ter Split de frete boolean. Default:false - */ - split?: boolean; - /** - * Se o produto deverá ser apresentado em BuyBox (apenas para Seller's e Marketplace's TrayCorp) boolean. Default:false, - */ - buyBox?: boolean; - /** - * Se os produtos deverão sem ativados automaticamente no marketplace boolean. Default:false, - */ - ativacaoAutomaticaProdutos?: boolean; - /** - * Cep do Seller (utilizado para o calculo de frete) - */ - cep?: string; - }; - }; - /** - * Reseller específico - */ - "GET /resellers/:resellerId": { - response: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }; - }; - /** - * Lista de produtos - */ - "GET /produtos": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Lista de categorias que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as categorias - */ - categorias?: string; - /** - * Lista de fabricantes que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as situações - */ - fabricantes?: string; - /** - * Lista de centros de distribuição que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará produtos de todos os cd's - */ - centrosDistribuicao?: string; - /** - * Retorna apenas os produtos que sofreram alguma alteração a partir da data/hora informada. Formato: aaaa-mm-dd hh:mm:ss com no máximo 48 horas de antecedência - */ - alteradosPartirDe?: string; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Retorna apenas os produtos que estão marcados como válido - */ - somenteValidos?: boolean; - /** - * Campos adicionais que se selecionados retornaram junto com o produto, valores aceitos: Atacado, Estoque, Atributo , Informacao, TabelaPreco - */ - camposAdicionais?: string[]; - }; - response: { - produtoVarianteId?: number; - produtoId?: number; - idPaiExterno?: string; - idVinculoExterno?: string; - sku?: string; - nome?: string; - nomeProdutoPai?: string; - urlProduto?: string; - exibirMatrizAtributos?: string; - contraProposta?: boolean; - fabricante?: string; - autor?: string; - editora?: string; - colecao?: string; - genero?: string; - precoCusto?: number; - precoDe?: number; - precoPor?: number; - fatorMultiplicadorPreco?: number; - prazoEntrega?: number; - valido?: boolean; - exibirSite?: boolean; - freteGratis?: string; - trocaGratis?: boolean; - peso?: number; - altura?: number; - comprimento?: number; - largura?: number; - garantia?: number; - isTelevendas?: boolean; - ean?: string; - localizacaoEstoque?: string; - listaAtacado?: { - precoPor?: number; - quantidade?: number; - }[]; - estoque?: { - estoqueFisico?: number; - estoqueReservado?: number; - centroDistribuicaoId?: number; - alertaEstoque?: number; - }[]; - atributos?: { - tipoAtributo?: string; - isFiltro?: boolean; - nome?: string; - valor?: string; - exibir?: boolean; - }[]; - quantidadeMaximaCompraUnidade?: number; - quantidadeMinimaCompraUnidade?: number; - condicao?: string; - informacoes?: { - informacaoId?: number; - titulo?: string; - texto?: string; - tipoInformacao?: string; - }[]; - tabelasPreco?: { - tabelaPrecoId?: number; - nome?: string; - precoDe?: number; - precoPor?: number; - }[]; - dataCriacao?: string; - dataAtualizacao?: string; - urlVideo?: string; - spot?: boolean; - paginaProduto?: boolean; - marketplace?: boolean; - somenteParceiros?: boolean; - reseller?: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }; - buyBox?: boolean; - consumo?: { - quantidadeDias?: number; - enviarEmail?: boolean; - }; - prazoValidade?: number; - }[]; - }; - /** - * Método que insere um produto na base - */ - "POST /produtos": { - body: { - /** - * Representa o ProdutoId agrupador por variante (optional) - */ - idPaiExterno?: string; - /** - * Representa o ParentId agrupador por parent (optional) - */ - idVinculoExterno?: string; - /** - * (Max Length: 50) Sku do produto - */ - sku?: string; - /** - * (Max Length: 300) Nome do produto variante - */ - nome?: string; - /** - * Nome do produto (pai do variante) (optional) - */ - nomeProdutoPai?: string; - /** - * Tipo de exibição da matriz de atributos (optional) - */ - exibirMatrizAtributos?: "Sim" | "Nao" | "Neutro"; - /** - * Se o produto aceita contra proposta (optional) - */ - contraProposta?: boolean; - /** - * (Max Length: 100) Nome do fabricante - */ - fabricante?: string; - /** - * (Max Length: 500) Nome do autor (optional) - */ - autor?: string; - /** - * (Max Length: 100) Nome da editora (optional) - */ - editora?: string; - /** - * (Max Length: 100) Nome da coleção (optional) - */ - colecao?: string; - /** - * (Max Length: 100) Nome do gênero (optional) - */ - genero?: string; - /** - * Max Length: 8, "0000.0000,00") Preço de custo do produto variante (optional) - */ - precoCusto?: number; - /** - * (Max Length: 8, "0000.0000,00") "Preço De" do produto variante (optional) - */ - precoDe?: number; - /** - * (Max Length: 8, "0000.0000,00") "Preço Por" de venda do produto variante - */ - precoPor?: number; - /** - * (Max Length: 8, "0000.0000,00") Fator multiplicador que gera o preço de exibição do produto.Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) (optional) - */ - fatorMultiplicadorPreco?: number; - /** - * Prazo de entrega do produto variante (optional) - */ - prazoEntrega?: number; - /** - * Define se um produto variante é valido ou não - */ - valido?: boolean; - /** - * Define se um produto deve ser exibido no site - */ - exibirSite?: boolean; - /** - * Define a qual regra de calculo de frete o produto vai pertencer - */ - freteGratis?: "Sempre" | "Nunca" | "Neutro" | "Desconsiderar_Regras"; - /** - * Define se o produto variante tem troca grátis (optional) - */ - trocaGratis?: boolean; - /** - * (Max Length: 8, "0000.0000,00") Peso do produto variante, em gramas (g). - */ - peso?: number; - /** - * (Max Length: 8, "0000.0000,00") Altura do produto variante, em centímetros (cm). - */ - altura?: number; - /** - * (Max Length: 8, "0000.0000,00") Comprimento do produto variante, em centímetros (cm). - */ - comprimento?: number; - /** - * (Max Length: 8, "0000.0000,00") Largura do produto variante, em centímetros (cm). - */ - largura?: number; - /** - * Define se o produto variante tem garantia (optional) - */ - garantia?: number; - /** - * Define se o produto contém televendas (optional) - */ - isTelevendas?: boolean; - /** - * (Max Length: 25) EAN do produto variante (optional) - */ - ean?: string; - /** - * (Max Length: 255) Localização no estoque do produto variante (optional) - */ - localizacaoEstoque?: string; - /** - * Dados de atacado do produto variante (optional) - */ - listaAtacado?: { - /** - * (Max Length: 8, "0000.0000,00") - Preco Por do item por atacado - */ - precoPor?: number; - /** - * Quantidade para compra de atacado - */ - quantidade?: number; - }[]; - /** - * Lista de estoque/centro de distribuição do produto. Obrigatório se valido for true (optional) - */ - estoque?: { - /** - * Estoque físico do produto - */ - estoqueFisico?: number; - /** - * Estoque reservado do produto - */ - estoqueReservado?: number; - /** - * Id do centro de distribuição do estoque do produto - */ - centroDistribuicaoId?: number; - /** - * Quantidade para ativar o alerta de estoque - */ - alertaEstoque?: number; - }[]; - /** - * Lista de atributos do produto - */ - listaAtributos?: { - /** - * (Max Length: 100) - Define o nome do atributo - */ - nome?: string; - /** - * (Max Length: 8, "0000.0000,00") - Define o valor do atributo - */ - valor?: string; - /** - * Define se o atributo deverá ser exibido - */ - exibir?: boolean; - }[]; - /** - * Quantidade máxima de compra do produto variante (optional) - */ - quantidadeMaximaCompraUnidade?: number; - /** - * Quantidade mínima de compra do produto variante (optional) - */ - quantidadeMinimaCompraUnidade?: number; - /** - * Condição do produto variante (optional) - */ - condicao?: "Novo" | "Usado" | "Renovado" | "Danificado"; - /** - * Url do vídeo do Produto (optional) - */ - urlVideo?: string; - /** - * Se o produto aparece no Spot (optional) - */ - spot?: boolean; - /** - * Se o produto aparece na Url (optional) - */ - paginaProduto?: boolean; - /** - * Se o produto aparece no Marketplace (optional) - */ - marketplace?: boolean; - /** - * Se o produto aparece somente nos Parceiros (optional) - */ - somenteParceiros?: boolean; - /** - * Se o produto deve ser agrupado pelo EAN (optional) - */ - buyBox?: boolean; - /** - * Prazo de validade ou consumo do produto (optional) - */ - prazoValidade?: number; - /** - * Dados de consumo de produto e se deve enviar os dias de consumo por e-mail. - */ - consumo?: { - /** - * Quantidade de Dias (optional) - */ - quantidadeDias?: number; - /** - * Enviar e-mail (optional) - */ - enviarEmail?: boolean; - }; - }; - }; - /** - * Remove um produto de uma tabela de preço - */ - "DELETE /tabelaPrecos/:tabelaPrecoId/:sku": {}; - /** - * Atualiza o frete de todos os produtos de um pedido - */ - "PUT /pedidos/:pedidoId/changeseller": { - body: { - /** - * Objeto com os dados de cotação e responsável - */ - RAW_BODY: { - /** - * ID da cotação retornada em GET /fretes/pedidos/{pedidoId}/cotacoes - */ - cotacao?: string; - /** - * Responsável pela cotação - */ - responsavel?: string; - }; - }; - }; - /** - * Objeto do banner - */ - "GET /banners/:bannerId": { - response: { - id?: number; - nome?: string; - dataInicio?: string; - dataFim?: string; - ativo?: boolean; - detalhe?: { - posicionamentoId?: number; - urlBanner?: string; - imagemBanner?: { - nome?: string; - base64?: string; - formato?: string; - }; - ordemExibicao?: number; - abrirBannerNovaAba?: boolean; - largura?: number; - altura?: number; - title?: string; - urlClique?: string; - urlBannerAlternativo?: string; - titleAlternativo?: string; - diasExibicao?: { - todosDias?: boolean; - domingo?: boolean; - segunda?: boolean; - terca?: boolean; - quarta?: boolean; - quinta?: boolean; - sexta?: boolean; - sabado?: boolean; - }; - textoAlternativo?: string; - }; - apresentacao?: { - exibirNoSite?: boolean; - exibirEmTodasBuscas?: boolean; - naoExibirEmBuscas?: boolean; - termosBusca?: string; - listaHotsites?: { - exibirEmTodosHotSites?: boolean; - hotSites?: { - hotSiteId?: number; - }[]; - }; - exibirEmTodasCategorias?: boolean; - listaParceiros?: { - exibirEmTodosParceiros?: boolean; - parceiros?: { - parceiroId?: number; - }[]; - }; - }; - }; - }; - /** - * Atualiza um banner existente - */ - "PUT /banners/:bannerId": { - body: { - /** - * Nome do banner - */ - nome?: string; - /** - * Data de inicio de exibição do banner - */ - dataInicio?: string; - /** - * Data de termino de exibição do banner (optional) - */ - dataFim?: string; - /** - * Banner ativo/inativo (optional) - */ - ativo?: boolean; - /** - * Detalhes do banner - */ - detalhe?: { - /** - * Local de posicionamento do banner - */ - posicionamentoId?: number; - /** - * Imagem do banner (caso o campo "UrlBanner" estiver preenchido esse campo será desconsiderado) (optional) - */ - imagemBanner?: { - /** - * string da imagem em base 64 - */ - base64?: string; - /** - * formato da imagem - */ - formato?: "PNG" | "JPG" | "JPEG"; - /** - * nome da imagem - */ - nome?: string; - }; - /** - * Url de onde o banner deve ser carregado (Ex.: http://www.site.com.br/banner.swf). O Banner poderá ser do tipo flash ou imagem (optional) - */ - urlBanner?: string; - /** - * Ordem de exibição do banner (optional) - */ - ordemExibicao?: number; - /** - * Se o banner deve ou não abrir em nova aba (optional) - */ - abrirLinkNovaAba?: boolean; - /** - * Largura do banner em pixels (optional) - */ - largura?: number; - /** - * Altura do banner em pixels (optional) - */ - altura?: number; - /** - * Title da imagem do banner (optional) - */ - title?: string; - /** - * Url de destino para quando o usuário clicar no Banner (optional) - */ - urlClique?: string; - /** - * URL para um Banner alternativo que será exibido caso ocorra algum problema para exibição do Banner (optional) - */ - urlBannerAlternativo?: string; - /** - * Title alternativo que será exibido caso ocorra algum problema para a exibição do Banner - */ - textoAlternativo?: string; - }; - /** - * Dias da semana que o banner deverá ser exibido (optional) - */ - diasExibicao?: { - /** - * Se o banner deverá ser exibido todos os dias (caso esse campo estiver preenchido como "true" os demais serão desconsiderados) - */ - todosDias?: boolean; - /** - * Se o banner deverá ser apresentado no domingo - */ - domingo?: boolean; - /** - * Se o banner deverá ser apresentado na segunda - */ - segunda?: boolean; - /** - * Se o banner deverá ser apresentado na terça - */ - terca?: boolean; - /** - * Se o banner deverá ser apresentado na quarta - */ - quarta?: boolean; - /** - * Se o banner deverá ser apresentado na quinta - */ - quinta?: boolean; - /** - * Se o banner deverá ser apresentado na sexta - */ - sexta?: boolean; - /** - * Se o banner deverá ser apresentado no sábado - */ - sabado?: boolean; - }; - /** - * Apresentação do banner (optional) - */ - apresentacao?: { - /** - * Se o banner deverá ser exibido em todo o site - */ - exibirNoSite?: boolean; - /** - * Se o banner deverá ser exibido em todas as buscas - */ - exibirEmTodasBuscas?: boolean; - /** - * Se o banner não deverá ser exibido em nenhuma busca (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) - */ - naoExibirEmBuscas?: boolean; - /** - * Termos que o banner será exibido na busca - */ - termosBusca?: string; - /** - * Se o banner deverá ser exibido em todas categorias (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) - */ - exibirEmTodasCategorias?: boolean; - /** - * Em quais hotsites o banner deve ser exibido - */ - listaHotsites?: { - /** - * Se o banner deverá ser exibido em todos as hotsite's (Caso esse campo estiver como "true" o campo HotSites será desconsiderado) (optional) - */ - exibirEmTodosHotsites?: boolean; - /** - * Lista de hotsite's que o banner será exibido - */ - hotsites?: { - /** - * Id do hotsite (optional) - */ - hotSiteId?: number; - }[]; - }; - }; - /** - * Em quais parceiros o banner deve ser exibido - */ - listaParceiros?: { - /** - * Se o banner deverá ser exibido em todos parceiros (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) (optional) - */ - exibirEmTodosParceiros?: boolean; - /** - * Lista de parceiros que o banner será exibido - */ - parceiros?: { - /** - * Id do parceiro (optional) - */ - parceiroId?: number; - }[]; - }; - }; - }; - /** - * Deleta um banner existente - */ - "DELETE /banners/:bannerId": {}; - /** - * Atualiza um produto em uma assinatura - */ - "PUT /assinaturas/produtos/:assinaturaProdutoId/Alterar": { - body: { - /** - * Novo valor do produto na assinatura (optional) - */ - valor?: number; - /** - * Se o produto será considerado removido ou não da assinatura (optional) - */ - removido?: boolean; - /** - * Quantidade do produto na assinatura (optional) - */ - quantidade?: number; - }; - }; - /** - * Parceiro encontrado - */ - "GET /parceiros/:parceiroId": { - response: { - parceiroId?: number; - marketPlaceId?: number; - nome?: string; - tabelaPrecoId?: number; - portfolioId?: number; - tipoEscopo?: string; - ativo?: boolean; - isMarketPlace?: boolean; - origem?: string; - }; - }; - /** - * Parceiro atualizado com sucesso - */ - "PUT /parceiros/:parceiroId": { - body: { - /** - * Nome do parceiro - */ - nome?: string; - /** - * Id da tabela de preço (optional) - */ - tabelaPrecoId?: number; - /** - * Id do portfolio (optional) - */ - portfolioId?: number; - /** - * Tipo de escopo - */ - tipoEscopo?: 'Aberto"' | "Fechado" | "PorCliente"; - /** - * Status do parceiro - */ - ativo?: boolean; - /** - * Se o parceiro é marketplace (optional) - */ - isMarketPlace?: boolean; - /** - * Origem (optional) - */ - origem?: string; - /** - * alias (optional) - */ - alias?: string; - }; - response: { - resultadoOperacao?: boolean; - codigo?: number; - mensagem?: string; - }[]; - }; - /** - * Parceiro excluído com sucesso - */ - "DELETE /parceiros/:parceiroId": { - response: { - resultadoOperacao?: boolean; - codigo?: number; - mensagem?: string; - }; - }; - /** - * Lista de parceiros - */ - "GET /parceiros": { - response: { - parceiroId?: number; - marketPlaceId?: number; - nome?: string; - tabelaPrecoId?: number; - portfolioId?: number; - tipoEscopo?: string; - ativo?: boolean; - isMarketPlace?: boolean; - origem?: string; - }[]; - }; - /** - * Insere um novo parceiro - */ - "POST /parceiros": { - body: { - /** - * Nome do parceiro - */ - nome?: string; - /** - * Id da tabela de preço (optional) - */ - tabelaPrecoId?: number; - /** - * Id do portfolio (optional) - */ - portfolioId?: number; - /** - * Tipo de escopo - */ - tipoEscopo?: 'Aberto"' | "Fechado" | "PorCliente"; - /** - * Status do parceiro - */ - ativo?: boolean; - /** - * Se o parceiro é marketplace (optional) - */ - isMarketPlace?: boolean; - /** - * Origem (optional) - */ - origem?: string; - }; - }; - /** - * Lista de tipos de evento - */ - "GET /tiposEvento": { - searchParams: { - /** - * Status do tipo de evento - */ - ativo?: boolean; - /** - * Se o tipo de evento está disponível - */ - disponivel?: boolean; - /** - * Nome do tipo de evento - */ - nome?: string; - }; - response: { - tipoEventoId?: number; - nome?: string; - tipoEntrega?: string; - tipoDisponibilizacao?: string; - permitirRemocaoAutomaticaProdutos?: boolean; - corHexTituloInformacoes?: string; - corHexCorpoInformacoes?: string; - numeroAbasInformacoes?: number; - quantidadeDiasParaEventoExpirar?: number; - numeroLocaisEvento?: number; - ativo?: boolean; - disponivel?: boolean; - tipoBeneficiarioFrete?: string; - caminhoLogoEvento?: string; - caminhoSubTemplate?: string; - sugestaoProdutos?: { - tipoEventoId?: number; - produtoVarianteId?: number; - }[]; - }[]; - }; - /** - * Insere um novo tipo de evento - */ - "POST /tiposEvento": { - body: { - /** - * Nome do Tipo de Evento - */ - nome?: string; - /** - * Tipo de entrega - */ - tipoEntrega?: - | "EntregaAgendada" - | "EntregaConformeCompraRealizada" - | "Todos" - | "Nenhum"; - /** - * Disponibilização do Tipo de Evento - */ - tipoDisponibilizacao?: - | "DisponibilizacaoDeCreditos" - | "DisponibilizacaoDeProdutos" - | "Todos"; - /** - * Permissão para remoção automática de produtos - */ - permitirRemocaoAutomaticaProdutos?: boolean; - /** - * Cor em hexadecimal para o titulo de informações - */ - corHexTituloInformacoes?: string; - /** - * Cor em hexadecimal para o corpo de informações - */ - corHexCorpoInformacoes?: string; - /** - * Número de abas de informações, podendo ser de 1 a 2 - */ - numeroAbasInformacoes?: number; - /** - * Quantidade de dias para que o evento expire - */ - quantidadeDiasParaEventoExpirar?: number; - /** - * Quantidade de locais do evento - */ - numeroLocaisEvento?: number; - /** - * Informa se o evento está ativo ou inativo - */ - ativo?: boolean; - /** - * Informa a disponibilidade do evento - */ - disponivel?: boolean; - /** - * O beneficiário do frete - */ - tipoBeneficiarioFrete?: "DonodaLista" | "Convidado"; - /** - * Imagem da logo do evento em base64 - */ - imagemLogoEvento?: string; - /** - * Produtos Sugeridos para este evento (optional) - */ - sugestaoProdutos?: { - /** - * Id do tipo de evento - */ - tipoEventoId?: number; - /** - * Identificador do produto variante - */ - produtoVarianteId?: number; - }[]; - }; - }; - /** - * Lista de preços e estoque de produtos que sofreram alterações - */ - "GET /produtos/alteracoes": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Retorna apenas os produtos que sofreram alguma alteração a partir da data/hora informada. Formato: aaaa-mm-dd hh:mm:ss com no máximo 48 horas de antecedência - */ - alteradosPartirDe?: string; - }; - response: { - produtoId?: number; - produtoVarianteId?: number; - sku?: string; - precoDe?: number; - precoPor?: number; - disponivel?: boolean; - valido?: boolean; - exibirSite?: boolean; - estoque?: { - estoqueFisico?: number; - estoqueReservado?: number; - centroDistribuicaoId?: number; - alertaEstoque?: number; - }[]; - tabelasPreco?: { - tabelaPrecoId?: number; - nome?: string; - precoDe?: number; - precoPor?: number; - }[]; - }[]; - }; - /** - * Retorna a situação reseller de um produto - */ - "GET /produtos/:identificador/situacaoReseller": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - }; - /** - * Lista de atributos - */ - "GET /atributos": { - response: { - nome?: string; - tipo?: string; - tipoExibicao?: string; - prioridade?: number; - }[]; - }; - /** - * Insere um novo atributo - */ - "POST /atributos": { - body: { - /** - * Nome do atributo (optional) - */ - nome?: string; - /** - * Tipo do atributo (optional) - */ - tipo?: - | "Selecao" - | "Filtro" - | "Comparacao" - | "Configuracao" - | "ExclusivoGoogle"; - /** - * Tipo de exibição (optional) - */ - tipoExibicao?: - | "Combo" - | "Div" - | "DivComCor" - | "DivComFotoDoProdutoVariante" - | "Javascript"; - /** - * Prioridade do atributo (optional) - */ - prioridade?: number; - }; - }; - /** - * Inscrição - */ - "GET /webhook/inscricao/:inscricaoId": { - response: { - inscricaoId?: number; - nome?: string; - appUrl?: string; - ativo?: boolean; - emailResponsavel?: string; - topico?: string[]; - usuario?: string; - header?: { - headerId?: number; - chave?: string; - valor?: string; - }[]; - }; - }; - /** - * Atualiza uma inscrição - */ - "PUT /webhook/inscricao/:inscricaoId": { - body: { - /** - * Nome da inscrição - */ - nome?: string; - /** - * Url para qual deve ser enviada as notificações - */ - appUrl?: string; - /** - * Tópicos em que deseja se inscrever - */ - topicos: string[]; - /** - * Usuário que está realizando a inscrição - */ - usuario?: string; - /** - * Status da inscrição, se ativada ou desativada - */ - ativo?: boolean; - /** - * E-mail do responsável para notificá-lo quando não seja possível notificá-lo pelo AppUrl informado - */ - emailResponsavel?: string; - /** - * Headers que devam ser adicionados ao realizar a requisição para o AppUrl. Headers de Conteúdo como 'ContentType' não são necessário. As requisições realizada sempre serão no formato 'application/json' (optional) - */ - headers?: { - /** - * Chave do header, por exemplo: 'Authorization' - */ - chave?: string; - /** - * Valor / Conteúdo do header, por exemplo: 'Basic 0G3EQWD-W324F-234SD-2421OFSD' - */ - valor?: string; - }[]; - }; - }; - /** - * Produtos de uma assinatura - */ - "GET /assinaturas/:assinaturaId/produtos": { - response: { - assinaturaProdutoId?: number; - assinaturaId?: number; - produtoId?: number; - produtoVarianteId?: number; - quantidade?: number; - valor?: number; - removido?: boolean; - }[]; - }; - /** - * Insere um novo produto na assinatura - */ - "POST /assinaturas/:assinaturaId/produtos": { - body: { - /** - * Produto Variante que será incluído na assinatura - */ - produtoVarianteId?: number; - /** - * Quantidade do produto que será inserido na assinatura - */ - quantidade?: number; - }; - }; - /** - * Categoria encontrada - */ - "GET /categorias/:id": { - searchParams: { - /** - * Hierarquia da categoria - */ - hierarquia?: boolean; - /** - * Se será apresentado somente categorias filhas - */ - somenteFilhos?: boolean; - }; - response: { - id?: number; - nome?: string; - categoriaPaiId?: number; - categoriaERPId?: string; - ativo?: boolean; - isReseller?: boolean; - exibirMatrizAtributos?: string; - quantidadeMaximaCompraUnidade?: number; - valorMinimoCompra?: number; - exibeMenu?: boolean; - urlHotSite?: string; - }; - }; - /** - * Atualiza uma categoria - */ - "PUT /categorias/:id": { - body: { - /** - * Nome da categoria (optional) - */ - nome?: string; - /** - * Id da categoria pai (optional) - */ - categoriaPaiId?: number; - /** - * Id da categoria ERP (optional) - */ - categoriaERPId?: string; - /** - * Categoria ativo/inativo (optional) - */ - ativo?: boolean; - /** - * Categoria de reseller (optional) - */ - isReseller?: boolean; - /** - * Exibir Matriz de Atributos (optional) - */ - exibirMatrizAtributos?: "Sim" | "Nao" | "Neutro"; - /** - * Informe a quantidade máxima permitida para compra por produtos desta categoria. Informe zero para assumir a configuração geral da loja (optional) - */ - quantidadeMaximaCompraUnidade?: number; - /** - * Informe o valor mínimo para compra em produtos desta categoria (optional) - */ - valorMinimoCompra?: number; - /** - * Informe se será exibida no menu (optional) - */ - exibeMenu?: boolean; - }; - }; - /** - * Exclui uma categoria - */ - "DELETE /categorias/:id": {}; - /** - * Retorna todos os identificadores dos produtos/variantes relacionados ao produto pesquisado - */ - "GET /produtos/:identificador/relacionados": { - searchParams: { - /** - * Define se o identificador informado é um Sku, um ProdutoId (Agrupador de variantes) ou um ProdutoVarianteId - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - response: { - produtoId?: number; - parentId?: number; - produtoVarianteId?: number; - sku?: string; - }[]; - }; - /** - * Atualiza um valor pré definido pelo id - */ - "PUT /usuarios/valoresdefinidoscadastropersonalizado/:valoresDefinidosCampoGrupoInformacaoId": - { - body: { - /** - * Valor para o campo (optional) - */ - valor?: string; - /** - * Ordem (optional) - */ - ordem?: number; - }; - }; - /** - * Remove um valor pré definido - */ - "DELETE /usuarios/valoresdefinidoscadastropersonalizado/:valoresDefinidosCampoGrupoInformacaoId": - {}; - /** - * Lista de banners - */ - "GET /banners": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadePorPagina?: number; - }; - response: { - id?: number; - nome?: string; - dataInicio?: string; - dataFim?: string; - ativo?: boolean; - detalhe?: { - posicionamentoId?: number; - urlBanner?: string; - imagemBanner?: { - nome?: string; - base64?: string; - formato?: string; - }; - ordemExibicao?: number; - abrirBannerNovaAba?: boolean; - largura?: number; - altura?: number; - title?: string; - urlClique?: string; - urlBannerAlternativo?: string; - titleAlternativo?: string; - diasExibicao?: { - todosDias?: boolean; - domingo?: boolean; - segunda?: boolean; - terca?: boolean; - quarta?: boolean; - quinta?: boolean; - sexta?: boolean; - sabado?: boolean; - }; - textoAlternativo?: string; - }; - apresentacao?: { - exibirNoSite?: boolean; - exibirEmTodasBuscas?: boolean; - naoExibirEmBuscas?: boolean; - termosBusca?: string; - listaHotsites?: { - exibirEmTodosHotSites?: boolean; - hotSites?: { - hotSiteId?: number; - }[]; - }; - exibirEmTodasCategorias?: boolean; - listaParceiros?: { - exibirEmTodosParceiros?: boolean; - parceiros?: { - parceiroId?: number; - }[]; - }; - }; - }[]; - }; - /** - * Insere um novo banner - */ - "POST /banners": { - body: { - /** - * Nome do banner - */ - nome?: string; - /** - * Data de inicio de exibição do banner - */ - dataInicio?: string; - /** - * Data de termino de exibição do banner (optional) - */ - dataFim?: string; - /** - * Banner ativo/inativo (optional) - */ - ativo?: boolean; - /** - * Detalhes do banner - */ - detalhe?: { - /** - * Local de posicionamento do banner - */ - posicionamentoId?: number; - /** - * Imagem do banner (caso o campo "UrlBanner" estiver preenchido esse campo será desconsiderado) (optional) - */ - imagemBanner?: { - /** - * string da imagem em base 64 - */ - base64?: string; - /** - * formato da imagem - */ - formato?: "PNG" | "JPG" | "JPEG"; - /** - * nome da imagem - */ - nome?: string; - }; - /** - * Url de onde o banner deve ser carregado (Ex.: http://www.site.com.br/banner.swf). O Banner poderá ser do tipo flash ou imagem (optional) - */ - urlBanner?: string; - /** - * Ordem de exibição do banner (optional) - */ - ordemExibicao?: number; - /** - * Se o banner deve ou não abrir em nova aba (optional) - */ - abrirLinkNovaAba?: boolean; - /** - * Largura do banner em pixels (optional) - */ - largura?: number; - /** - * Altura do banner em pixels (optional) - */ - altura?: number; - /** - * Title da imagem do banner (optional) - */ - title?: string; - /** - * Url de destino para quando o usuário clicar no Banner (optional) - */ - urlClique?: string; - /** - * URL para um Banner alternativo que será exibido caso ocorra algum problema para exibição do Banner (optional) - */ - urlBannerAlternativo?: string; - /** - * Title alternativo que será exibido caso ocorra algum problema para a exibição do Banner - */ - textoAlternativo?: string; - }; - /** - * Dias da semana que o banner deverá ser exibido (optional) - */ - diasExibicao?: { - /** - * Se o banner deverá ser exibido todos os dias (caso esse campo estiver preenchido como "true" os demais serão desconsiderados) - */ - todosDias?: boolean; - /** - * Se o banner deverá ser apresentado no domingo - */ - domingo?: boolean; - /** - * Se o banner deverá ser apresentado na segunda - */ - segunda?: boolean; - /** - * Se o banner deverá ser apresentado na terça - */ - terca?: boolean; - /** - * Se o banner deverá ser apresentado na quarta - */ - quarta?: boolean; - /** - * Se o banner deverá ser apresentado na quinta - */ - quinta?: boolean; - /** - * Se o banner deverá ser apresentado na sexta - */ - sexta?: boolean; - /** - * Se o banner deverá ser apresentado no sábado - */ - sabado?: boolean; - }; - /** - * Detalhes de apresentação do banner (optional) - */ - apresentacao?: { - /** - * Se o banner deverá ser exibido em todo o site - */ - exibirNoSite?: boolean; - /** - * Se o banner deverá ser exibido em todas as buscas - */ - exibirEmTodasBuscas?: boolean; - /** - * Se o banner não deverá ser exibido em nenhuma busca (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) - */ - naoExibirEmBuscas?: boolean; - /** - * Termos que o banner será exibido na busca - */ - termosBusca?: string; - /** - * Se o banner deverá ser exibido em todas categorias (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) - */ - exibirEmTodasCategorias?: boolean; - /** - * Em quais hotsites o banner deve ser exibido - */ - listaHotsites?: { - /** - * Se o banner deverá ser exibido em todos as hotsite's (Caso esse campo estiver como "true" o campo HotSites será desconsiderado) (optional) - */ - exibirEmTodosHotsites?: boolean; - /** - * Lista de hotsite's que o banner será exibido - */ - hotsites?: { - /** - * Id do hotsite (optional) - */ - hotSiteId?: number; - }[]; - }; - }; - /** - * Em quais parceiros o banner deve ser exibido - */ - listaParceiros?: { - /** - * Se o banner deverá ser exibido em todos parceiros (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) (optional) - */ - exibirEmTodosParceiros?: boolean; - /** - * Lista de parceiros que o banner será exibido - */ - parceiros?: { - /** - * Id do parceiro (optional) - */ - parceiroId?: number; - }[]; - }; - }; - }; - /** - * Avatar do usuário encontrado - */ - "GET /usuarios/:email/avatar": { - response: { - urlAvatar?: string; - }; - }; - /** - * Insere um novo avatar para o usuário - */ - "POST /usuarios/:email/avatar": { - body: { - /** - * Imagem do avatar em base64 (optional) - */ - base64?: string; - /** - * Formato da imagem (optional) - */ - formato?: string; - }; - response: { - urlAvatar?: string; - }; - }; - /** - * Deleta um avatar de um usuário - */ - "DELETE /usuarios/:email/avatar": {}; - /** - * Fabricante encontrado - */ - "GET /fabricantes/:fabricanteId": { - response: { - fabricanteId?: number; - ativo?: boolean; - nome?: string; - urlLogoTipo?: string; - urlLink?: string; - urlCarrossel?: string; - }; - }; - /** - * Atualiza um fabricante - */ - "PUT /fabricantes/:fabricanteId": { - body: { - /** - * Nome do fabricante (optional) - */ - nome?: string; - /** - * URL tipo logo (optional) - */ - urlLogoTipo?: string; - /** - * Insira neste campo uma URL para redirecionamento. A URL deve ser inserida por completa (optional) - */ - urlLink?: string; - /** - * Insira nesse campo a URL do Carrossel da Marca (optional) - */ - urlCarrossel?: string; - }; - }; - /** - * Exclui um fabricante - */ - "DELETE /fabricantes/:fabricanteId": {}; - /** - * Lista de posicionamentos do banner - */ - "GET /banners/posicionamentos": { - response: { - posicionamentoId?: number; - descricao?: string; - }[]; - }; - /** - * Preços do produto variante informado - */ - "GET /produtos/:identificador/precos": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - response: { - produtoVarianteId?: number; - sku?: string; - precoDe?: number; - precoPor?: number; - fatorMultiplicadorPreco?: number; - precosTabelaPreco?: { - produtoVarianteId?: number; - tabelaPrecoId?: number; - nome?: string; - precoDe?: number; - precoPor?: number; - }[]; - }; - }; - /** - * Atualiza a autonomia de um Seller - */ - "PUT /resellers/:resellerId/autonomia": { - body: { - /** - * Status da autonomia do seller - */ - ativo?: boolean; - }; - }; - /** - * Lista de produtos variantes vinculados aos tipo de evento - */ - "GET /eventos/:eventoId/produtos": { - response: { - eventoId?: number; - produtoVarianteId?: number; - recebidoForaLista?: boolean; - removido?: boolean; - }[]; - }; - /** - * Vincula um ou mais produtos a um evento sem remover os produtos vinculados anteriormente - */ - "POST /eventos/:eventoId/produtos": { - body: { - /** - * Identificadores dos produtos variantes a serem vinculados ao evento desejado - */ - produtosVariante?: { - /** - * Identificador do produto variante - */ - produtoVarianteId?: number; - }[]; - }; - }; - /** - * Atualiza lista de produtos vinculados a um evento removendo os itens vinculados anteriormente e mantendo apenas os enviados pelo request - */ - "PUT /eventos/:eventoId/produtos": { - body: { - /** - * Identificadores dos produtos variantes a serem vinculados ao evento desejado - */ - produtosVariante?: { - /** - * Identificador do produto variante - */ - produtoVarianteId?: number; - }[]; - }; - }; - /** - * Atualiza o status do hotsite, sendo ativo (true) ou inativo (false) - */ - "PUT /hotsites/:hotsiteId/status": { - body: { - /** - * Status para qual o hotsite indicado deve ir - */ - ativo?: boolean; - }; - }; - /** - * Autenticação realizada com sucesso - */ - "POST /autenticacao/login": { - body: { - /** - * Login do usuário (optional) - */ - login?: string; - /** - * Senha do usuário (optional) - */ - senha?: string; - }; - }; - /** - * Parceiro encontrado - */ - "GET /parceiros/:nome": { - response: { - parceiroId?: number; - marketPlaceId?: number; - nome?: string; - tabelaPrecoId?: number; - portfolioId?: number; - tipoEscopo?: string; - ativo?: boolean; - isMarketPlace?: boolean; - origem?: string; - }; - }; - /** - * Seta status do produto variante como ativo ou inativo - */ - "PUT /produtos/:identificador/situacao": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Define se o produto variante informado será ativo ou inativo - */ - status?: boolean; - }; - }; - /** - * Lista de Grupos de Personalização - */ - "GET /grupospersonalizacao": { - response: { - grupoPersonalizacaoId?: number; - nome?: string; - ativo?: boolean; - obrigatorio?: boolean; - }[]; - }; - /** - * Retorna o saldo de um usuário - */ - "GET /contascorrentes/:email": {}; - /** - * Realiza um novo lançamento na conta corrente do cliente - */ - "POST /contascorrentes/:email": { - body: { - /** - * Valor da conta corrente (optional) - */ - valor?: number; - /** - * Tipo de Lançamento (optional) - */ - tipoLancamento?: "Credito" | "Debito"; - /** - * Observação (optional) - */ - observacao?: string; - /** - * Se será visível para o cliente (optional) - */ - visivelParaCliente?: boolean; - }; - }; - /** - * Lista de produtos - */ - "GET /resellers/produtos/:identificador": { - searchParams: { - /** - * Define se o identificador informado é um id interno da fstore ou a Razão social do Reseller - */ - tipoIdentificador?: "ResellerId" | "RazaoSocial"; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Se deve retornar apenas produtos válidos (padrão: false) - */ - somenteValidos?: boolean; - /** - * Campos adicionais que se selecionados retornaram junto com o produto: Atacado, Estoque, Atributo, Informacao, TabelaPreo - */ - camposAdicionais?: string[]; - }; - response: { - produtoVarianteId?: number; - produtoId?: number; - idPaiExterno?: string; - idVinculoExterno?: string; - sku?: string; - nome?: string; - nomeProdutoPai?: string; - urlProduto?: string; - exibirMatrizAtributos?: string; - contraProposta?: boolean; - fabricante?: string; - autor?: string; - editora?: string; - colecao?: string; - genero?: string; - precoCusto?: number; - precoDe?: number; - precoPor?: number; - fatorMultiplicadorPreco?: number; - prazoEntrega?: number; - valido?: boolean; - exibirSite?: boolean; - freteGratis?: string; - trocaGratis?: boolean; - peso?: number; - altura?: number; - comprimento?: number; - largura?: number; - garantia?: number; - isTelevendas?: boolean; - ean?: string; - localizacaoEstoque?: string; - listaAtacado?: { - precoPor?: number; - quantidade?: number; - }[]; - estoque?: { - estoqueFisico?: number; - estoqueReservado?: number; - centroDistribuicaoId?: number; - alertaEstoque?: number; - }[]; - atributos?: { - tipoAtributo?: string; - isFiltro?: boolean; - nome?: string; - valor?: string; - exibir?: boolean; - }[]; - quantidadeMaximaCompraUnidade?: number; - quantidadeMinimaCompraUnidade?: number; - condicao?: string; - informacoes?: { - informacaoId?: number; - titulo?: string; - texto?: string; - tipoInformacao?: string; - }[]; - tabelasPreco?: { - tabelaPrecoId?: number; - nome?: string; - precoDe?: number; - precoPor?: number; - }[]; - dataCriacao?: string; - dataAtualizacao?: string; - urlVideo?: string; - spot?: boolean; - paginaProduto?: boolean; - marketplace?: boolean; - somenteParceiros?: boolean; - reseller?: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }; - buyBox?: boolean; - }[]; - }; - /** - * Lista de pedidos - */ - "GET /pedidos/formaPagamento/:formasPagamento": { - searchParams: { - /** - * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final dos pedidos que deverão retonar (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - /** - * Tipo de filtro da data (Ordenação "desc" - padrão: DataPedido) - */ - enumTipoFiltroData?: - | "DataPedido" - | "DataAprovacao" - | "DataModificacaoStatus" - | "DataAlteracao" - | "DataCriacao"; - /** - * Lista de situações que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as situações - */ - situacoesPedido?: string; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - }; - response: { - pedidoId?: number; - situacaoPedidoId?: number; - tipoRastreamentoPedido?: string; - transacaoId?: number; - data?: string; - dataPagamento?: string; - dataUltimaAtualizacao?: string; - valorFrete?: number; - valorTotalPedido?: number; - valorDesconto?: number; - valorDebitoCC?: number; - cupomDesconto?: string; - marketPlacePedidoId?: string; - marketPlacePedidoSiteId?: string; - canalId?: number; - canalNome?: string; - canalOrigem?: string; - retiradaLojaId?: number; - isPedidoEvento?: boolean; - usuario?: { - usuarioId?: number; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - }; - pedidoEndereco?: { - tipo?: string; - nome?: string; - endereco?: string; - numero?: string; - complemento?: string; - referencia?: string; - cep?: string; - tipoLogradouro?: string; - logradouro?: string; - bairro?: string; - cidade?: string; - estado?: string; - pais?: string; - }[]; - frete?: { - freteContratoId?: number; - freteContrato?: string; - referenciaConector?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - retiradaLojaId?: number; - centrosDistribuicao?: { - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - servico?: { - servicoId?: number; - nome?: string; - transportadora?: string; - prazo?: number; - servicoNome?: string; - preco?: number; - servicoTransporte?: number; - codigo?: number; - servicoMeta?: string; - custo?: number; - token?: string; - }; - retiradaAgendada?: { - lojaId?: number; - retiradaData?: string; - retiradaPeriodo?: string; - nome?: string; - documento?: string; - codigoRetirada?: string; - }; - agendamento?: { - de?: string; - ate?: string; - }; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }; - itens?: { - produtoVarianteId?: number; - sku?: string; - nome?: string; - quantidade?: number; - precoCusto?: number; - precoVenda?: number; - isBrinde?: boolean; - valorAliquota?: number; - isMarketPlace?: boolean; - precoPor?: number; - desconto?: number; - totais?: { - precoCusto?: number; - precoVenda?: number; - precoPor?: number; - desconto?: number; - }; - ajustes?: { - tipo?: string; - valor?: number; - observacao?: string; - nome?: string; - }[]; - centroDistribuicao?: { - centroDistribuicaoId?: number; - quantidade?: number; - situacaoProdutoId?: number; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - }[]; - valoresAdicionais?: { - tipo?: string; - origem?: string; - texto?: string; - valor?: number; - }[]; - atributos?: { - produtoVarianteAtributoValor?: string; - produtoVarianteAtributoNome?: string; - }[]; - embalagens?: { - tipoEmbalagemId?: number; - nomeTipoEmbalagem?: string; - mensagem?: string; - valor?: number; - descricao?: string; - }[]; - personalizacoes?: { - nomePersonalizacao?: string; - valorPersonalizacao?: string; - valor?: number; - }[]; - frete?: { - quantidade?: number; - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - dadosProdutoEvento?: { - tipoPresenteRecebimento?: string; - }; - formulas?: { - chaveAjuste?: string; - valor?: number; - nome?: string; - expressao?: string; - expressaoInterpretada?: string; - endPoint?: string; - }[]; - seller?: { - sellerId?: number; - sellerNome?: string; - sellerPedidoId?: number; - }; - }[]; - assinatura?: { - assinaturaId?: number; - grupoAssinaturaId?: number; - tipoPeriodo?: string; - tempoPeriodo?: number; - percentualDesconto?: number; - }[]; - pagamento?: { - formaPagamentoId?: number; - numeroParcelas?: number; - valorParcela?: number; - valorDesconto?: number; - valorJuros?: number; - valorTotal?: number; - boleto?: { - urlBoleto?: string; - codigoDeBarras?: string; - }; - cartaoCredito?: { - numeroCartao?: string; - nomeTitular?: string; - dataValidade?: string; - codigoSeguranca?: string; - documentoCartaoCredito?: string; - token?: string; - info?: string; - bandeira?: string; - }[]; - pagamentoStatus?: { - numeroAutorizacao?: string; - numeroComprovanteVenda?: string; - dataAtualizacao?: string; - dataUltimoStatus?: string; - adquirente?: string; - tid?: string; - }[]; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }[]; - observacao?: { - observacao?: string; - usuario?: string; - data?: string; - publica?: boolean; - }[]; - valorCreditoFidelidade?: number; - valido?: boolean; - valorSubTotalSemDescontos?: number; - pedidoSplit?: number[]; - }[]; - }; - /** - * Lista de pedidos - */ - "GET /pedidos": { - searchParams: { - /** - * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final dos pedidos que deverão retonar (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - /** - * Tipo de filtro da data (Ordenação "desc" - padrão: DataPedido) - */ - enumTipoFiltroData?: - | "DataPedido" - | "DataAprovacao" - | "DataModificacaoStatus" - | "DataAlteracao" - | "DataCriacao"; - /** - * Lista de situações que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as situações - */ - situacoesPedido?: string; - /** - * Lista de formas de pagamento que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as formas de pagamento - */ - formasPagamento?: string; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Deverá retornar apenas pedidos realizados pelo usuário com o e-mail passado - */ - email?: string; - /** - * Deverá retornar apenas pedidos válidos, inválidos ou todos (caso não seja informado) - */ - valido?: boolean; - /** - * Deverá retornar apenas pedidos que o produto de determinado sku foi comprado - */ - sku?: string; - /** - * Quando passado o valor true, deverá retornar apenas pedidos de assinatura. Quando falso, deverá retornar todos os pedidos. - */ - apenasAssinaturas?: boolean; - }; - response: { - pedidoId?: number; - situacaoPedidoId?: number; - tipoRastreamentoPedido?: string; - transacaoId?: number; - data?: string; - dataPagamento?: string; - dataUltimaAtualizacao?: string; - valorFrete?: number; - valorTotalPedido?: number; - valorDesconto?: number; - valorDebitoCC?: number; - cupomDesconto?: string; - marketPlacePedidoId?: string; - marketPlacePedidoSiteId?: string; - canalId?: number; - canalNome?: string; - canalOrigem?: string; - retiradaLojaId?: number; - isPedidoEvento?: boolean; - usuario?: { - usuarioId?: number; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - }; - pedidoEndereco?: { - tipo?: string; - nome?: string; - endereco?: string; - numero?: string; - complemento?: string; - referencia?: string; - cep?: string; - tipoLogradouro?: string; - logradouro?: string; - bairro?: string; - cidade?: string; - estado?: string; - pais?: string; - }[]; - frete?: { - freteContratoId?: number; - freteContrato?: string; - referenciaConector?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - retiradaLojaId?: number; - centrosDistribuicao?: { - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - servico?: { - servicoId?: number; - nome?: string; - transportadora?: string; - prazo?: number; - servicoNome?: string; - preco?: number; - servicoTransporte?: number; - codigo?: number; - servicoMeta?: string; - custo?: number; - token?: string; - }; - retiradaAgendada?: { - lojaId?: number; - retiradaData?: string; - retiradaPeriodo?: string; - nome?: string; - documento?: string; - codigoRetirada?: string; - }; - agendamento?: { - de?: string; - ate?: string; - }; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }; - itens?: { - produtoVarianteId?: number; - sku?: string; - nome?: string; - quantidade?: number; - precoCusto?: number; - precoVenda?: number; - isBrinde?: boolean; - valorAliquota?: number; - isMarketPlace?: boolean; - precoPor?: number; - desconto?: number; - totais?: { - precoCusto?: number; - precoVenda?: number; - precoPor?: number; - desconto?: number; - }; - ajustes?: { - tipo?: string; - valor?: number; - observacao?: string; - nome?: string; - }[]; - centroDistribuicao?: { - centroDistribuicaoId?: number; - quantidade?: number; - situacaoProdutoId?: number; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - }[]; - valoresAdicionais?: { - tipo?: string; - origem?: string; - texto?: string; - valor?: number; - }[]; - atributos?: { - produtoVarianteAtributoValor?: string; - produtoVarianteAtributoNome?: string; - }[]; - embalagens?: { - tipoEmbalagemId?: number; - nomeTipoEmbalagem?: string; - mensagem?: string; - valor?: number; - descricao?: string; - }[]; - personalizacoes?: { - nomePersonalizacao?: string; - valorPersonalizacao?: string; - valor?: number; - }[]; - frete?: { - quantidade?: number; - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - dadosProdutoEvento?: { - tipoPresenteRecebimento?: string; - }; - formulas?: { - chaveAjuste?: string; - valor?: number; - nome?: string; - expressao?: string; - expressaoInterpretada?: string; - endPoint?: string; - }[]; - seller?: { - sellerId?: number; - sellerNome?: string; - sellerPedidoId?: number; - }; - }[]; - assinatura?: { - assinaturaId?: number; - grupoAssinaturaId?: number; - tipoPeriodo?: string; - tempoPeriodo?: number; - percentualDesconto?: number; - }[]; - pagamento?: { - formaPagamentoId?: number; - numeroParcelas?: number; - valorParcela?: number; - valorDesconto?: number; - valorJuros?: number; - valorTotal?: number; - boleto?: { - urlBoleto?: string; - codigoDeBarras?: string; - }; - cartaoCredito?: { - numeroCartao?: string; - nomeTitular?: string; - dataValidade?: string; - codigoSeguranca?: string; - documentoCartaoCredito?: string; - token?: string; - info?: string; - bandeira?: string; - }[]; - pagamentoStatus?: { - numeroAutorizacao?: string; - numeroComprovanteVenda?: string; - dataAtualizacao?: string; - dataUltimoStatus?: string; - adquirente?: string; - tid?: string; - }[]; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }[]; - observacao?: { - observacao?: string; - usuario?: string; - data?: string; - publica?: boolean; - }[]; - valorCreditoFidelidade?: number; - valido?: boolean; - valorSubTotalSemDescontos?: number; - pedidoSplit?: number[]; - }[]; - }; - /** - * Caso a loja utilize as formas de pagamento do gateway o campo "formaPagamentoId" do objeto "pagamento" deverá conter o valor "200". - */ - "POST /pedidos": { - body: { - /** - * Id do pedido que está sendo inserido. Caso seja informado deve ser um Id disponível na loja. Caso não seja informado um Id será gerado (optional) - */ - pedidoId?: number; - /** - * Id do carrinho que foi utilizado no pedido (optional) - */ - carrinhoId?: string; - /** - * Define em qual situação está o pedido. A lista completa das possíveis situações se encontra no GET /situacoesPedido - */ - situacaoPedidoId?: number; - /** - * Data em que o pedido foi realizado - */ - data?: string; - /** - * Valor total do pedido. Se informado deve ser igual a soma de todos os valores inclusos no pedido (preços dos produtos, ajustes, frete, etc) (optional) - */ - valorTotal?: number; - /** - * Informação do juros do pedido - */ - valorJuros?: number; - /** - * Informação de desconto do pedido - */ - valorDesconto?: number; - /** - * Id do usuário que realizou a compra. É possível recuperar o Id de um usuário no GET /usuarios - */ - usuarioId?: number; - /** - * Id do endereço do usuário que deve ser utilizado como endereço de entrega. Para buscar os endereços de um usuário utilize o GET /usuarios/{usuarioId}/enderecos - */ - enderecoId?: number; - /** - * Define se o pedido foi feito através de um dispositivo móvel ou não - */ - isMobile?: boolean; - /** - * Id do evento ao qual o pedido está vinculado (opcional) - */ - eventoId?: number; - /** - * Lista contendo os produtos do pedido - */ - produtos?: { - /** - * Id do produto variante que está vinculado a esse pedido. - */ - produtoVarianteId?: number; - /** - * Define a quantidade do produto, podendo ser dividida por diferentes centros de distribuição - */ - quantidade?: { - /** - * Quantidade por centro de distribuição - */ - quantidadeTotal?: number; - /** - * Quantidade (optional) - */ - quantidadePorCentroDeDistribuicao?: { - /** - * Id do centro de distribuição - */ - centroDistribuicaoId?: number; - /** - * Quantidade - */ - quantidade?: number; - }[]; - }; - /** - * Preço de venda do produto, sem adição ou subtração de valores. - */ - precoVenda?: number; - /** - * Define se esse produto é um brinde ou não - */ - isBrinde?: boolean; - /** - * Lista contendo todos os ajustes de preço do produto - */ - ajustes?: { - /** - * Define o tipo do ajuste de valor de um produto contido em um pedido. = ['Frete', 'Pricing', 'Atacarejo', 'Personalizacao', 'Embalagem', 'Promocao', 'PromocaoFrete', 'ContaCorrente', 'FormaPagamento', 'PromocaoProduto', 'TipoFreteProduto', 'Formula']stringEnum:"Frete", "Pricing", "Atacarejo", "Personalizacao", "Embalagem", "Promocao", "PromocaoFrete", "ContaCorrente", "FormaPagamento", "PromocaoProduto", "TipoFreteProduto", "Formula" - */ - tipo?: string; - /** - * Define o valor do ajuste a ser aplicado no produto. O valor pode ser positivo ou negativo - */ - valor?: number; - /** - * Observação (optional) - */ - observacao?: string; - /** - * Nome (optional) - */ - nome?: string; - }[]; - }[]; - /** - * Informações de frete do pedido - */ - fretes?: { - /** - * Identificador do centro de distribuição de origem - */ - centroDistribuicaoId?: number; - /** - * Identificador do contrato de frete (optional) - */ - freteContratoId?: number; - /** - * Peso em gramas (g) do frete calculado (optional) - */ - peso?: number; - /** - * Peso em gramas cobrado do cliente (optional) - */ - pesoCobrado?: number; - /** - * Volume em metro cúbico (m³) calculado (optional) - */ - volume?: number; - /** - * Volume em metro cúbico (m³) cobrado do cliente (optional) - */ - volumeCobrado?: number; - /** - * Prazo do envio do frete em dias úteis - */ - prazoEnvio?: number; - /** - * Valor do frete (optional) - */ - valorFreteEmpresa?: number; - /** - * Valor do frete cobrado do cliente - */ - valorFreteCliente?: number; - /** - * Data estimada da entrega do produto (optional) - */ - dataEntrega?: string; - /** - * Informações adicionais do frete - */ - informacoesAdicionais?: { - /** - * Chave - */ - chave?: string; - /** - * Valor - */ - valor?: string; - }[]; - }[]; - /** - * Informações de pagamento do pedido - */ - pagamento?: { - /** - * Id da forma de pagamento - */ - formaPagamentoId?: number; - /** - * Número parcelas - */ - numeroParcelas?: number; - /** - * Valor da parcela - */ - valorParcela?: number; - /** - * Informações adicionais de pagamento (optional) - */ - informacaoAdicional?: { - /** - * Chave - */ - chave?: string; - /** - * Valor - */ - valor?: string; - }[]; - }; - /** - * ParceiroId vinculado ao pedido (optional) - */ - canalId?: number; - /** - * Dados do pedido no marketplace (optional) - */ - omniChannel?: { - /** - * Id do pedido que o cliente vê no momento que fecha a compra - */ - pedidoIdPublico?: string; - /** - * Id interno do marketplace - */ - pedidoIdPrivado?: string; - /** - * Dados do pedido no integrador - */ - integrador?: { - /** - * Nome do parceiro integrador - */ - nome?: string; - /** - * Numero do pedido dentro do integrador - */ - pedidoId?: string; - /** - * Url do pedido dentro painel do integrador - */ - pedidoUrl?: string; - }; - }; - /** - * Id da transação (optional) - */ - transacaoId?: number; - /** - * Observação do pedido (optional) - */ - observacao?: string; - /** - * Se um pedido é valido (optional) - */ - valido?: boolean; - /** - * Cupom de desconto (optional) - */ - cupomDesconto?: string; - /** - * IP da criação do pedido (optional) - */ - ip?: string; - /** - * ID do usuário master que realizou o pedido, se houver (optional) - */ - usuarioMaster?: number; - }; - }; - /** - * Lista de portfolios - */ - "GET /portfolios": { - response: { - portfolioId?: number; - nome?: string; - ativo?: boolean; - }[]; - }; - /** - * Insere um novo portfolio - */ - "POST /portfolios": { - body: { - /** - * Nome do portfolio - */ - nome?: string; - }; - }; - /** - * Lista de imagens vinculadas a um produtos - */ - "GET /produtos/:identificador/imagens": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - produtosIrmaos?: boolean; - }; - response: { - idImagem?: number; - nomeArquivo?: string; - url?: string; - ordem?: number; - estampa?: boolean; - exibirMiniatura?: boolean; - }[]; - }; - /** - * Adiciona uma nova imagem vinculada a um produto - */ - "POST /produtos/:identificador/imagens": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - /** - * Define o tipo de retorno a ser recebido. ListaIds retorna lista de Ids das imagens inseridas, Booleano retorna true ou false, de acordo com o resultado da operação. Valor padrão Booleano - */ - tipoRetorno?: "ListaIds" | "Booleano"; - }; - body: { - /** - * Lista com as imagens do produto no formato base 64 (optional) - */ - RAW_BODY: { - /** - * Imagem do produto em base64 - */ - base64?: string; - /** - * JPG ou PNG - */ - formato?: string; - /** - * Se a imagem será apresentada como miniatura - */ - exibirMiniatura?: boolean; - /** - * Se a imagem será apresentada como estampa - */ - estampa?: boolean; - /** - * Ordem para apresentação da imagem - */ - ordem?: number; - }[]; - }; - }; - /** - * Limite de crédito de um usuário específico - */ - "GET /usuarios/limiteCreditoPorUsuarioId/:usuarioId": { - response: { - usuarioId?: number; - valor?: number; - saldo?: number; - }; - }; - /** - * SEO do produto informado - */ - "GET /produtos/:identificador/seo": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - response: { - tagCanonical?: string; - title?: string; - metatags?: { - metatagId?: number; - content?: string; - httpEquiv?: string; - name?: string; - scheme?: string; - }[]; - }; - }; - /** - * Insere um SEO para um produto específico - */ - "POST /produtos/:identificador/seo": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - body: { - /** - * Informe a URL a ser inserida na TAG Canonical. Caso nenhum dado seja inserido, a TAG Canonical não será inserida na Página do Produto (optional) - */ - tagCanonical?: string; - /** - * Informe o title da página do produto (optional) - */ - title?: string; - /** - * Informe os dados da Meta Tag (optional) - */ - metaTags?: { - /** - * Dados da Meta Tag - */ - content?: string; - /** - * Dados da Meta Tag - */ - httpEquiv?: string; - /** - * Dados da Meta Tag - */ - name?: string; - /** - * Dados da Meta Tag - */ - scheme?: string; - }[]; - }; - }; - /** - * Atualiza um SEO de um produto específico - */ - "PUT /produtos/:identificador/seo": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - body: { - /** - * Informe a URL a ser inserida na TAG Canonical. Caso nenhum dado seja inserido, a TAG Canonical não será inserida na Página do Produto (optional) - */ - tagCanonical?: string; - /** - * Informe o title da página do produto (optional) - */ - title?: string; - /** - * Informe os dados da Meta Tag (optional) - */ - metaTags?: { - /** - * Dados da Meta Tag - */ - content?: string; - /** - * Dados da Meta Tag - */ - httpEquiv?: string; - /** - * Dados da Meta Tag - */ - name?: string; - /** - * Dados da Meta Tag - */ - scheme?: string; - }[]; - }; - }; - /** - * Deleta o SEO de um produto específico - */ - "DELETE /produtos/:identificador/seo": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - }; - /** - * Adiciona um vínculo entre usuário e parceiro - */ - "POST /usuarios/:email/parceiro": { - body: { - /** - * Id do parceiro (optional) - */ - parceiroId?: number; - /** - * Vinculo vitalício (optional) - */ - vinculoVitalicio?: boolean; - /** - * Data inicial do vinculo entre usuário e parceiro (optional) - */ - dataInicial?: string; - /** - * Data final do vinculo entre usuário e parceiro (optional) - */ - dataFinal?: string; - }; - }; - /** - * Atualiza um vínculo entre usuário e parceiro - */ - "PUT /usuarios/:email/parceiro": { - body: { - /** - * Vinculo vitalício (optional) - */ - vinculoVitalicio?: boolean; - /** - * Data inicial do vinculo entre usuário e parceiro (optional) - */ - dataInicial?: string; - /** - * Data final do vinculo entre usuário e parceiro (optional) - */ - dataFinal?: string; - }; - }; - /** - * Remove o vínculo entre usuário e parceiro - */ - "DELETE /usuarios/:email/parceiro": { - body: { - /** - * Número identificador do parceiro (Max Length: 4) - */ - parceiroId?: number; - }; - }; - /** - * Retorna usuário encontrado - */ - "GET /usuarios/:email/enderecos": { - response: { - enderecoId?: number; - nomeEndereco?: string; - rua?: string; - numero?: string; - complemento?: string; - referencia?: string; - bairro?: string; - cidade?: string; - estado?: string; - cep?: string; - utilizadoUltimoPedido?: boolean; - pais?: string; - }[]; - }; - /** - * Insere um endereço para um usuário pelo e-mail - */ - "POST /usuarios/:email/enderecos": { - body: { - /** - * Nome de identificação do endereço a ser cadastrado (Max Length: 100) - */ - nomeEndereco?: string; - /** - * Nome da rua (Max Length: 500) - */ - rua?: string; - /** - * Número do local (Max Length: 50) - */ - numero?: string; - /** - * Complemento (Max Length: 250) (optional) - */ - complemento?: string; - /** - * Referência para a localização do endereço (Max Length: 500) (optional) - */ - referencia?: string; - /** - * Bairro do endereço (Max Length: 100) - */ - bairro?: string; - /** - * Cidade em que se localiza o endereço (Max Length: 100) - */ - cidade?: string; - /** - * O estado (Max Length: 100) - */ - estado?: string; - /** - * Código do cep (Max Length: 50) - */ - cep?: string; - }; - }; - /** - * Atualiza um script existente - */ - "PUT /gestorscripts/scripts/:scriptId": { - body: { - /** - * Nome do script - */ - nome?: string; - /** - * Data inicial do script - */ - dataInicial?: string; - /** - * Data final do script - */ - dataFinal?: string; - /** - * Informe se o script está ativo ou não - */ - ativo?: boolean; - /** - * Prioridade do script - */ - prioridade?: number; - /** - * Posição do script - */ - posicao?: - | "HeaderPrimeiraLinha" - | "HeaderUltimaLinha" - | "BodyPrimeiraLinha" - | "BodyUltimaLinha" - | "FooterPrimeiraLinha" - | "FooterUltimeLinha"; - /** - * Tipo da página do script - */ - tipoPagina?: - | "Todas" - | "Home" - | "Busca" - | "Categoria" - | "Fabricante" - | "Estaticas" - | "Produto" - | "Carrinho"; - /** - * Identificador da página - */ - identificadorPagina?: string; - /** - * Conteúdo do script - */ - conteudo?: string; - /** - * Status do script - */ - publicado?: boolean; - }; - }; - /** - * Exclui um Script - */ - "DELETE /gestorscripts/scripts/:scriptId": {}; - /** - * Ativa ou desativa um endereço de um usuário com base no id do usuário - */ - "PUT /usuarios/:usuarioId/enderecos/:enderecoId/ativar": { - body: { - /** - * Status do endereço - */ - status?: boolean; - }; - }; - /** - * Ativa ou desativa um Seller - */ - "PUT /resellers/:resellerId/status": { - body: { - /** - * Status do seller (ativo / inativo) - */ - ativo?: boolean; - }; - }; - /** - * Atacarejo - */ - "GET /produtos/:identificador/atacarejo/:produtoVarianteAtacadoId": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - response: { - produtoVarianteAtacadoId?: number; - precoAtacado?: number; - quantidade?: number; - }; - }; - /** - * Atualiza um Atacarejo - */ - "PUT /produtos/:identificador/atacarejo/:produtoVarianteAtacadoId": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Preço atacado (optional) - */ - precoAtacado?: number; - /** - * Quantidade do produto (optional) - */ - quantidade?: number; - }; - }; - /** - * Remove um Atacarejo - */ - "DELETE /produtos/:identificador/atacarejo/:produtoVarianteAtacadoId": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - }; - /** - * Buscar todos os autores - */ - "GET /autores": {}; - /** - * Inserir autor - */ - "POST /autores": { - body: { - /** - * Nome do Autor - */ - nome?: string; - /** - * Status do autor - */ - ativo?: boolean; - }; - }; - /** - * Lista dos estados - */ - "GET /lojasFisicas/estados": { - response: { - estadoId?: number; - nome?: string; - sigla?: string; - regiao?: string; - }[]; - }; - /** - * Método responsável por retornar um produto específico buscando pelo seu identificador, que pode ser um sku ou produto variante. O tipo do identificador pode ser definido no campo tipoIdentificador. Também é possível informar quais informações adicionais devem ser retornadas na consulta utilizando o campo campos adicionais. - */ - "GET /produtos/:identificador": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId" | "ProdutoId"; - /** - * Campo opcional que define quais dados extras devem ser retornados em conjunto com os dados básicos do produto, valores aceitos: Atacado, Estoque, Atributo , Informacao, TabelaPreco - */ - camposAdicionais?: string[]; - }; - response: { - produtoVarianteId?: number; - produtoId?: number; - idPaiExterno?: string; - idVinculoExterno?: string; - sku?: string; - nome?: string; - nomeProdutoPai?: string; - urlProduto?: string; - exibirMatrizAtributos?: string; - contraProposta?: boolean; - fabricante?: string; - autor?: string; - editora?: string; - colecao?: string; - genero?: string; - precoCusto?: number; - precoDe?: number; - precoPor?: number; - fatorMultiplicadorPreco?: number; - prazoEntrega?: number; - valido?: boolean; - exibirSite?: boolean; - freteGratis?: string; - trocaGratis?: boolean; - peso?: number; - altura?: number; - comprimento?: number; - largura?: number; - garantia?: number; - isTelevendas?: boolean; - ean?: string; - localizacaoEstoque?: string; - listaAtacado?: { - precoPor?: number; - quantidade?: number; - }[]; - estoque?: { - estoqueFisico?: number; - estoqueReservado?: number; - centroDistribuicaoId?: number; - alertaEstoque?: number; - }[]; - atributos?: { - tipoAtributo?: string; - isFiltro?: boolean; - nome?: string; - valor?: string; - exibir?: boolean; - }[]; - quantidadeMaximaCompraUnidade?: number; - quantidadeMinimaCompraUnidade?: number; - condicao?: string; - informacoes?: { - informacaoId?: number; - titulo?: string; - texto?: string; - tipoInformacao?: string; - }[]; - tabelasPreco?: { - tabelaPrecoId?: number; - nome?: string; - precoDe?: number; - precoPor?: number; - }[]; - dataCriacao?: string; - dataAtualizacao?: string; - urlVideo?: string; - spot?: boolean; - paginaProduto?: boolean; - marketplace?: boolean; - somenteParceiros?: boolean; - reseller?: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }; - buyBox?: boolean; - consumo?: { - quantidadeDias?: number; - enviarEmail?: boolean; - }; - prazoValidade?: number; - }; - }; - /** - * Atualiza um produto com base nos dados enviados - */ - "PUT /produtos/:identificador": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Representa o ProdutoId agrupador por variante (optional) - */ - idPaiExterno?: string; - /** - * Representa o ParentId agrupador por parent (optional) - */ - idVinculoExterno?: string; - /** - * (Max Length: 50) Sku do produto - */ - sku?: string; - /** - * (Max Length: 300) Nome do produto variante - */ - nome?: string; - /** - * Nome do produto (pai do variante) (optional) - */ - nomeProdutoPai?: string; - /** - * Tipo de exibição da matriz de atributos (optional) - */ - exibirMatrizAtributos?: "Sim" | "Nao" | "Neutro"; - /** - * Se o produto aceita contra proposta (optional) - */ - contraProposta?: boolean; - /** - * (Max Length: 100) Nome do fabricante - */ - fabricante?: string; - /** - * (Max Length: 500) Nome do autor (optional) - */ - autor?: string; - /** - * (Max Length: 100) Nome da editora (optional) - */ - editora?: string; - /** - * (Max Length: 100) Nome da coleção (optional) - */ - colecao?: string; - /** - * (Max Length: 100) Nome do gênero (optional) - */ - genero?: string; - /** - * Max Length: 8, "0000.0000,00") Preço de custo do produto variante (optional) - */ - precoCusto?: number; - /** - * (Max Length: 8, "0000.0000,00") "Preço De" do produto variante (optional) - */ - precoDe?: number; - /** - * (Max Length: 8, "0000.0000,00") "Preço Por" de venda do produto variante - */ - precoPor?: number; - /** - * (Max Length: 8, "0000.0000,00") Fator multiplicador que gera o preço de exibição do produto.Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) (optional) - */ - fatorMultiplicadorPreco?: number; - /** - * Prazo de entrega do produto variante (optional) - */ - prazoEntrega?: number; - /** - * Define se um produto variante é valido ou não (optional) - */ - valido?: boolean; - /** - * Define se um produto deve ser exibido no site (optional) - */ - exibirSite?: boolean; - /** - * Define a qual regra de calculo de frete o produto vai pertencer - */ - freteGratis?: "Sempre" | "Nunca" | "Neutro" | "Desconsiderar_Regras"; - /** - * Define se o produto variante tem troca grátis (optional) - */ - trocaGratis?: boolean; - /** - * (Max Length: 8, "0000.0000,00") Peso do produto variante, em gramas (g) - */ - peso?: number; - /** - * (Max Length: 8, "0000.0000,00") Altura do produto variante, em centímetros (cm). - */ - altura?: number; - /** - * (Max Length: 8, "0000.0000,00") Comprimento do produto variante, em centímetros (cm). - */ - comprimento?: number; - /** - * (Max Length: 8, "0000.0000,00") Largura do produto variante, em centímetros (cm). - */ - largura?: number; - /** - * Define se o produto variante tem garantia (optional) - */ - garantia?: number; - /** - * Define se o produto contém televendas (optional) - */ - isTelevendas?: boolean; - /** - * (Max Length: 25) EAN do produto variante (optional) - */ - ean?: string; - /** - * (Max Length: 255) Localização no estoque do produto variante (optional) - */ - localizacaoEstoque?: string; - /** - * Dados de atacado do produto variante (optional) - */ - listaAtacado?: { - /** - * (Max Length: 8, "0000.0000,00") - Preco Por do item por atacado - */ - precoPor?: number; - /** - * Quantidade para compra de atacado - */ - quantidade?: number; - }[]; - /** - * Lista de estoque/centro de distribuição do produto. Obrigatório se valido for true (optional) - */ - estoque?: { - /** - * Estoque físico do produto - */ - estoqueFisico?: number; - /** - * Estoque reservado do produto - */ - estoqueReservado?: number; - /** - * Id do centro de distribuição do estoque do produto - */ - centroDistribuicaoId?: number; - /** - * Quantidade para ativar o alerta de estoque - */ - alertaEstoque?: number; - }[]; - /** - * Lista de atributos do produto - */ - listaAtributos?: { - /** - * (Max Length: 100) - Define o nome do atributo - */ - nome?: string; - /** - * (Max Length: 8, "0000.0000,00") - Define o valor do atributo - */ - valor?: string; - /** - * Define se o atributo deverá ser exibido - */ - exibir?: boolean; - }[]; - /** - * Quantidade máxima de compra do produto variante (optional) - */ - quantidadeMaximaCompraUnidade?: number; - /** - * Quantidade mínima de compra do produto variante (optional) - */ - quantidadeMinimaCompraUnidade?: number; - /** - * Condição do produto variante (optional) - */ - condicao?: "Novo" | "Usado" | "Renovado" | "Danificado"; - /** - * Url do vídeo do Produto (optional) - */ - urlVideo?: string; - /** - * Se o produto aparece no Spot (optional) - */ - spot?: boolean; - /** - * Se o produto aparece na Url (optional) - */ - paginaProduto?: boolean; - /** - * Se o produto aparece no Marketplace (optional) - */ - marketplace?: boolean; - /** - * Se o produto aparece somente nos Parceiros - */ - somenteParceiros?: boolean; - /** - * Se o produto deve ser agrupado pelo EAN (optional) - */ - buyBox?: boolean; - /** - * Prazo de validade ou consumo do produto (optional) - */ - prazoValidade?: number; - /** - * Dados de consumo de produto e se deve enviar os dias de consumo por e-mail (optional) - */ - consumo?: { - /** - * Quantidade de Dias (optional) - */ - quantidadeDias?: number; - /** - * Enviar e-mail (optional) - */ - enviarEmail?: boolean; - }; - }; - }; - /** - * Lista de versões - */ - "GET /gestorscripts/scripts/:scriptId/versoes": { - response: { - versaoId?: number; - scriptId?: number; - dataCadastro?: string; - identificadorPagina?: string; - publicado?: boolean; - usuario?: string; - }[]; - }; - /** - * Insere uma versão para um script existente - */ - "POST /gestorscripts/scripts/:scriptId/versoes": { - body: { - /** - * Identificador da página - */ - identificadorPagina?: string; - /** - * Conteúdo do script - */ - conteudo?: string; - /** - * Status do script - */ - publicado?: boolean; - }; - }; - /** - * Reseller específico - */ - "GET /resellers/token": { - response: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }; - }; - /** - * Categoria encontrada - */ - "GET /categorias/erp/:id": { - searchParams: { - /** - * Hierarquia da categoria - */ - hierarquia?: boolean; - /** - * Se será apresentado somente categorias filhas - */ - somenteFilhos?: boolean; - }; - response: { - id?: number; - nome?: string; - categoriaPaiId?: number; - categoriaERPId?: string; - ativo?: boolean; - isReseller?: boolean; - exibirMatrizAtributos?: string; - quantidadeMaximaCompraUnidade?: number; - valorMinimoCompra?: number; - exibeMenu?: boolean; - urlHotSite?: string; - }; - }; - /** - * Atualiza uma categoria utilizando o id do erp como identificador - */ - "PUT /categorias/erp/:id": { - body: { - /** - * Nome da categoria (optional) - */ - nome?: string; - /** - * Id da categoria pai (optional) - */ - categoriaPaiId?: number; - /** - * Id da categoria ERP (optional) - */ - categoriaERPId?: string; - /** - * Categoria ativo/inativo (optional) - */ - ativo?: boolean; - /** - * Categoria de reseller (optional) - */ - isReseller?: boolean; - /** - * Exibir Matriz de Atributos (optional) - */ - exibirMatrizAtributos?: "Sim" | "Nao" | "Neutro"; - /** - * Informe a quantidade máxima permitida para compra por produtos desta categoria. Informe zero para assumir a configuração geral da loja (optional) - */ - quantidadeMaximaCompraUnidade?: number; - /** - * Informe o valor mínimo para compra em produtos desta categoria (optional) - */ - valorMinimoCompra?: number; - /** - * Informe se será exibida no menu (optional) - */ - exibeMenu?: boolean; - }; - }; - /** - * Categoria excluída com sucesso - */ - "DELETE /categorias/erp/:id": {}; - /** - * Templates - */ - "GET /templates": {}; - /** - * Lista de usuários - */ - "GET /usuarios": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Data inicial da data de criação do usuário que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final da data de criação do usuário que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - /** - * Tipo de filtro de data - */ - enumTipoFiltroData?: "DataAlteracao" | "DataCriacao"; - /** - * Status de aprovação - */ - aprovado?: boolean; - }; - response: { - usuarioId?: number; - bloqueado?: boolean; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - avatar?: string; - ip?: string; - aprovado?: boolean; - }[]; - }; - /** - * Insere um novo usuário - */ - "POST /usuarios": { - body: { - /** - * Tipo de pessoa - */ - tipoPessoa?: "Fisica" | "Juridica"; - /** - * Origem do contato - */ - origemContato?: - | "Google" - | "Bing" - | "Jornal" - | "PatrocinioEsportivo" - | "RecomendacaoAlguem" - | "Revista" - | "SiteInternet" - | "Televisao" - | "Outro" - | "UsuarioImportadoViaAdmin" - | "PayPalExpress"; - /** - * Tipo Sexo (optional) - */ - tipoSexo?: "Undefined" | "Masculino" | "Feminino"; - /** - * Nome do usuário (Max Length: 100) - */ - nome?: string; - /** - * CPF do usuário caso seja pessoa física (Max Length: 50) (optional) - */ - cpf?: string; - /** - * E-mail do usuário (Max Length: 100) - */ - email?: string; - /** - * RG do usuário caso seja pessoa física (Max Length: 50) (optional) - */ - rg?: string; - /** - * Telefone residencial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) - */ - telefoneResidencial?: string; - /** - * Telefone celular do usuário. Deve ser informado o DDD junto ao número (Max Length: 50) (optional) - */ - telefoneCelular?: string; - /** - * Telefone comercial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) (optional) - */ - telefoneComercial?: string; - /** - * Data de nascimento (optional) - */ - dataNascimento?: string; - /** - * Razão social do usuário, caso seja uma pessoa jurídica(Max Length: 100) (optional) - */ - razaoSocial?: string; - /** - * CNPJ do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) - */ - cnpj?: string; - /** - * Inscrição estadual do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) - */ - inscricaoEstadual?: string; - /** - * Responsável(Max Length: 100) (optional) - */ - responsavel?: string; - /** - * Data de criação do cadastro (optional) - */ - dataCriacao?: string; - /** - * Data de atualização do cadastro (optional) - */ - dataAtualizacao?: string; - /** - * Se o usuário é revendedor (optional) - */ - revendedor?: boolean; - /** - * Informação cadastral (optional) - */ - listaInformacaoCadastral?: { - /** - * Chave - */ - chave?: string; - /** - * Valor - */ - valor?: string; - }[]; - /** - * Avatar (Max Length: 50) (optional) - */ - avatar?: string; - /** - * IP do usuário (Max Length: 20) (optional) - */ - ip?: string; - /** - * Seta ou retorna o valor de Aprovado (optional) - */ - aprovado?: boolean; - }; - }; - /** - * Dados da loja - */ - "GET /loja": { - response: { - nome?: string; - urlSite?: string; - urlCarrinho?: string; - }; - }; - /** - * Indicadores de Faturamento - */ - "GET /dashboard/faturamento": { - searchParams: { - /** - * Data inicial dos indicadores que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos indicadores que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Data inicial do comparativo dos indicadores que deverão retonar (aaaa-mm-dd) - */ - dataInicialComparativo?: string; - /** - * Data final do comparativo dos indicadores que deverão retonar (aaaa-mm-dd) - */ - dataFinalComparativo?: string; - }; - response: { - indicadorReceita?: number; - indicadorPedido?: number; - indicadorTicketMedio?: number; - indicadorReceitaComparativo?: number; - indicadorPedidoComparativo?: number; - indicadorTicketMedioComparativo?: number; - indicadorReceitaFormatado?: string; - indicadorPedidoFormatado?: string; - indicadorTicketMedioFormatado?: string; - indicadorReceitaComparativoFormatado?: string; - indicadorPedidoComparativoFormatado?: string; - indicadorTicketMedioComparativoFormatado?: string; - indicadorReceitaPorcentagem?: string; - indicadorPedidoPorcentagem?: string; - indicadorTicketMedioPorcentagem?: string; - }; - }; - /** - * Grupo de assinatura - */ - "GET /assinaturas/grupoassinatura": { - response: { - grupoAssinaturaId?: number; - nome?: string; - recorrencias?: { - recorrenciaId?: number; - nome?: string; - dias?: number; - }[]; - }[]; - }; - /** - * Lista de pedidos - */ - "GET /pedidos/:pedidoId/rastreamento": { - response: { - pedidoRastreamentoId?: number; - dataAtualizacao?: string; - notaFiscal?: string; - serieNF?: string; - cfop?: number; - dataEnviado?: string; - urlNFE?: string; - chaveAcessoNFE?: string; - rastreamento?: string; - urlRastreamento?: string; - transportadora?: string; - dataEntrega?: string; - }; - }; - /** - * Insere um rastreamento e status a um pedido - */ - "POST /pedidos/:pedidoId/rastreamento": { - body: { - /** - * Id da situação do pedido - */ - situacaoPedidoId?: number; - /** - * Id do centro de distribuição - */ - centroDistribuicaoId?: number; - /** - * Rastreamento (optional) - */ - rastreamento?: string; - /** - * Data do pedido (optional) - */ - dataEvento?: string; - /** - * Número da nota fiscal (optional) - */ - numeroNotaFiscal?: string; - /** - * Chave acesso NFE (optional) - */ - chaveAcessoNFE?: string; - /** - * URL NFE (optional) - */ - urlNFE?: string; - /** - * Serie NFE (optional) - */ - serieNFE?: string; - /** - * CFOP (optional) - */ - cfop?: string; - /** - * URL Rastreamento (optional) - */ - urlRastreamento?: string; - }; - }; - /** - * Atualiza a data de entrega do pedido - */ - "PUT /pedidos/:pedidoId/rastreamento": { - body: { - /** - * Objeto com os dados do rastreamento - */ - RAW_BODY: { - /** - * Código de verificação do transporte do produto - */ - rastreamento?: string; - /** - * Data que a entrega foi realizada - */ - dataEntrega?: string; - }; - }; - }; - /** - * Rastreamento de produto encontrado - */ - "GET /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento/:pedidoRastreamentoProdutoId": - { - response: { - pedidoRastreamentoProdutoId?: number; - pedidoId?: number; - produtoVarianteId?: number; - pedidoProdutoId?: number; - dataInclusao?: string; - dataAlteracao?: string; - notaFiscal?: string; - cfop?: number; - dataEnviado?: string; - chaveAcessoNFE?: string; - rastreamento?: string; - urlRastreamento?: string; - quantidade?: number; - urlNFE?: string; - serieNFE?: string; - tipoPostagem?: string; - centroDistribuicao?: string; - transportadora?: string; - dataEntrega?: string; - }; - }; - /** - * Atualiza rastreamento de produto completo (com os dados da N.F.) - */ - "PUT /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento/:pedidoRastreamentoProdutoId": - { - body: { - /** - * Nota Fiscal - */ - notaFiscal?: string; - /** - * CFOP - */ - cfop?: number; - /** - * Data Enviado - */ - dataEnviado?: string; - /** - * Chave de acesso NFE - */ - chaveAcessoNFE?: string; - /** - * Rastreamento (optional) - */ - rastreamento?: string; - /** - * URL de rastreamento (optional) - */ - urlRastreamento?: string; - /** - * Transportadora (optional) - */ - transportadora?: string; - /** - * Data da entrega (optional) - */ - dataEntrega?: string; - }; - }; - /** - * Lista de detalhes de frete - */ - "GET /fretes/:freteId/detalhes": { - response: { - freteId?: number; - cepInicial?: number; - cepFinal?: number; - variacoesFreteDetalhe?: { - pesoInicial?: number; - pesoFinal?: number; - valorFrete?: number; - prazoEntrega?: number; - valorPreco?: number; - valorPeso?: number; - }[]; - }[]; - }; - /** - * Insere um novo detalhe de frete vinculado a um contrato de frete - */ - "POST /fretes/:freteId/detalhes": { - body: { - /** - * Informe o cep inicial (optional) - */ - cepInicial?: number; - /** - * Informe o cep final (optional) - */ - cepFinal?: number; - /** - * Variações de detalhe do frete (optional) - */ - variacoesFreteDetalhe?: { - /** - * Informe o peso inicial - */ - pesoInicial?: number; - /** - * Informe o peso final - */ - pesoFinal?: number; - /** - * Informe o valor do frete - */ - valorFrete?: number; - /** - * Informe o prazo de entrega - */ - prazoEntrega?: number; - /** - * Informe o valor preço - */ - valorPreco?: number; - /** - * Informe o valor peso - */ - valorPeso?: number; - }[]; - }; - }; - /** - * Exclui os detalhes de um contrato de frete - */ - "DELETE /fretes/:freteId/detalhes": {}; - /** - * Pedido encontrado - */ - "GET /pedidos/:pedidoId": { - response: { - pedidoId?: number; - situacaoPedidoId?: number; - tipoRastreamentoPedido?: string; - transacaoId?: number; - data?: string; - dataPagamento?: string; - dataUltimaAtualizacao?: string; - valorFrete?: number; - valorTotalPedido?: number; - valorDesconto?: number; - valorDebitoCC?: number; - cupomDesconto?: string; - marketPlacePedidoId?: string; - marketPlacePedidoSiteId?: string; - canalId?: number; - canalNome?: string; - canalOrigem?: string; - retiradaLojaId?: number; - isPedidoEvento?: boolean; - usuario?: { - usuarioId?: number; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - }; - pedidoEndereco?: { - tipo?: string; - nome?: string; - endereco?: string; - numero?: string; - complemento?: string; - referencia?: string; - cep?: string; - tipoLogradouro?: string; - logradouro?: string; - bairro?: string; - cidade?: string; - estado?: string; - pais?: string; - }[]; - frete?: { - freteContratoId?: number; - freteContrato?: string; - referenciaConector?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - retiradaLojaId?: number; - centrosDistribuicao?: { - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - servico?: { - servicoId?: number; - nome?: string; - transportadora?: string; - prazo?: number; - servicoNome?: string; - preco?: number; - servicoTransporte?: number; - codigo?: number; - servicoMeta?: string; - custo?: number; - token?: string; - }; - retiradaAgendada?: { - lojaId?: number; - retiradaData?: string; - retiradaPeriodo?: string; - nome?: string; - documento?: string; - codigoRetirada?: string; - }; - agendamento?: { - de?: string; - ate?: string; - }; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }; - itens?: { - produtoVarianteId?: number; - sku?: string; - nome?: string; - quantidade?: number; - precoCusto?: number; - precoVenda?: number; - isBrinde?: boolean; - valorAliquota?: number; - isMarketPlace?: boolean; - precoPor?: number; - desconto?: number; - totais?: { - precoCusto?: number; - precoVenda?: number; - precoPor?: number; - desconto?: number; - }; - ajustes?: { - tipo?: string; - valor?: number; - observacao?: string; - nome?: string; - }[]; - centroDistribuicao?: { - centroDistribuicaoId?: number; - quantidade?: number; - situacaoProdutoId?: number; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - }[]; - valoresAdicionais?: { - tipo?: string; - origem?: string; - texto?: string; - valor?: number; - }[]; - atributos?: { - produtoVarianteAtributoValor?: string; - produtoVarianteAtributoNome?: string; - }[]; - embalagens?: { - tipoEmbalagemId?: number; - nomeTipoEmbalagem?: string; - mensagem?: string; - valor?: number; - descricao?: string; - }[]; - personalizacoes?: { - nomePersonalizacao?: string; - valorPersonalizacao?: string; - valor?: number; - }[]; - frete?: { - quantidade?: number; - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - dadosProdutoEvento?: { - tipoPresenteRecebimento?: string; - }; - formulas?: { - chaveAjuste?: string; - valor?: number; - nome?: string; - expressao?: string; - expressaoInterpretada?: string; - endPoint?: string; - }[]; - seller?: { - sellerId?: number; - sellerNome?: string; - sellerPedidoId?: number; - }; - }[]; - assinatura?: { - assinaturaId?: number; - grupoAssinaturaId?: number; - tipoPeriodo?: string; - tempoPeriodo?: number; - percentualDesconto?: number; - }[]; - pagamento?: { - formaPagamentoId?: number; - numeroParcelas?: number; - valorParcela?: number; - valorDesconto?: number; - valorJuros?: number; - valorTotal?: number; - boleto?: { - urlBoleto?: string; - codigoDeBarras?: string; - }; - cartaoCredito?: { - numeroCartao?: string; - nomeTitular?: string; - dataValidade?: string; - codigoSeguranca?: string; - documentoCartaoCredito?: string; - token?: string; - info?: string; - bandeira?: string; - }[]; - pagamentoStatus?: { - numeroAutorizacao?: string; - numeroComprovanteVenda?: string; - dataAtualizacao?: string; - dataUltimoStatus?: string; - adquirente?: string; - tid?: string; - }[]; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }[]; - observacao?: { - observacao?: string; - usuario?: string; - data?: string; - publica?: boolean; - }[]; - valorCreditoFidelidade?: number; - valido?: boolean; - valorSubTotalSemDescontos?: number; - pedidoSplit?: number[]; - }; - }; - /** - * Lista de identificadores de conteúdos vinculados ao hotsite - */ - "GET /hotsites/:hotsiteId/conteudos": { - response: { - conteudoId?: number; - }[]; - }; - /** - * Vincula um ou mais conteúdos a um hotsite específico - */ - "POST /hotsites/:hotsiteId/conteudos": { - body: { - /** - * Lista de identificadores de conteúdos a serem vinculados - */ - RAW_BODY: { - /** - * Identificador do conteúdo - */ - conteudoId?: number; - }[]; - }; - }; - /** - * Desvincula um ou mais conteúdos de um hotsite específico - */ - "DELETE /hotsites/:hotsiteId/conteudos": { - body: { - /** - * Lista de identificadores de conteúdos a serem desvinculados - */ - conteudos?: { - /** - * Identificador do conteúdo - */ - conteudoId?: number; - }[]; - }; - }; - /** - * Atualiza um campo de cadastro personalizado pelo id - */ - "PUT /usuarios/camposcadastropersonalizado/:camposcadastropersonalizadoId": { - body: { - /** - * Nome do campo (optional) - */ - nome?: string; - /** - * Se o campo será obrigatório (optional) - */ - obrigatorio?: boolean; - /** - * Ordem (optional) - */ - ordem?: number; - }; - }; - /** - * Remove um campo de cadastro personalizado - */ - "DELETE /usuarios/camposcadastropersonalizado/:camposcadastropersonalizadoId": - {}; - /** - * Dados do serviço de frete do pedido - */ - "GET /pedidos/:pedidoId/frete": {}; - /** - * Tabela de preços específica - */ - "GET /tabelaPrecos/:tabelaPrecoId": { - response: { - tabelaPrecoId?: number; - nome?: string; - dataInicial?: string; - dataFinal?: string; - ativo?: boolean; - isSite?: boolean; - }; - }; - /** - * Atualiza uma tabela de preços - */ - "PUT /tabelaPrecos/:tabelaPrecoId": { - body: { - /** - * Nome da tabela de preço - */ - nome?: string; - /** - * Data que inicia a tabela de preço - */ - dataInicial?: string; - /** - * Data de término da tabela de preço - */ - dataFinal?: string; - /** - * Status da tabela de preço - */ - ativo?: boolean; - }; - }; - /** - * Exclui uma tabela de preços - */ - "DELETE /tabelaPrecos/:tabelaPrecoId": {}; - /** - * Último status do pedido - */ - "GET /pedidos/:pedidoId/status": { - response: { - situacaoPedidoId?: number; - dataAtualizacao?: string; - notaFiscal?: string; - cfop?: number; - dataEnviado?: string; - chaveAcessoNFE?: string; - rastreamento?: string; - urlRastreamento?: string; - nomeTransportadora?: string; - produtos?: { - produtoVarianteId?: number; - situacaoProdutoId?: number; - quantidade?: number; - centroDistribuicaoId?: number; - }[]; - }; - }; - /** - * Atualiza a situação do status do pedido - */ - "PUT /pedidos/:pedidoId/status": { - body: { - /** - * Id da situação do pedido - */ - RAW_BODY: { - /** - * Id da situação do pedido - */ - id?: number; - }; - }; - }; - /** - * Lista de Tópicos - */ - "GET /webhook/Topicos": { - response: { - nome?: string; - descricao?: string; - payload?: string; - }[]; - }; - /** - * Seta o pedido como integrado - */ - "POST /pedidos/complete": { - body: { - /** - * Pedido que se deseja inserir o "complete" - */ - RAW_BODY: { - /** - * Id do pedido - */ - pedidoId?: number; - }; - }; - }; - /** - * Portfolio encontrado - */ - "GET /portfolios/:portfolioId": { - response: { - portfolioId?: number; - nome?: string; - ativo?: boolean; - }; - }; - /** - * Atualiza um portfolio - */ - "PUT /portfolios/:portfolioId": { - body: { - /** - * Nome do portfolio - */ - nome?: string; - }; - }; - /** - * Deleta um portfolio - */ - "DELETE /portfolios/:portfolioId": {}; - /** - * Retorna se o produto variante está disponível ou não - */ - "GET /produtos/:identificador/disponibilidade": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - }; - /** - * Lista de formas de pagamento - */ - "GET /formasPagamento": { - response: { - formaPagamentoId?: number; - nome?: string; - nomeExibicao?: string; - descricao?: string; - }[]; - }; - /** - * Lista de pedidos - */ - "GET /pedidos/:pedidoId/rastreamento/produtos": { - response: { - produtoVarianteId?: number; - rastreamentos?: { - pedidoRastreamentoProdutoId?: number; - quantidade?: number; - dataAtualizacao?: string; - notaFiscal?: string; - cfop?: number; - dataEnviado?: string; - chaveAcessoNFE?: string; - rastreamento?: string; - urlRastreamento?: string; - transportadora?: string; - centroDistribuicaoId?: number; - dataEntrega?: string; - }[]; - }[]; - }; - /** - * Altera o status de um portfolio - */ - "PUT /portfolios/:portfolioId/status": { - body: { - /** - * Status do portfolio: true ou false - */ - RAW_BODY?: { - /** - * Novo status do portfolio - */ - ativo?: boolean; - }; - }; - }; - /** - * Limite de crédito que estão vinculados aos usuários - */ - "GET /usuarios/limiteCredito": { - response: { - usuarioId?: number; - valor?: number; - saldo?: number; - }[]; - }; - /** - * Exclui uma imagem de um produto - */ - "DELETE /produtos/:identificador/imagens/:id": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - }; - /** - * Extrato retornado com sucesso - */ - "GET /contascorrentes/:email/extrato": { - searchParams: { - /** - * Data Inicial para verificar extrato - */ - dataInicial?: string; - /** - * Data Final para verificar extrato - */ - dataFinal?: string; - }; - response: { - data?: string; - historico?: string; - valor?: number; - tipoLancamento?: string; - observacao?: string; - visivelParaCliente?: boolean; - }[]; - }; - /** - * Lista de observações de um pedido - */ - "GET /pedidos/:pedidoId/observacao": { - response: { - observacao?: string; - usuario?: string; - publica?: boolean; - data?: string; - }[]; - }; - /** - * Insere uma observação a um pedido - */ - "POST /pedidos/:pedidoId/observacao": { - body: { - /** - * Objeto com os dados da observação (optional) - */ - RAW_BODY: { - /** - * Texto da observação - */ - observacao?: string; - /** - * Nome do usuário que está inserindo a observação - */ - usuario?: string; - /** - * Se a observação é publica ou privada - */ - publica?: boolean; - }; - }; - }; - /** - * Lista de centros de distribuição - */ - "GET /centrosdistribuicao": { - response: { - id?: number; - nome?: string; - cep?: number; - padrao?: boolean; - }[]; - }; - /** - * Lista de avaliações de produtos - */ - "GET /produtoavaliacao": { - searchParams: { - /** - * Referente ao status que libera a visualização da avaliação no site - */ - status?: "Pendente" | "NaoAprovado" | "Aprovado"; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - }; - response: { - produtoVarianteId?: number; - sku?: string; - produtoAvaliacaoId?: number; - comentario?: string; - avaliacao?: number; - usuarioId?: number; - dataAvaliacao?: string; - nome?: string; - email?: string; - status?: string; - }[]; - }; - /** - * Conteúdo encontrado - */ - "GET /conteudos/:conteudoId": {}; - /** - * Atualiza um conteúdo - */ - "PUT /conteudos/:conteudoId": { - body: { - /** - * Titulo do conteúdo - */ - titulo?: string; - /** - * Conteúdo ativo/inativo - */ - ativo?: boolean; - /** - * Data de inicio de exibição do conteúdo (optional) - */ - dataInicio?: string; - /** - * Data de final de exibição do conteúdo (optional) - */ - dataFim?: string; - /** - * Posicionamento do conteúdo - */ - posicionamento?: - | "Topo" - | "Centro" - | "Rodape" - | "LateralDireita" - | "LateralEsquerda" - | "MobileTopo" - | "MobileRodape"; - /** - * Informações do conteúdo - */ - conteudo?: string; - /** - * Insira em qual Termo de Busca o Conteúdo será exibido (optional) - */ - termoBusca?: string; - /** - * Exibição do conteúdo nas buscas - */ - exibeTodasBuscas?: boolean; - /** - * Não exibição do conteúdo nas buscas - */ - naoExibeBuscas?: boolean; - /** - * Exibição do conteúdo nos hotsites - */ - exibeTodosHotsites?: boolean; - /** - * Insira quais Hotsites que o Conteúdo será exibido (optional) - */ - hotsiteId?: number[]; - }; - }; - /** - * Atualiza o status do tipo de evento, ativando-o ou inativando-o - */ - "PUT /tiposEvento/:tipoEventoId/AlterarStatus": {}; - /** - * Lista de produtos variantes vinculados aos tipo de evento - */ - "GET /tiposEvento/:tipoEventoId/produtos": { - response: { - tipoEventoId?: number; - produtoVariantePrincipalId?: number; - }[]; - }; - /** - * Lista de resposta para cada produto vinculado - */ - "POST /tiposEvento/:tipoEventoId/produtos": { - body: { - /** - * Identificadores dos produtos variantes a serem vinculados ao tipo evento desejado - */ - produtos?: { - /** - * Identificador do produto variante - */ - produtoVarianteId?: number; - }[]; - }; - response: { - sugestaoProdutosInseridos?: { - tipoEventoId?: number; - produtoVarianteId?: number; - detalhes?: string; - }[]; - produtosNaoInseridos?: { - tipoEventoId?: number; - produtoVarianteId?: number; - detalhes?: string; - }[]; - }; - }; - /** - * Atualiza os produtos sugeridos de um tipo de evento - */ - "PUT /tiposEvento/:tipoEventoId/produtos": { - body: { - /** - * Identificadores dos produtos variantes a serem vinculados ao tipo evento desejado - */ - produtos?: { - /** - * Identificador do produto variante - */ - produtoVarianteId?: number; - }[]; - }; - }; - /** - * Atualiza a ativação automática de produtos de um Seller - */ - "PUT /resellers/:resellerId/ativacaoAutomaticaProdutos": { - body: { - /** - * Status da ativação automática de produtos - */ - ativo?: boolean; - }; - }; - /** - * Gráfico Forma de Pagamento - */ - "GET /dashboard/graficoformapagamento": { - searchParams: { - /** - * Data inicial dos pedidos com as formas de pagamento que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos pedidos com as formas de pagamento que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Id do parceiro - */ - parceiroId?: number; - }; - response: { - nome?: string; - quantidade?: number; - cor?: string; - }[]; - }; - /** - * Lista de números de pedidos ainda não integrados - */ - "GET /pedidos/naoIntegrados": { - response: { - pedidoId?: number; - }[]; - }; - /** - * Dados da lista de desejos de um usuário - */ - "GET /usuarios/:usuarioId/listaDesejos": { - response: { - produtoId?: number; - produtoVarianteId?: number; - quantidade?: number; - dataAdicao?: string; - }[]; - }; - /** - * Usuários encontrados - */ - "GET /parceiros/:nome/usuarios": { - response: { - usuarioId?: number; - email?: string; - ativo?: boolean; - dataInicial?: string; - dataFinal?: string; - vinculoVitalicio?: boolean; - }[]; - }; - /** - * Indicador dos Novos Compradores - */ - "GET /dashboard/novoscompradores": { - searchParams: { - /** - * Data inicial dos novos compradores que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos novos compradores que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - }; - response: { - indicadorComprador?: string; - }; - }; - /** - * Lista de produtos variantes vinculados aos tipo de evento - */ - "GET /eventos": { - searchParams: { - /** - * Data de inicio do evento - */ - dataInicial?: string; - /** - * Data do termino do evento - */ - dataFinal?: string; - /** - * Status do evento - */ - disponivel?: boolean; - /** - * Titulo do evento - */ - titulo?: string; - /** - * Email do Usuário - */ - usuarioEmail?: string; - /** - * Identificador do Tipo de Evento - */ - tipoEventoId?: number; - }; - response: { - eventoId?: number; - tipoEventoId?: number; - userId?: number; - enderecoEntregaId?: number; - data?: string; - dataCriacao?: string; - titulo?: string; - url?: string; - disponivel?: boolean; - diasDepoisEvento?: number; - diasAntesEvento?: number; - urlLogoEvento?: string; - urlCapaEvento?: string; - proprietarioEvento?: string; - abaInfo01Habilitado?: boolean; - textoInfo01?: string; - conteudoInfo01?: string; - abaInfo02Habilitado?: boolean; - textoInfo02?: string; - conteudoInfo02?: string; - abaMensagemHabilitado?: boolean; - fotos?: string; - enumTipoListaPresenteId?: string; - enumTipoEntregaId?: string; - eventoProdutoSelecionado?: { - eventoId?: number; - produtoVarianteId?: number; - recebidoForaLista?: boolean; - removido?: boolean; - }[]; - enderecoEvento?: { - enderecoEventoId?: number; - eventoId?: number; - nome?: string; - cep?: string; - endereco?: string; - numero?: string; - bairro?: string; - cidade?: string; - estado?: string; - }[]; - }[]; - }; - /** - * Cria um Novo Evento - */ - "POST /eventos": { - body: { - /** - * Identificador do tipo de evento - */ - tipoEventoId?: number; - /** - * Identificador do endereço de entrega - */ - enderecoEntregaId?: number; - /** - * Titulo do evento - */ - titulo?: string; - /** - * URL do evento - */ - url?: string; - /** - * Data do Evento - */ - data?: string; - /** - * Email do usuário - */ - usuarioEmail?: string; - /** - * Disponibilidade do evento (optional) - */ - disponivel?: boolean; - /** - * Quantos dias antes do evento ele será exibido (optional) - */ - diasAntesEvento?: number; - /** - * Até quantos dias depois do evento ele será exibido (optional) - */ - diasDepoisEvento?: number; - /** - * Url do Logo. (Base64) - */ - urlLogo?: string; - /** - * Url da Capa. (Base64) - */ - urlCapa?: string; - /** - * Quem é o proprietário - */ - proprietario?: string; - /** - * Se a aba de informação 01 será habilitada - */ - abaInfo01Habilitado?: boolean; - /** - * Texto para o campo informação 01 (optional) - */ - textoInfo01?: string; - /** - * Conteúdo para o campo informação 01 (optional) - */ - conteudoInfo01?: string; - /** - * Se a aba de informação 02 será habilitada - */ - abaInfo02Habilitado?: boolean; - /** - * Texto para o campo informação 02 (optional) - */ - textoInfo02?: string; - /** - * Conteúdo para o campo informação 02 (optional) - */ - conteudoInfo02?: string; - /** - * Se a aba de mensagem será habilitada (optional) - */ - abaMensagemHabilitado?: boolean; - /** - * Tipo de lista de presente - */ - enumTipoListaPresenteId?: "ListaPronta" | "ListaManual"; - /** - * Tipo de entrega - */ - enumTipoEntregaId?: - | "EntregaAgendada" - | "EntregaConformeCompraRealizada" - | "Todos" - | "Nenhum"; - /** - * Seleção de produto no evento - */ - eventoProdutoSelecionado?: { - /** - * Id do produto variante - */ - produtoVarianteId?: number; - /** - * Se produto recebido fora da lista (optional) - */ - recebidoForaLista?: boolean; - /** - * Se produto removido (optional) - */ - removido?: boolean; - }[]; - /** - * Endereço do Evento - */ - enderecoEvento?: { - /** - * Nome para identificação do endereço - */ - nome?: string; - /** - * Endereço - */ - endereco?: string; - /** - * Cep do endereço - */ - cep?: string; - /** - * Numero do endereço - */ - numero?: string; - /** - * Bairro do endereço - */ - bairro?: string; - /** - * Cidade do endereço - */ - cidade?: string; - /** - * Estado do endereço - */ - estado?: string; - }[]; - }; - }; - /** - * Retorna todas as informações de um produto específico - */ - "GET /produtos/:identificador/informacoes": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId" | "ProdutoId"; - }; - response: { - informacaoId?: number; - titulo?: string; - texto?: string; - tipoInformacao?: string; - }[]; - }; - /** - * Adiciona uma nova informação - */ - "POST /produtos/:identificador/informacoes": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - /** - * Define o tipo de retorno a ser recebido. Id retorna o InformacaoProdutoId da informação inserida, Booleano retorna true ou false, de acordo com o resultado da operação. Valor padrão Booleano - */ - tipoRetorno?: "Id" | "Booleano"; - }; - body: { - /** - * Titulo da informação (optional) - */ - titulo?: string; - /** - * Texto da informação (optional) - */ - texto?: string; - /** - * Informação se o produto variante está visível no site. - */ - exibirSite?: boolean; - /** - * Tipo de informação do produto (optional) - */ - tipoInformacao?: - | "Informacoes" - | "Beneficios" - | "Especificacoes" - | "DadosTecnicos" - | "Composicao" - | "ModoDeUsar" - | "Cuidados" - | "ItensInclusos" - | "Dicas" - | "Video" - | "Descricao" - | "ValorReferente" - | "PopUpReferente" - | "Prescricao" - | "TabelaDeMedidas" - | "Spot" - | "Sinopse" - | "Carrinho"; - }; - }; - /** - * Indicador do Carrinho Abandonado - */ - "GET /dashboard/carrinhoabandonado": { - searchParams: { - /** - * Data inicial dos carrinhos abandonados que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos carrinhos abandonados que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - }; - response: { - indicadorCarrinhoAbandonado?: string; - }; - }; - /** - * Lista de Metatags do produto informado - */ - "GET /produtos/:identificador/seo/metaTag": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - response: { - metatagId?: number; - content?: string; - httpEquiv?: string; - name?: string; - scheme?: string; - }[]; - }; - /** - * Insere um ou mais metatags para um produto - */ - "POST /produtos/:identificador/seo/metaTag": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno da fstore - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - body: { - /** - * Lista de metatags (optional) - */ - metas?: { - /** - * Dados da Meta Tag - */ - content?: string; - /** - * Dados da Meta Tag - */ - httpEquiv?: string; - /** - * Dados da Meta Tag - */ - name?: string; - /** - * Dados da Meta Tag - */ - scheme?: string; - }[]; - }; - response: { - metatagId?: number; - content?: string; - httpEquiv?: string; - name?: string; - scheme?: string; - }[]; - }; - /** - * Deleta um ou mais Metatags de produto - */ - "DELETE /produtos/:identificador/seo/metaTag": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoId" | "ProdutoVarianteId"; - }; - body: { - /** - * Lista de identificadores de metatags (optional) - */ - metatags?: { - /** - * Identificador do MetaTag - */ - metatagId?: number; - }[]; - }; - }; - /** - * Frete encontrado - */ - "GET /fretes/:freteId": { - response: { - freteId?: number; - nome?: string; - ativo?: boolean; - volumeMaximo?: number; - pesoCubado?: number; - entregaAgendadaConfiguracaoId?: number; - linkRastreamento?: string; - ehAssinatura?: boolean; - larguraMaxima?: number; - alturaMaxima?: number; - comprimentoMaximo?: number; - limiteMaximoDimensoes?: number; - limitePesoCubado?: number; - tempoMinimoDespacho?: number; - centroDistribuicaoId?: number; - valorMinimoProdutos?: number; - }; - }; - /** - * Frete atualizado com sucesso - */ - "PUT /fretes/:freteId": { - body: { - /** - * Nome do contrato de frete (optional) - */ - nome?: string; - /** - * Status do contrato de frete (optional) - */ - ativo?: boolean; - /** - * Volume máximo permitido, em metro cúbico (m³). (optional) - */ - volumeMaximo?: number; - /** - * Informe o peso cubado. Altura x largura x profundidade x fator de cubagem. (optional) - */ - pesoCubado?: number; - /** - * Id da configuração entrega agendada (optional) - */ - entregaAgendadaConfiguracaoId?: number; - /** - * URL rastreamento (optional) - */ - linkRastreamento?: string; - /** - * Contrato é exclusivo assinatura (optional) - */ - ehAssinatura?: boolean; - /** - * Informe a largura máxima, em centímetros (cm). (optional) - */ - larguraMaxima?: number; - /** - * Informe a altura máxima, em centímetros (cm). (optional) - */ - alturaMaxima?: number; - /** - * Informe o comprimento máximo, em centímetros (cm). (optional) - */ - comprimentoMaximo?: number; - /** - * Informe a soma das três dimensões (Largura + Altura + Comprimento), em centímetros (cm). (optional) - */ - limiteMaximoDimensoes?: number; - /** - * Informe o limite de peso cubado, em gramas (g). (optional) - */ - limitePesoCubado?: number; - /** - * Informe quantos dias no mínimo esse contrato de frete leva para ser enviado ao cliente (optional) - */ - tempoMinimoDespacho?: number; - /** - * Informe o Id do centro de distribuição (optional) - */ - centroDistribuicaoId?: number; - /** - * Informe o valor mínimo em produtos necessário para disponibilidade da tabela de frete (optional) - */ - valorMinimoProdutos?: number; - }; - }; - /** - * Relatório de transações de um determinado período - */ - "GET /dashboard/transacoes": { - searchParams: { - /** - * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos pedidos que deverão retornar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Tipo de agrupamento dos pedidos (hora, dia, semana, mês, ano) - */ - tipoAgrupamento?: "Hora" | "Dia" | "Semana" | "Mes" | "Ano"; - }; - response: { - tipoAgrupamento?: string; - dados?: { - data?: string; - pedidosCaptados?: number; - pedidosPagos?: number; - pedidosEnviados?: number; - pedidosCancelados?: number; - }[]; - }; - }; - /** - * Lista de produtos de uma tabela de preços - */ - "GET /tabelaPrecos/:tabelaPrecoId/produtos": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - }; - response: { - tabelaPrecoProdutoVarianteId?: number; - tabelaPrecoId?: number; - sku?: string; - produtoVarianteId?: number; - precoDe?: number; - precoPor?: number; - }[]; - }; - /** - * Inseri uma lista de produto variantes em uma tabela de preços - */ - "POST /tabelaPrecos/:tabelaPrecoId/produtos": { - body: { - /** - * Lista de produtos variantes - */ - RAW_BODY: { - /** - * SKU do produto - */ - sku?: string; - /** - * Preço De do produto - */ - precoDe?: number; - /** - * Preço Por do produto - */ - precoPor?: number; - }[]; - }; - response: { - sucesso?: { - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - erro?: { - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - }; - }; - /** - * Lista com o retorno do processamento dos produtos enviados - */ - "PUT /tabelaPrecos/:tabelaPrecoId/produtos": { - body: { - /** - * Lista de produtos variantes - */ - RAW_BODY: { - /** - * SKU do produto - */ - sku?: string; - /** - * Preço De do produto - */ - precoDe?: number; - /** - * Preço Por do produto - */ - precoPor?: number; - }[]; - }; - response: { - sucesso?: { - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - erro?: { - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - }; - }; - /** - * Lista de scripts - */ - "GET /gestorscripts/scripts": { - response: { - scriptId?: number; - nome?: string; - posicao?: string; - tipoPagina?: string; - dataInicial?: string; - datafinal?: string; - ativo?: boolean; - prioridade?: number; - }[]; - }; - /** - * Insere um novo script - */ - "POST /gestorscripts/scripts": { - body: { - /** - * Nome do script - */ - nome?: string; - /** - * Data inicial do script - */ - dataInicial?: string; - /** - * Data final do script - */ - dataFinal?: string; - /** - * Informe se o script está ativo ou não - */ - ativo?: boolean; - /** - * Prioridade do script - */ - prioridade?: number; - /** - * Posição do script - */ - posicao?: - | "HeaderPrimeiraLinha" - | "HeaderUltimaLinha" - | "BodyPrimeiraLinha" - | "BodyUltimaLinha" - | "FooterPrimeiraLinha" - | "FooterUltimeLinha"; - /** - * Tipo da página do script - */ - tipoPagina?: - | "Todas" - | "Home" - | "Busca" - | "Categoria" - | "Fabricante" - | "Estaticas" - | "Produto" - | "Carrinho"; - /** - * Identificador da página - */ - identificadorPagina?: string; - /** - * Conteúdo do script - */ - conteudo?: string; - /** - * Status do script - */ - publicado?: boolean; - }; - }; - /** - * Assinaturas com erro na loja - */ - "GET /assinaturas/erros": { - searchParams: { - /** - * Data inicial para buscas por periodo de tempo (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final para buscas por periodo de tempo (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - /** - * Erros já resolvidos ou não - */ - resolvidos?: boolean; - }; - }; - /** - * Método que realiza uma cotação de frete - */ - "POST /fretes/cotacoes": { - searchParams: { - /** - * Cep de entrega - */ - cep?: string; - /** - * Define se o identificador informado é um sku ou um id interno da fstore - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - /** - * Define se deve retornar as opções de retirada em loja ("False" por padrão) (optional) - */ - retiradaLoja?: boolean; - }; - body: { - /** - * Valor total do pedido (optional) - */ - valorTotal?: number; - /** - * Lista de produtos da cotação - */ - produtos?: { - /** - * Id do produto variante - */ - identificador?: string; - /** - * Quantidade do produto - */ - quantidade?: number; - }[]; - }; - response: { - id?: string; - nome?: string; - prazo?: number; - tabelaFreteId?: string; - tipo?: string; - valor?: number; - produtos?: { - produtoVarianteId?: number; - valor?: number; - }[]; - }[]; - }; - /** - * Lista de Ranges de Ceps de uma Loja Física - */ - "GET /lojasFisicas/:lojaFisicaId/rangeCep": { - response: { - rangeCepId?: number; - nome?: string; - cepInicial?: string; - cepFinal?: string; - }[]; - }; - /** - * Insere um range de cep em uma Loja Física - */ - "POST /lojasFisicas/:lojaFisicaId/rangeCep": { - body: { - /** - * Nome do range de cep - */ - nome?: string; - /** - * Cep inicial do range. Formato: 00.000-000 - */ - cepInicial?: string; - /** - * Cep final do range. Formato: 00.000-000 - */ - cepFinal?: string; - }; - }; - /** - * Remove uma lista de range de cep de uma Loja Física - */ - "DELETE /lojasFisicas/:lojaFisicaId/rangeCep": { - body: { - /** - * Lista de range de cep a serem excluídos da loja física - */ - RAW_BODY: { - /** - * Id da faixa de cep a ser deletado - */ - rangeCepId?: number; - }[]; - }; - }; - /** - * Retorna usuário encontrado - */ - "GET /usuarios/:usuarioId/enderecos": { - response: { - enderecoId?: number; - nomeEndereco?: string; - rua?: string; - numero?: string; - complemento?: string; - referencia?: string; - bairro?: string; - cidade?: string; - estado?: string; - cep?: string; - utilizadoUltimoPedido?: boolean; - pais?: string; - }[]; - }; - /** - * Insere um endereço para um usuário pelo id do usuário - */ - "POST /usuarios/:usuarioId/enderecos": { - body: { - /** - * Nome de identificação do endereço a ser cadastrado (Max Length: 100) - */ - nomeEndereco?: string; - /** - * Nome da rua (Max Length: 500) - */ - rua?: string; - /** - * Número do local (Max Length: 50) - */ - numero?: string; - /** - * Complemento (Max Length: 250) (optional) - */ - complemento?: string; - /** - * Referência para a localização do endereço (Max Length: 500) (optional) - */ - referencia?: string; - /** - * Bairro do endereço (Max Length: 100) - */ - bairro?: string; - /** - * Cidade em que se localiza o endereço (Max Length: 100) - */ - cidade?: string; - /** - * O estado (Max Length: 100) - */ - estado?: string; - /** - * Código do cep (Max Length: 50) - */ - cep?: string; - }; - }; - /** - * Retorna uma lista de vínculos entre usuário e parceiro - */ - "GET /usuarios/:email/parceiros": {}; - /** - * Atualiza o preço de vários produtos com base na lista enviada. Limite de 50 produtos por requisição - */ - "PUT /produtos/precos": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Lista com os dados da atualização do preço (optional) - */ - RAW_BODY: { - /** - * Identificador do produto (ProdutoVarianteId ou SKU) - */ - identificador?: string; - /** - * Preço de custo do produto variante - */ - precoCusto?: number; - /** - * "PrecoDe" do produto variante - */ - precoDe?: number; - /** - * "PrecoPor" do produto variante - */ - precoPor?: number; - /** - * Fator multiplicador que gera o preço de exibição do produto. Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) - */ - fatorMultiplicadorPreco?: number; - }[]; - }; - response: { - produtosNaoAtualizados?: { - produtoVarianteId?: number; - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - produtosAtualizados?: { - produtoVarianteId?: number; - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - }; - }; - /** - * Usuário encontrado - */ - "GET /usuarios/email/:email": { - response: { - usuarioId?: number; - bloqueado?: boolean; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - avatar?: string; - ip?: string; - aprovado?: boolean; - }; - }; - /** - * Novo token gerado com sucesso - */ - "POST /autenticacao/trocarLoja/:novaLoja": { - response: { - lojas?: string[]; - accessToken?: string; - dataExpiracaoAccessTokenUTC?: string; - }; - }; - /** - * Campos de cadastro personalizado encontrados - */ - "GET /usuarios/camposcadastropersonalizado": { - response: { - grupoInformacaoCadastralId?: number; - nome?: string; - tipo?: string; - obrigatorio?: boolean; - ordem?: number; - valorPreDefinido?: { - valoresDefinidosCampoGrupoInformacaoId?: number; - valor?: string; - ordem?: number; - }[]; - }[]; - }; - /** - * Objeto do hotsite - */ - "GET /hotsites/:hotsiteId": { - response: { - hotsiteId?: number; - nome?: string; - ativo?: boolean; - template?: string; - dataCriacao?: string; - dataInicio?: string; - dataFinal?: string; - url?: string; - tamanhoPagina?: number; - templateId?: number; - ordenacao?: string; - listaProdutos?: { - expressao?: string; - produtos?: { - produtoId?: number; - ordem?: number; - }[]; - }; - seo?: { - seoHotsiteId?: number; - hotsiteId?: number; - titulo?: string; - metas?: { - conteudo?: string; - nome?: string; - httpEquiv?: string; - scheme?: string; - }[]; - }; - banners?: { - bannerId?: number; - }[]; - conteudos?: { - conteudoId?: number; - }[]; - }; - }; - /** - * Atualiza os dados de um hotsite existente - */ - "PUT /hotsites/:hotsiteId": { - body: { - /** - * Nome do hotsite - */ - nome?: string; - /** - * Data/hora em que o hotsite começará a ser exibido (optional) - */ - dataInicio?: string; - /** - * Data/Hora (último dia) em que o hotsite não será mais exibido (optional) - */ - dataFinal?: string; - /** - * Informe a url do hotsite. Por exemplo, se o site for 'busca.meusite.com.br', e o hotsite desejado for 'busca.meusite.com.br/hotsite/natal' informe neste campo somente a url 'hotsite/natal', sem a barra '/' no início - */ - url?: string; - /** - * Informe o número de produtos que deve ser exibido por página - */ - tamanhoPagina?: number; - /** - * Informe o identificador do template que será utilizado. Caso não saiba o identificador do template desejado, o mesmo pode ser buscado no endpoint GET/Templates - */ - templateId?: number; - /** - * Informe qual será a ordenação dos Produtos no Hotsite (optional) - */ - ordenacao?: - | "Nenhuma" - | "NomeCrescente" - | "NomeDecrescente" - | "Lancamento" - | "MenorPreco" - | "MaiorPreco" - | "MaisVendidos" - | "MaioresDescontos" - | "Aleatorio" - | "MenorEstoque" - | "MaiorEstoque"; - /** - * Produtos que devem aparecer no hotsite - */ - listaProdutos?: { - /** - * você pode utilizar essa opção para gerar um hotsite utilizando uma expressão de busca. Ao utilizá-la, os produtos adicionados nos outros modos de criação de hotsite serão ignorados (optional) - */ - expressao?: string; - /** - * Id dos produtos - */ - produtos?: { - /** - * Identificador do produto a ser mostrado no hotsite - */ - produtoId?: number; - /** - * Ordem para apresentação do produto (optional) - */ - ordem?: number; - }[]; - }; - /** - * Dados de seo - */ - seo?: { - /** - * Informe o Título que será exibido quando o Hotsite for acessado (optional) - */ - titulo?: string; - /** - * Não se esqueça! Além do texto livre, você pode utilizar as tags [Nome.Hotsite] e [Fbits.NomeLoja] para o cadastro das MetaTags e Title! (optional) - */ - metas?: { - /** - * Informe os dados da Metatag - */ - conteudo?: string; - /** - * Informe os dados da Metatag - */ - nome?: string; - /** - * Informe os dados da Metatag - */ - httpEquiv?: string; - /** - * Informe os dados da Metatag - */ - scheme?: string; - }[]; - }; - /** - * Lista de identificadores de banners a serem vinculados ao hotsite - */ - banners?: { - /** - * Identificador do banner (optional) - */ - bannerId?: number; - }[]; - /** - * Lista de identificadores de conteúdos a serem vinculados ao hotsite - */ - conteudos?: { - /** - * Identificador do conteúdo - */ - conteudoId?: number; - }[]; - /** - * Status do hotsite (optional) - */ - ativo?: boolean; - }; - }; - /** - * Deleta um hotsite que foi inserido manualmente, hotsites gerados automaticamente não podem ser deletados - */ - "DELETE /hotsites/:hotsiteId": {}; - /** - * Lista com assinaturas - */ - "GET /assinaturas": { - searchParams: { - /** - * Situação da assinatura - */ - situacaoAssinatura?: "Ativa" | "Pausada" | "Cancelada"; - /** - * Período de recorrência - */ - periodoRecorrencia?: string; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Data inicial da próxima recorrência - */ - dataInicialProximaRecorrencia?: string; - /** - * Data final da próxima recorrencia - */ - dataFinalProximaRecorrencia?: string; - /** - * Data inicial de cancelamento - */ - dataInicialCancelamento?: string; - /** - * Data final de cancelamento - */ - dataFinalCancelamento?: string; - }; - response: { - assinaturaId?: number; - usuarioId?: number; - dataProximoPedido?: string; - periodoRecorrencia?: string; - situacaoAssinatura?: string; - dataAssinatura?: string; - grupoAssinatura?: string; - enderecoId?: number; - usuarioCartaoCreditoId?: number; - cupom?: string; - }[]; - }; - /** - * Lista de categorias - */ - "GET /categorias": { - searchParams: { - /** - * Hierarquia da categoria - */ - hierarquia?: boolean; - /** - * Se será apresentado apenas Reseller - */ - apenasReseller?: boolean; - /** - * Se será apresentado apenas o último nível das categorias - */ - apenasUltimoNivel?: boolean; - /** - * Se será apresentado somente categorias filhas - */ - somenteFilhos?: boolean; - }; - response: { - id?: number; - nome?: string; - categoriaPaiId?: number; - categoriaERPId?: string; - ativo?: boolean; - isReseller?: boolean; - exibirMatrizAtributos?: string; - quantidadeMaximaCompraUnidade?: number; - valorMinimoCompra?: number; - exibeMenu?: boolean; - urlHotSite?: string; - }[]; - }; - /** - * Insere uma nova categoria - */ - "POST /categorias": { - body: { - /** - * Nome da categoria (optional) - */ - nome?: string; - /** - * Id da categoria pai (optional) - */ - categoriaPaiId?: number; - /** - * Id da categoria ERP (optional) - */ - categoriaERPId?: string; - /** - * Categoria ativo/inativo (optional) - */ - ativo?: boolean; - /** - * Categoria de reseller (optional) - */ - isReseller?: boolean; - /** - * Exibir Matriz de Atributos (optional) - */ - exibirMatrizAtributos?: "Sim" | "Nao" | "Neutro"; - /** - * Informe a quantidade máxima permitida para compra por produtos desta categoria. Informe zero para assumir a configuração geral da loja (optional) - */ - quantidadeMaximaCompraUnidade?: number; - /** - * Informe o valor mínimo para compra em produtos desta categoria (optional) - */ - valorMinimoCompra?: number; - /** - * Informe se será exibida no menu (optional) - */ - exibeMenu?: boolean; - }; - }; - /** - * Lista de fabricantes - */ - "GET /fabricantes": { - response: { - fabricanteId?: number; - ativo?: boolean; - nome?: string; - urlLogoTipo?: string; - urlLink?: string; - urlCarrossel?: string; - }[]; - }; - /** - * Insere um novo fabricante - */ - "POST /fabricantes": { - body: { - /** - * Nome do fabricante (optional) - */ - nome?: string; - /** - * URL tipo logo (optional) - */ - urlLogoTipo?: string; - /** - * Insira neste campo uma URL para redirecionamento. A URL deve ser inserida por completa (optional) - */ - urlLink?: string; - /** - * Insira nesse campo a URL do Carrossel da Marca (optional) - */ - urlCarrossel?: string; - }; - }; - /** - * Atualiza o campo Recebido de um produto vinculado a um evento - */ - "PUT /eventos/:eventoId/produtos/recebido": { - body: { - /** - * Id do produto variante (optional) - */ - produtoVarianteId?: number; - /** - * Se o produto foi recebido fora da lista (optional) - */ - recebidoForaLista?: boolean; - }; - }; - /** - * Tipo evento buscado - */ - "GET /tiposEvento/:tipoEventoId": { - response: { - tipoEventoId?: number; - nome?: string; - tipoEntrega?: string; - tipoDisponibilizacao?: string; - permitirRemocaoAutomaticaProdutos?: boolean; - corHexTituloInformacoes?: string; - corHexCorpoInformacoes?: string; - numeroAbasInformacoes?: number; - quantidadeDiasParaEventoExpirar?: number; - numeroLocaisEvento?: number; - ativo?: boolean; - disponivel?: boolean; - tipoBeneficiarioFrete?: string; - caminhoLogoEvento?: string; - caminhoSubTemplate?: string; - sugestaoProdutos?: { - tipoEventoId?: number; - produtoVarianteId?: number; - }[]; - }; - }; - /** - * Atualiza o tipo evento - */ - "PUT /tiposEvento/:tipoEventoId": { - body: { - /** - * Nome do Tipo de Evento - */ - nome?: string; - /** - * Tipo de entrega - */ - tipoEntrega?: - | "EntregaAgendada" - | "EntregaConformeCompraRealizada" - | "Todos" - | "Nenhum"; - /** - * Disponibilização do Tipo de Evento - */ - tipoDisponibilizacao?: - | "DisponibilizacaoDeCreditos" - | "DisponibilizacaoDeProdutos" - | "Todos"; - /** - * Permissão para remoção automática de produtos - */ - permitirRemocaoAutomaticaProdutos?: boolean; - /** - * Cor em hexadecimal para o titulo de informações - */ - corHexTituloInformacoes?: string; - /** - * Cor em hexadecimal para o corpo de informações - */ - corHexCorpoInformacoes?: string; - /** - * Número de abas de informações, podendo ser de 1 a 2 - */ - numeroAbasInformacoes?: number; - /** - * Quantidade de dias para que o evento expire - */ - quantidadeDiasParaEventoExpirar?: number; - /** - * Quantidade de locais do evento - */ - numeroLocaisEvento?: number; - /** - * Informa se o evento está ativo ou inativo - */ - ativo?: boolean; - /** - * Informa a disponibilidade do evento - */ - disponivel?: boolean; - /** - * O beneficiário do frete - */ - tipoBeneficiarioFrete?: "DonodaLista" | "Convidado"; - /** - * Imagem da logo do evento em base64 - */ - imagemLogoEvento?: string; - /** - * Produtos Sugeridos para este evento (optional) - */ - sugestaoProdutos?: { - /** - * Id do tipo de evento - */ - tipoEventoId?: number; - /** - * Identificador do produto variante - */ - produtoVarianteId?: number; - }[]; - }; - }; - /** - * Produtos de uma assinatura - */ - "GET /assinaturas/:email": { - response: { - assinaturaId?: number; - usuarioId?: number; - dataProximoPedido?: string; - periodoRecorrencia?: string; - situacaoAssinatura?: string; - dataAssinatura?: string; - grupoAssinatura?: string; - enderecoId?: number; - usuarioCartaoCreditoId?: number; - cupom?: string; - produtos?: { - assinaturaProdutoId?: number; - assinaturaId?: number; - produtoId?: number; - produtoVarianteId?: number; - quantidade?: number; - valor?: number; - removido?: boolean; - }[]; - }[]; - }; - /** - * Lista de produtos variantes vinculados aos tipo de evento - */ - "GET /eventos/:eventoId": { - response: { - eventoId?: number; - tipoEventoId?: number; - userId?: number; - enderecoEntregaId?: number; - data?: string; - dataCriacao?: string; - titulo?: string; - url?: string; - disponivel?: boolean; - diasDepoisEvento?: number; - diasAntesEvento?: number; - urlLogoEvento?: string; - urlCapaEvento?: string; - proprietarioEvento?: string; - abaInfo01Habilitado?: boolean; - textoInfo01?: string; - conteudoInfo01?: string; - abaInfo02Habilitado?: boolean; - textoInfo02?: string; - conteudoInfo02?: string; - abaMensagemHabilitado?: boolean; - fotos?: string; - enumTipoListaPresenteId?: string; - enumTipoEntregaId?: string; - eventoProdutoSelecionado?: { - eventoId?: number; - produtoVarianteId?: number; - recebidoForaLista?: boolean; - removido?: boolean; - }[]; - enderecoEvento?: { - enderecoEventoId?: number; - eventoId?: number; - nome?: string; - cep?: string; - endereco?: string; - numero?: string; - bairro?: string; - cidade?: string; - estado?: string; - }[]; - }[]; - }; - /** - * Atualiza um evento - */ - "PUT /eventos/:eventoId": { - body: { - /** - * Identificador do tipo de evento - */ - tipoEventoId?: number; - /** - * Identificador do endereço de entrega - */ - enderecoEntregaId?: number; - /** - * Titulo do evento - */ - titulo?: string; - /** - * Atributo obsoleto - (optional) - */ - url?: string; - /** - * Data do Evento - */ - data?: string; - /** - * Email do usuário - */ - usuarioEmail?: string; - /** - * Disponibilidade do evento (optional) - */ - disponivel?: boolean; - /** - * Quantos dias antes do evento ele será exibido (optional) - */ - diasAntesEvento?: number; - /** - * Até quantos dias depois do evento ele será exibido (optional) - */ - diasDepoisEvento?: number; - /** - * Url do Logo. (Base64) - */ - urlLogo?: string; - /** - * Url da Capa. (Base64) - */ - urlCapa?: string; - /** - * Quem é o proprietário - */ - proprietario?: string; - /** - * Se a aba de informação 01 será habilitada - */ - abaInfo01Habilitado?: boolean; - /** - * Texto para o campo informação 01 (optional) - */ - textoInfo01?: string; - /** - * Conteúdo para o campo informação 01 (optional) - */ - conteudoInfo01?: string; - /** - * Se a aba de informação 02 será habilitada - */ - abaInfo02Habilitado?: boolean; - /** - * Texto para o campo informação 02 (optional) - */ - textoInfo02?: string; - /** - * Conteúdo para o campo informação 02 (optional) - */ - conteudoInfo02?: string; - /** - * Se a aba de mensagem será habilitada (optional) - */ - abaMensagemHabilitado?: boolean; - /** - * Tipo de lista de presente - */ - enumTipoListaPresenteId?: "ListaPronta" | "ListaManual"; - /** - * Tipo de entrega - */ - enumTipoEntregaId?: - | "EntregaAgendada" - | "EntregaConformeCompraRealizada" - | "Todos" - | "Nenhum"; - /** - * Seleção de produto no evento - */ - eventoProdutoSelecionado?: { - /** - * Id do produto variante - */ - produtoVarianteId?: number; - /** - * Se produto recebido fora da lista (optional) - */ - recebidoForaLista?: boolean; - /** - * Se produto removido (optional) - */ - removido?: boolean; - }[]; - /** - * Endereço do Evento - */ - enderecoEvento?: { - /** - * Nome para identificação do endereço - */ - nome?: string; - /** - * Endereço - */ - endereco?: string; - /** - * Cep do endereço - */ - cep?: string; - /** - * Numero do endereço - */ - numero?: string; - /** - * Bairro do endereço - */ - bairro?: string; - /** - * Cidade do endereço - */ - cidade?: string; - /** - * Estado do endereço - */ - estado?: string; - }[]; - }; - }; - /** - * Lista de identificadores de banners vinculados ao hotsite - */ - "GET /hotsites/:hotsiteId/banners": { - response: { - bannerId?: number; - }[]; - }; - /** - * Vincula um ou mais banners a um hotsite específico - */ - "POST /hotsites/:hotsiteId/banners": { - body: { - /** - * Lista de identificadores de banners para vincular ao hotsite - */ - banners?: { - /** - * Identificador do banner (optional) - */ - bannerId?: number; - }[]; - }; - }; - /** - * Desvincula um ou mais banners de um hotsite específico - */ - "DELETE /hotsites/:hotsiteId/banners": { - body: { - /** - * Lista de identificadores de banners a serem desvinculados - */ - banners?: { - /** - * Identificador do banner (optional) - */ - bannerId?: number; - }[]; - }; - }; - /** - * Estorna um valor menor ou igual ao total do pedido "Pago" - */ - "POST /pedidos/estorno/:pedidoId": { - body: { - /** - * Valor a ser estornado do pedido. Total ou parcial. - */ - Valor?: number; - }; - }; - /** - * Pedidos que terão vínculo com o grupo de assinatura informado. - */ - "POST /assinaturas/grupoassinatura/assinatura": { - body: { - /** - * Lista de pedidos a serem vinculados a assinatura - */ - pedidos?: { - /** - * Id do pedido - */ - pedidoId?: number; - }[]; - /** - * ID da recorrência vinculada ao grupo, disponível em GET /assinaturas/grupoassinatura - */ - recorrenciaId?: number; - /** - * ID do grupo de assinatura, disponível em GET /assinaturas/grupoassinatura - */ - grupoAssinaturaId?: number; - }; - }; - /** - * Lista de situações de pedido - */ - "GET /situacoesPedido": { - response: { - situacaoPedidoId?: number; - nome?: string; - descricao?: string; - observacao?: string; - }[]; - }; - /** - * Lista de Lojas Físicas - */ - "GET /lojasFisicas": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - }; - response: { - lojaId?: number; - nome?: string; - ddd?: number; - telefone?: string; - email?: string; - cep?: string; - logradouro?: string; - numero?: string; - complemento?: string; - bairro?: string; - cidade?: string; - estadoId?: number; - prazoEntrega?: number; - prazoMaximoRetirada?: number; - ativo?: boolean; - valido?: boolean; - textoComplementar?: string; - retirarNaLoja?: boolean; - latitude?: number; - longitude?: number; - centroDistribuicaoId?: number; - centroDistribuicao?: { - centroDistribuicaoId?: number; - prazoEntrega?: number; - }[]; - }[]; - }; - /** - * Insere uma Loja Física - */ - "POST /lojasFisicas": { - body: { - /** - * Id da loja (optional) - */ - lojaId?: number; - /** - * Nome da loja (optional) - */ - nome?: string; - /** - * DDD da localidade de destino da loja (optional) - */ - ddd?: number; - /** - * Telefone da loja (optional) - */ - telefone?: string; - /** - * E-mail de contato da loja (optional) - */ - email?: string; - /** - * CEP do endereço da loja (optional) - */ - cep?: string; - /** - * Logradouro do endereço da loja (optional) - */ - logradouro?: string; - /** - * Número de localização do endereço da loja (optional) - */ - numero?: string; - /** - * Complemento para localização da loja (optional) - */ - complemento?: string; - /** - * Bairro do endereço do loja (optional) - */ - bairro?: string; - /** - * Cidade em que a loja se encontra (optional) - */ - cidade?: string; - /** - * Id do estado em que a loja se encontra (optional) - */ - estadoId?: number; - /** - * Prazo de entrega (optional) - */ - prazoEntrega?: number; - /** - * Prazo máximo para retirada (optional) - */ - prazoMaximoRetirada?: number; - /** - * Status da loja (optional) - */ - ativo?: boolean; - /** - * Valido (optional) - */ - valido?: boolean; - /** - * Informações complementares da loja (optional) - */ - textoComplementar?: string; - /** - * Se a retirada na loja será ativada (optional) - */ - retirarNaLoja?: boolean; - /** - * Latitude (optional) - */ - latitude?: number; - /** - * Longitude (optional) - */ - longitude?: number; - /** - * Lista com os Identificadores dos centros de distribuição que serão vinculados a loja física (optional) - */ - centroDistribuicao?: { - /** - * Id do centro de distribuição - */ - centroDistribuicaoId?: number; - /** - * Prazo de entrega - */ - prazoEntrega?: number; - }[]; - }; - }; - /** - * Atualiza um usuário pelo email - */ - "PUT /usuarios/:email": { - body: { - /** - * Tipo de pessoa - */ - tipoPessoa?: "Fisica" | "Juridica"; - /** - * Origem do contato - */ - origemContato?: - | "Google" - | "Bing" - | "Jornal" - | "PatrocinioEsportivo" - | "RecomendacaoAlguem" - | "Revista" - | "SiteInternet" - | "Televisao" - | "Outro" - | "UsuarioImportadoViaAdmin" - | "PayPalExpress"; - /** - * Tipo Sexo (optional) - */ - tipoSexo?: "Undefined" | "Masculino" | "Feminino"; - /** - * Nome do usuário (Max Length: 100) - */ - nome?: string; - /** - * CPF do usuário caso seja pessoa física (Max Length: 50) (optional) - */ - cpf?: string; - /** - * E-mail do usuário (Max Length: 100) - */ - email?: string; - /** - * RG do usuário caso seja pessoa física (Max Length: 50) (optional) - */ - rg?: string; - /** - * Telefone residencial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) - */ - telefoneResidencial?: string; - /** - * Telefone celular do usuário. Deve ser informado o DDD junto ao número (Max Length: 50) (optional) - */ - telefoneCelular?: string; - /** - * Telefone comercial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) (optional) - */ - telefoneComercial?: string; - /** - * Data de nascimento (optional) - */ - dataNascimento?: string; - /** - * Razão social do usuário, caso seja uma pessoa jurídica(Max Length: 100) (optional) - */ - razaoSocial?: string; - /** - * CNPJ do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) - */ - cnpj?: string; - /** - * Inscrição estadual do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) - */ - inscricaoEstadual?: string; - /** - * Responsável(Max Length: 100) (optional) - */ - responsavel?: string; - /** - * Data de criação do cadastro (optional) - */ - dataCriacao?: string; - /** - * Data de atualização do cadastro (optional) - */ - dataAtualizacao?: string; - /** - * Se o usuário é revendedor (optional) - */ - revendedor?: boolean; - /** - * Informação cadastral (optional) - */ - listaInformacaoCadastral?: { - /** - * Chave - */ - chave?: string; - /** - * Valor - */ - valor?: string; - }[]; - /** - * Avatar (Max Length: 50) (optional) - */ - avatar?: string; - /** - * IP do usuário (Max Length: 20) (optional) - */ - ip?: string; - /** - * Seta ou retorna o valor de Aprovado (optional) - */ - aprovado?: boolean; - }; - }; - /** - * Insere um novo campo de cadastro personalizado - */ - "POST /usuarios/CadastroPersonalizado": { - body: { - /** - * Nome do campo - */ - nome?: string; - /** - * Tipo do campo - */ - tipo?: "TextoLivre" | "ValoresPredefinidos" | "RadioButton"; - /** - * Se o campo será obrigatório - */ - obrigatorio?: boolean; - /** - * Ordem - */ - ordem?: number; - /** - * Informação para os campos (optional) - */ - valorPreDefinido?: { - /** - * Valor - */ - valor?: string; - /** - * Ordem - */ - ordem?: number; - }[]; - }; - }; - /** - * Seta identificador como variante principal - */ - "PUT /produtos/:identificador/principal": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - }; - /** - * Lista de inscrições - */ - "GET /webhook/inscricao": { - response: { - inscricaoId?: number; - nome?: string; - appUrl?: string; - ativo?: boolean; - emailResponsavel?: string; - topico?: string[]; - usuario?: string; - header?: { - headerId?: number; - chave?: string; - valor?: string; - }[]; - }[]; - }; - /** - * Insere uma inscrição - */ - "POST /webhook/inscricao": { - body: { - /** - * Nome da inscrição - */ - nome?: string; - /** - * Url para qual deve ser enviada as notificações - */ - appUrl?: string; - /** - * Tópicos em que deseja se inscrever - */ - topicos: string[]; - /** - * Usuário que está realizando a inscrição - */ - usuario?: string; - /** - * Status da inscrição, se ativada ou desativada - */ - ativo?: boolean; - /** - * E-mail do responsável para notificá-lo quando não seja possível notificá-lo pelo AppUrl informado - */ - emailResponsavel?: string; - /** - * Headers que devam ser adicionados ao realizar a requisição para o AppUrl. Headers de Conteúdo como 'ContentType' não são necessário. As requisições realizada sempre serão no formato 'application/json' (optional) - */ - headers?: { - /** - * Chave do header, por exemplo: 'Authorization' - */ - chave?: string; - /** - * Valor / Conteúdo do header, por exemplo: 'Basic 0G3EQWD-W324F-234SD-2421OFSD' - */ - valor?: string; - }[]; - }; - }; - /** - * Lista de produtos de um Grupo de Personalização - */ - "GET /grupospersonalizacao/:grupoPersonalizacaoId/produtos": { - response: { - produtoId?: number; - nome?: string; - alias?: string; - }[]; - }; - /** - * Vincula produtos a um Grupo de Personalização - */ - "POST /grupospersonalizacao/:grupoPersonalizacaoId/produtos": { - body: { - /** - * Lista de Id dos produtos - */ - RAW_BODY: { - /** - * Id do produto - */ - produtoId?: number; - }[]; - }; - }; - /** - * Remove o vinculo de produtos de um Grupo de Personalização - */ - "DELETE /grupospersonalizacao/:grupoPersonalizacaoId/produtos": { - body: { - /** - * Lista de Id dos produtos - */ - RAW_BODY: { - /** - * Id do produto - */ - produtoId?: number; - }[]; - }; - }; - /** - * Gráfico do Faturamento - */ - "GET /dashboard/graficofaturamento": { - searchParams: { - /** - * Data inicial do faturamento que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final do faturamento que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Se o faturamento é somente da loja - */ - isLoja?: number; - /** - * Id do parceiro - */ - parceiroId?: number; - }; - response: { - parceiroId?: number; - parceiro?: string; - receitaPagos?: number; - transacoesPagos?: number; - valorMedioPagos?: number; - usuarioEnderecoEstado?: string; - }[]; - }; - /** - * Atualiza uma informação de um produto específico - */ - "PUT /produtos/:identificador/informacoes/:informacaoId": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Titulo da informação (optional) - */ - titulo?: string; - /** - * Texto da informação (optional) - */ - texto?: string; - /** - * Informação se o produto variante está visível no site. - */ - exibirSite?: boolean; - /** - * Tipo de informação do produto (optional) - */ - tipoInformacao?: - | "Informacoes" - | "Beneficios" - | "Especificacoes" - | "DadosTecnicos" - | "Composicao" - | "ModoDeUsar" - | "Cuidados" - | "ItensInclusos" - | "Dicas" - | "Video" - | "Descricao" - | "ValorReferente" - | "PopUpReferente" - | "Prescricao" - | "TabelaDeMedidas" - | "Spot" - | "Sinopse" - | "Carrinho"; - }; - }; - /** - * Exclui uma informação de um produto - */ - "DELETE /produtos/:identificador/informacoes/:informacaoId": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - response: { - informacaoId?: number; - titulo?: string; - texto?: string; - tipoInformacao?: string; - }[]; - }; - /** - * Assinatura de um determinado pedido - */ - "GET /assinaturas/pedido/:pedidoId": { - response: { - assinaturaPedidoId?: number; - assinaturaId?: number; - grupoAssinaturaId?: number; - tipoPeriodo?: string; - tempoPeriodo?: number; - pedidoId?: number; - valor?: number; - data?: string; - origemPedidoEnumId?: number; - produtoVarianteId?: number; - }[]; - }; - /** - * Atualiza rastreamento parcial (Rastreamento e UrlRastreamento) - */ - "PUT /pedidos/:pedidoId/rastreamento/:pedidoRastreamentoId/parcial": { - body: { - /** - * Objeto Pedido Rastreamento - */ - RAW_BODY: { - /** - * Rastreamento (optional) - */ - rastreamento?: string; - /** - * URL de Rastreamento (optional) - */ - urlRastreamento?: string; - }; - }; - }; - /** - * Access token atualizado com sucesso - */ - "POST /autenticacao/refresh": { - response: { - lojas?: string[]; - accessToken?: string; - dataExpiracaoAccessTokenUTC?: string; - }; - }; - /** - * Ativa ou inativa uma inscrição - */ - "PUT /webhook/inscricao/:inscricaoId/Ativar": { - body: { - /** - * Status que deseja atualizar a inscrição. True (Ativada) ou False (desativada) - */ - ativo?: boolean; - /** - * Usuário que está realizando a atualização - */ - usuario?: string; - /** - * Observação que deseje fazer com relação a ativação/desativação da inscrição (optional) - */ - observacao?: string; - }; - }; - /** - * Assinatura com erro na loja - */ - "GET /assinaturas/erros/:assinaturaId": { - response: { - assinaturaErroId?: number; - assinaturaId?: number; - usuarioId?: string; - visualizado?: boolean; - dataErro?: string; - resolvido?: boolean; - codigoAssinaturaErro?: number; - assinaturaErroNome?: string; - assinaturaErroDescricao?: string; - }[]; - }; - /** - * Limite de crédito de um usuário específico - */ - "GET /usuarios/limiteCreditoPorEmail/:email": { - response: { - usuarioId?: number; - valor?: number; - saldo?: number; - }; - }; - /** - * Retorna o histórico de situações de um pedido - */ - "GET /pedidos/:pedidoId/historicoSituacao": { - response: { - situacoes?: { - situacaoPedidoId?: number; - nome?: string; - dataAtualizacao?: string; - }[]; - }; - }; - /** - * Atualiza o limite de crédito para um usuário - */ - "PUT /usuarios/limiteCredito/:usuarioId": { - searchParams: { - /** - * CPF ou CNPJ do usuário - */ - cpf_cnpj?: string; - /** - * Valor do limite de crédito - */ - valor?: number; - }; - }; - /** - * Retorna a lista de produtos de um portfolio - */ - "GET /portfolios/:portfolioId/produtos": { - response: { - produtoId?: number; - }[]; - }; - /** - * Vinculo de produtos ao portfolio - */ - "PUT /portfolios/:portfolioId/produtos": { - body: { - /** - * Lista dos Id's dos produtos - */ - RAW_BODY: { - /** - * Id do produto - */ - produtoId?: number; - }[]; - }; - }; - /** - * Insere um rastreamento e status a um produto variante - */ - "POST /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento": { - body: { - /** - * Id da situação do pedido - */ - situacaoPedidoId?: number; - /** - * Quantidade (optional) - */ - quantidade?: number; - /** - * Id do centro de distribuição - */ - centroDistribuicaoId?: number; - /** - * Rastreamento (optional) - */ - rastreamento?: string; - /** - * Data (optional) - */ - dataEvento?: string; - /** - * Número da nota fiscal (optional) - */ - numeroNotaFiscal?: string; - /** - * Chave de acesso NFE (optional) - */ - chaveAcessoNFE?: string; - /** - * URL NFE (optional) - */ - urlNFE?: string; - /** - * Serie NFE (optional) - */ - serieNFE?: string; - /** - * CFOP (optional) - */ - cfop?: number; - /** - * URL de rastreamento (optional) - */ - urlRastreamento?: string; - }; - }; - /** - * Usuários encontrados - */ - "GET /parceiros/:parceiroId/usuarios": { - response: { - usuarioId?: number; - email?: string; - ativo?: boolean; - dataInicial?: string; - dataFinal?: string; - vinculoVitalicio?: boolean; - }[]; - }; - /** - * Dados de transação do pedido - */ - "GET /pedidos/transacoes/:transacaoId": {}; - /** - * Operação realizada com ou sem sucesso para os usuários - */ - "PUT /usuarios/autorizar": { - searchParams: { - /** - * Tipo de Identificador - */ - tipoIdentificador?: "UsuarioId" | "Email"; - }; - body: { - /** - * Usuários - */ - RAW_BODY?: { - /** - * Identificador - */ - identificador?: string; - /** - * Status de aprovação - */ - aprovado?: boolean; - }[]; - }; - response: { - usuariosAtualizados?: string[]; - usuariosNaoAtualizados?: string[]; - }; - }; - /** - * Atualiza a data de cadastro um produto com base nos dados enviados - */ - "PUT /produtos/:identificador/DataCadastro": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Data de cadastro de um produto - Formato: aaaa-mm-dd hh:mm:ss - */ - dataCadastro?: string; - }; - response: { - produtoVarianteId?: number; - produtoId?: number; - idPaiExterno?: string; - idVinculoExterno?: string; - sku?: string; - nome?: string; - nomeProdutoPai?: string; - urlProduto?: string; - exibirMatrizAtributos?: string; - contraProposta?: boolean; - fabricante?: string; - autor?: string; - editora?: string; - colecao?: string; - genero?: string; - precoCusto?: number; - precoDe?: number; - precoPor?: number; - fatorMultiplicadorPreco?: number; - prazoEntrega?: number; - valido?: boolean; - exibirSite?: boolean; - freteGratis?: string; - trocaGratis?: boolean; - peso?: number; - altura?: number; - comprimento?: number; - largura?: number; - garantia?: number; - isTelevendas?: boolean; - ean?: string; - localizacaoEstoque?: string; - listaAtacado?: { - precoPor?: number; - quantidade?: number; - }[]; - estoque?: { - estoqueFisico?: number; - estoqueReservado?: number; - centroDistribuicaoId?: number; - alertaEstoque?: number; - }[]; - atributos?: { - tipoAtributo?: string; - isFiltro?: boolean; - nome?: string; - valor?: string; - exibir?: boolean; - }[]; - quantidadeMaximaCompraUnidade?: number; - quantidadeMinimaCompraUnidade?: number; - condicao?: string; - informacoes?: { - informacaoId?: number; - titulo?: string; - texto?: string; - tipoInformacao?: string; - }[]; - tabelasPreco?: { - tabelaPrecoId?: number; - nome?: string; - precoDe?: number; - precoPor?: number; - }[]; - dataCriacao?: string; - dataAtualizacao?: string; - urlVideo?: string; - spot?: boolean; - paginaProduto?: boolean; - marketplace?: boolean; - somenteParceiros?: boolean; - reseller?: { - resellerId?: number; - razaoSocial?: string; - centroDistribuicaoId?: number; - ativo?: boolean; - ativacaoAutomaticaProdutos?: boolean; - autonomia?: boolean; - buyBox?: boolean; - nomeMarketPlace?: string; - }; - buyBox?: boolean; - }; - }; - /** - * Atualiza a situação do status de um produto do pedido - */ - "PUT /pedidos/:pedidoId/:produtoVarianteId/status": { - body: { - /** - * Dados da situação do produto (optional) - */ - RAW_BODY: { - /** - * Id do centro de distribuição do produto - */ - centroDistribuicaoId?: number; - /** - * Quantidade de produtos do centro de distribuição - */ - quantidade?: number; - /** - * Novo status da situação do produto (são os mesmo status do pedido) - */ - situacaoPedidoProdutoId?: number; - }; - }; - }; - /** - * Indicadores dos Produtos no Estoque - */ - "GET /dashboard/produtoestoque": { - searchParams: { - /** - * Data inicial dos produtos no estoque que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos produtos no estoque que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - }; - response: { - indicadorProdutoComEstoque?: string; - indicadorProdutoSemEstoque?: string; - }; - }; - /** - * Atualiza um endereço de um usuário pelo e-mail do usuário - */ - "PUT /usuarios/:email/enderecos/:enderecoId": { - body: { - /** - * Nome de identificação do endereço a ser cadastrado (Max Length: 100) - */ - nomeEndereco?: string; - /** - * Nome da rua (Max Length: 500) - */ - rua?: string; - /** - * Número do local (Max Length: 50) - */ - numero?: string; - /** - * Complemento (Max Length: 250) (optional) - */ - complemento?: string; - /** - * Referência para a localização do endereço (Max Length: 500) (optional) - */ - referencia?: string; - /** - * Bairro do endereço (Max Length: 100) - */ - bairro?: string; - /** - * Cidade em que se localiza o endereço (Max Length: 100) - */ - cidade?: string; - /** - * O estado (Max Length: 100) - */ - estado?: string; - /** - * Código do cep (Max Length: 50) - */ - cep?: string; - }; - }; - /** - * Atualiza o status de uma avaliação de um produto variante - */ - "PUT /produtoavaliacao/:produtoAvaliacaoId/status": { - body: { - /** - * Status para a avaliação - */ - status?: "Pendente" | "NaoAprovado" | "Aprovado"; - }; - }; - /** - * Fabricante encontrado - */ - "GET /fabricantes/:nome": { - response: { - fabricanteId?: number; - ativo?: boolean; - nome?: string; - urlLogoTipo?: string; - urlLink?: string; - urlCarrossel?: string; - }; - }; - /** - * Lista de parceiros vinculados ao banner - */ - "GET /banners/:bannerId/parceiros": {}; - /** - * Vincula parceiros com um banner específico - */ - "POST /banners/:bannerId/parceiros": { - body: { - /** - * Lista de Id dos parceiros - */ - RAW_BODY: { - /** - * Id do parceiro (optional) - */ - parceiroId?: number; - }[]; - }; - }; - /** - * Deleta o vinculo de um ou mais parceiros com um banner específico - */ - "DELETE /banners/:bannerId/parceiros": { - body: { - /** - * Lista de identificadores de parceiros para desvincular do banner - */ - listaParceiros?: { - /** - * Id do parceiro (optional) - */ - parceiroId?: number; - }[]; - }; - }; - /** - * Lista de tabelas de preços - */ - "GET /tabelaPrecos": { - response: { - tabelaPrecoId?: number; - nome?: string; - dataInicial?: string; - dataFinal?: string; - ativo?: boolean; - isSite?: boolean; - }[]; - }; - /** - * Insere uma nova tabela de preços - */ - "POST /tabelaPrecos": { - body: { - /** - * Nome da tabela de preço - */ - nome?: string; - /** - * Data que inicia a tabela de preço - */ - dataInicial?: string; - /** - * Data de término da tabela de preço - */ - dataFinal?: string; - /** - * Status da tabela de preço - */ - ativo?: boolean; - }; - }; - /** - * Atualiza a imagem do banner - */ - "PUT /banners/:bannerId/Imagem": { - body: { - /** - * URL da Imagem (optional) - */ - urlImagem?: string; - /** - * Informações para atualizar a imagem (optional) - */ - Imagem?: { - /** - * string da imagem em base 64 - */ - base64?: string; - /** - * formato da imagem - */ - formato?: "PNG" | "JPG" | "JPEG"; - /** - * nome da imagem - */ - nome?: string; - }; - }; - }; - /** - * Exclui o vínculo entre uma categoria e um produto - */ - "DELETE /produtos/:identificador/categorias/:id": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - }; - /** - * Xml com os dados de uma mídia específicas entre duas datas - */ - "GET /midias/:identificador": { - searchParams: { - /** - * Data inicial (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final (aaaa-mm-dd) - */ - dataFinal?: string; - }; - response: { - dias?: { - diaMidiaApiModel?: { - dia?: string; - investimento?: { - meta?: number; - realizado?: number; - }; - pedidos?: { - meta?: number; - realizado?: number; - }; - roi?: { - meta?: number; - realizado?: number; - }; - receita?: { - meta?: number; - realizado?: number; - }; - visitas?: { - meta?: number; - realizado?: number; - }; - }[]; - }; - id?: number; - nome?: string; - tipo?: string; - }; - }; - /** - * Lista de hotsites - */ - "GET /hotsites": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadePorPagina?: number; - }; - response: { - hotsiteId?: number; - nome?: string; - ativo?: boolean; - template?: string; - dataCriacao?: string; - dataInicio?: string; - dataFinal?: string; - url?: string; - tamanhoPagina?: number; - templateId?: number; - ordenacao?: string; - listaProdutos?: { - expressao?: string; - produtos?: { - produtoId?: number; - ordem?: number; - }[]; - }; - seo?: { - seoHotsiteId?: number; - hotsiteId?: number; - titulo?: string; - metas?: { - conteudo?: string; - nome?: string; - httpEquiv?: string; - scheme?: string; - }[]; - }; - banners?: { - bannerId?: number; - }[]; - conteudos?: { - conteudoId?: number; - }[]; - }[]; - }; - /** - * A lista de produtos para serem exibidos no hotsite está limitada a 1024 itens, tanto por expressão como por produtos. - */ - "POST /hotsites": { - body: { - /** - * Nome do hotsite - */ - nome?: string; - /** - * Data/hora em que o hotsite começará a ser exibido (optional) - */ - dataInicio?: string; - /** - * Data/Hora (último dia) em que o hotsite não será mais exibido (optional) - */ - dataFinal?: string; - /** - * Informe a url do hotsite. Por exemplo, se o site for 'busca.meusite.com.br', e o hotsite desejado for 'busca.meusite.com.br/hotsite/natal' informe neste campo somente a url 'hotsite/natal', sem a barra '/' no início - */ - url?: string; - /** - * Informe o número de produtos que deve ser exibido por página - */ - tamanhoPagina?: number; - /** - * Informe o identificador do template que será utilizado. Caso não saiba o identificador do template desejado, o mesmo pode ser buscado no endpoint GET/Templates - */ - templateId?: number; - /** - * Informe qual será a ordenação dos Produtos no Hotsite (optional) - */ - ordenacao?: - | "Nenhuma" - | "NomeCrescente" - | "NomeDecrescente" - | "Lancamento" - | "MenorPreco" - | "MaiorPreco" - | "MaisVendidos" - | "MaioresDescontos" - | "Aleatorio" - | "MenorEstoque" - | "MaiorEstoque"; - /** - * Produtos que devem aparecer no hotsite - */ - listaProdutos?: { - /** - * você pode utilizar essa opção para gerar um hotsite utilizando uma expressão de busca. Ao utilizá-la, os produtos adicionados nos outros modos de criação de hotsite serão ignorados (optional) - */ - expressao?: string; - /** - * Id dos produtos - */ - produtos?: { - /** - * Identificador do produto a ser mostrado no hotsite - */ - produtoId?: number; - /** - * Ordem para apresentação do produto (optional) - */ - ordem?: number; - }[]; - }; - /** - * Dados de seo (optional) - */ - seo?: { - /** - * Informe o Título que será exibido quando o Hotsite for acessado (optional) - */ - titulo?: string; - /** - * Não se esqueça! Além do texto livre, você pode utilizar as tags [Nome.Hotsite] e [Fbits.NomeLoja] para o cadastro das MetaTags e Title! (optional) - */ - metas?: { - /** - * Informe os dados da Metatag - */ - conteudo?: string; - /** - * Informe os dados da Metatag - */ - nome?: string; - /** - * Informe os dados da Metatag - */ - httpEquiv?: string; - /** - * Informe os dados da Metatag - */ - scheme?: string; - }[]; - }; - /** - * Lista de identificadores de banners a serem vinculados ao hotsite (optional) - */ - banners?: { - /** - * Identificador do banner (optional) - */ - bannerId?: number; - }[]; - /** - * Lista de identificadores de conteúdos a serem vinculados ao hotsite - */ - conteudos?: { - /** - * Identificador do conteúdo - */ - conteudoId?: number; - }[]; - /** - * Status do hotsite (optional) - */ - ativo?: boolean; - }; - }; - /** - * Lista de pedidos - */ - "GET /pedidos/situacaoPedido/:situacoesPedido": { - searchParams: { - /** - * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final dos pedidos que deverão retonar (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - /** - * Tipo de filtro da data (Ordenação "desc" - padrão: DataPedido) - */ - enumTipoFiltroData?: - | "DataPedido" - | "DataAprovacao" - | "DataModificacaoStatus" - | "DataAlteracao" - | "DataCriacao"; - /** - * Lista de formas de pagamento que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as formas de pagamento - */ - formasPagamento?: string; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - /** - * Quando passado o valor true, deverá retornar apenas pedidos de assinatura. Quando falso, deverá retornar todos os pedidos. - */ - apenasAssinaturas?: boolean; - }; - response: { - pedidoId?: number; - situacaoPedidoId?: number; - tipoRastreamentoPedido?: string; - transacaoId?: number; - data?: string; - dataPagamento?: string; - dataUltimaAtualizacao?: string; - valorFrete?: number; - valorTotalPedido?: number; - valorDesconto?: number; - valorDebitoCC?: number; - cupomDesconto?: string; - marketPlacePedidoId?: string; - marketPlacePedidoSiteId?: string; - canalId?: number; - canalNome?: string; - canalOrigem?: string; - retiradaLojaId?: number; - isPedidoEvento?: boolean; - usuario?: { - usuarioId?: number; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - }; - pedidoEndereco?: { - tipo?: string; - nome?: string; - endereco?: string; - numero?: string; - complemento?: string; - referencia?: string; - cep?: string; - tipoLogradouro?: string; - logradouro?: string; - bairro?: string; - cidade?: string; - estado?: string; - pais?: string; - }[]; - frete?: { - freteContratoId?: number; - freteContrato?: string; - referenciaConector?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - retiradaLojaId?: number; - centrosDistribuicao?: { - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - servico?: { - servicoId?: number; - nome?: string; - transportadora?: string; - prazo?: number; - servicoNome?: string; - preco?: number; - servicoTransporte?: number; - codigo?: number; - servicoMeta?: string; - custo?: number; - token?: string; - }; - retiradaAgendada?: { - lojaId?: number; - retiradaData?: string; - retiradaPeriodo?: string; - nome?: string; - documento?: string; - codigoRetirada?: string; - }; - agendamento?: { - de?: string; - ate?: string; - }; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }; - itens?: { - produtoVarianteId?: number; - sku?: string; - nome?: string; - quantidade?: number; - precoCusto?: number; - precoVenda?: number; - isBrinde?: boolean; - valorAliquota?: number; - isMarketPlace?: boolean; - precoPor?: number; - desconto?: number; - totais?: { - precoCusto?: number; - precoVenda?: number; - precoPor?: number; - desconto?: number; - }; - ajustes?: { - tipo?: string; - valor?: number; - observacao?: string; - nome?: string; - }[]; - centroDistribuicao?: { - centroDistribuicaoId?: number; - quantidade?: number; - situacaoProdutoId?: number; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - }[]; - valoresAdicionais?: { - tipo?: string; - origem?: string; - texto?: string; - valor?: number; - }[]; - atributos?: { - produtoVarianteAtributoValor?: string; - produtoVarianteAtributoNome?: string; - }[]; - embalagens?: { - tipoEmbalagemId?: number; - nomeTipoEmbalagem?: string; - mensagem?: string; - valor?: number; - descricao?: string; - }[]; - personalizacoes?: { - nomePersonalizacao?: string; - valorPersonalizacao?: string; - valor?: number; - }[]; - frete?: { - quantidade?: number; - freteContratoId?: number; - freteContrato?: string; - valorFreteEmpresa?: number; - valorFreteCliente?: number; - peso?: number; - pesoCobrado?: number; - volume?: number; - volumeCobrado?: number; - prazoEnvio?: number; - prazoEnvioTexto?: string; - centroDistribuicaoId?: number; - }[]; - dadosProdutoEvento?: { - tipoPresenteRecebimento?: string; - }; - formulas?: { - chaveAjuste?: string; - valor?: number; - nome?: string; - expressao?: string; - expressaoInterpretada?: string; - endPoint?: string; - }[]; - seller?: { - sellerId?: number; - sellerNome?: string; - sellerPedidoId?: number; - }; - }[]; - assinatura?: { - assinaturaId?: number; - grupoAssinaturaId?: number; - tipoPeriodo?: string; - tempoPeriodo?: number; - percentualDesconto?: number; - }[]; - pagamento?: { - formaPagamentoId?: number; - numeroParcelas?: number; - valorParcela?: number; - valorDesconto?: number; - valorJuros?: number; - valorTotal?: number; - boleto?: { - urlBoleto?: string; - codigoDeBarras?: string; - }; - cartaoCredito?: { - numeroCartao?: string; - nomeTitular?: string; - dataValidade?: string; - codigoSeguranca?: string; - documentoCartaoCredito?: string; - token?: string; - info?: string; - bandeira?: string; - }[]; - pagamentoStatus?: { - numeroAutorizacao?: string; - numeroComprovanteVenda?: string; - dataAtualizacao?: string; - dataUltimoStatus?: string; - adquirente?: string; - tid?: string; - }[]; - informacoesAdicionais?: { - chave?: string; - valor?: string; - }[]; - }[]; - observacao?: { - observacao?: string; - usuario?: string; - data?: string; - publica?: boolean; - }[]; - valorCreditoFidelidade?: number; - valido?: boolean; - valorSubTotalSemDescontos?: number; - pedidoSplit?: number[]; - }[]; - }; - /** - * Portfolio encontrado - */ - "GET /portfolios/:nome": { - response: { - portfolioId?: number; - nome?: string; - ativo?: boolean; - }; - }; - /** - * Lista de categorias de um produto - */ - "GET /produtos/:identificador/categorias": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId" | "ProdutoId"; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadRegistros?: number; - }; - response: { - id?: number; - nome?: string; - categoriaPaiId?: number; - categoriaERPId?: string; - ativo?: boolean; - isReseller?: boolean; - exibirMatrizAtributos?: string; - quantidadeMaximaCompraUnidade?: number; - valorMinimoCompra?: number; - exibeMenu?: boolean; - urlHotSite?: string; - caminhoHierarquia?: string; - categoriaPrincipal?: boolean; - }[]; - }; - /** - * Adiciona o vínculo entre um produto e uma categoria com base na lista enviada - */ - "POST /produtos/:identificador/categorias": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Id da Categoria Principal (optional) - */ - categoriaPrincipalId?: number; - /** - * Id da categoria a qual o produto deverá ser vinculado (optional) - */ - listaCategoriaId?: number[]; - }; - }; - /** - * Lista de Atacarejos - */ - "GET /produtos/:identificador/atacarejo": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - response: { - produtoVarianteAtacadoId?: number; - precoAtacado?: number; - quantidade?: number; - }[]; - }; - /** - * Adiciona novos Atacarejos - */ - "POST /produtos/:identificador/atacarejo": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Lista de Atacarejos (optional) - */ - RAW_BODY: { - /** - * Preço atacado - */ - precoAtacado?: number; - /** - * Quantidade do produto - */ - quantidade?: number; - }[]; - }; - response: { - produtoVarianteAtacadoId?: number; - precoAtacado?: number; - quantidade?: number; - }[]; - }; - /** - * Recorrências cadastradas na loja - */ - "GET /assinaturas/recorrencias": { - response: { - recorrencias?: string[]; - }; - }; - /** - * Atualiza rastreamento completo (com os dados da N.F.) - */ - "PUT /pedidos/:pedidoId/rastreamento/:pedidoRastreamentoId": { - body: { - /** - * Objeto Pedido Rastreamento - */ - RAW_BODY: { - /** - * Número da nota fiscal - */ - notaFiscal?: string; - /** - * Código Fiscal de Operações e Prestações - */ - cfop?: number; - /** - * Data Envio - */ - dataEnviado?: string; - /** - * Chave de Acesso NFE - */ - chaveAcessoNFE?: string; - /** - * Rastreamento (optional) - */ - rastreamento?: string; - /** - * URL de rastreamento (optional) - */ - urlRastreamento?: string; - /** - * Transportadora (optional) - */ - transportadora?: string; - /** - * Data da entrega (optional) - */ - dataEntrega?: string; - }; - }; - }; - /** - * Atualiza a prioridade de um centro de distribuição - */ - "PUT /centrosdistribuicao/:centroDistribuicaoId/prioridade": { - body: { - /** - * (optional) - */ - incrementoOrdem?: number; - /** - * (optional) - */ - desativarPriorizacao?: boolean; - }; - response: {}; - }; - /** - * Conteúdos encontrados - */ - "GET /conteudos": { - searchParams: { - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadePorPagina?: number; - }; - response: { - conteudoId?: number; - titulo?: string; - ativo?: boolean; - dataInicio?: string; - dataFim?: string; - posicionamento?: string; - codigoFonte?: string; - termoBusca?: string; - exibeTodasBuscas?: boolean; - naoExibeBuscas?: boolean; - exibeTodosHotsites?: boolean; - hotsitesId?: number[]; - }[]; - }; - /** - * Insere um novo conteúdo na loja - */ - "POST /conteudos": { - body: { - /** - * Titulo do conteúdo - */ - titulo?: string; - /** - * Conteúdo ativo/inativo - */ - ativo?: boolean; - /** - * Data de inicio de exibição do conteúdo (optional) - */ - dataInicio?: string; - /** - * Data final de exibição do conteúdo (optional) - */ - dataFim?: string; - /** - * Posicionamento do conteúdo - */ - posicionamento?: - | "Topo" - | "Centro" - | "Rodape" - | "LateralDireita" - | "LateralEsquerda" - | "MobileTopo" - | "MobileRodape"; - /** - * Informações do conteúdo - */ - conteudo?: string; - /** - * Insira em qual Termo de Busca o Conteúdo será exibido (optional) - */ - termoBusca?: string; - /** - * Exibição do conteúdo nas buscas - */ - exibeTodasBuscas?: boolean; - /** - * Não exibição do conteúdo nas buscas - */ - naoExibeBuscas?: boolean; - /** - * Exibição do conteúdo nos hotsites - */ - exibeTodosHotsites?: boolean; - /** - * Insira quais Hotsites que o Conteúdo será exibido (optional) - */ - hotsitesId?: number[]; - }; - }; - /** - * Atualiza a imagem de estampa do produto - */ - "PUT /produtos/:identificador/imagens/estampa": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Id da imagem que será marcada como estampa - */ - idImagem?: number; - }; - }; - /** - * Retorna lista de usuários cadastrados/descadastrados na newsletter (50 por página) - */ - "GET /usuarios/newsletter": { - searchParams: { - /** - * Tipo de ordenação - */ - ordenarPor?: "DataCadastro" | "DataAtualizacao"; - /** - * Data inicial dos cadastros que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final dos cadastros que deverão retornar (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Status do usuário - */ - status?: boolean; - /** - * DoubleOptIn aceito (verificar estado da configuração) - */ - doubleOptIn?: boolean; - }; - response: { - nome?: string; - email?: string; - sexo?: string; - status?: boolean; - grupoInformacao?: { - nome?: string; - valor?: string; - }[]; - }[]; - }; - /** - * Ativa ou desativa um endereço de um usuário com base no e-mail do usuário - */ - "PUT /usuarios/:email/enderecos/:enderecoId/ativar": { - body: { - /** - * Status do endereço - */ - status?: boolean; - }; - }; - /** - * Insere uma avaliação para um produto variante - */ - "POST /produtoavaliacao/:identificador": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno da fstore - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Texto referente a avaliação do produto - */ - comentario?: string; - /** - * Escala de 1 a 5 para avaliar o produto - */ - avaliacao?: number; - /** - * Identificado do usuário - */ - usuarioId?: number; - /** - * Referente a data que a avaliação foi criada - */ - dataAvaliacao?: string; - /** - * Nome do usuário que avaliou - */ - nome?: string; - /** - * Email do usuário que avaliou - */ - email?: string; - /** - * Referente ao status que libera a visualização da avaliação no site - */ - status?: "Pendente" | "NaoAprovado" | "Aprovado"; - }; - }; - /** - * Relatório de receitas de um determinado período - */ - "GET /dashboard/receita": { - searchParams: { - /** - * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos pedidos que deverão retornar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Tipo de agrupamento dos pedidos (hora, dia, semana, mês, ano) - */ - tipoAgrupamento?: "Hora" | "Dia" | "Semana" | "Mes" | "Ano"; - }; - response: { - tipoAgrupamento?: string; - dados?: { - data?: string; - pedidosCaptados?: number; - pedidosPagos?: number; - pedidosEnviados?: number; - pedidosCancelados?: number; - }[]; - }; - }; - /** - * Lista de fretes - */ - "GET /fretes": { - response: { - freteId?: number; - nome?: string; - ativo?: boolean; - volumeMaximo?: number; - pesoCubado?: number; - entregaAgendadaConfiguracaoId?: number; - linkRastreamento?: string; - ehAssinatura?: boolean; - larguraMaxima?: number; - alturaMaxima?: number; - comprimentoMaximo?: number; - limiteMaximoDimensoes?: number; - limitePesoCubado?: number; - tempoMinimoDespacho?: number; - centroDistribuicaoId?: number; - valorMinimoProdutos?: number; - }[]; - }; - /** - * Insere um novo contrato de frete - */ - "POST /fretes": { - body: { - /** - * Nome do contrato de frete (optional) - */ - nome?: string; - /** - * Status do contrato de frete (optional) - */ - ativo?: boolean; - /** - * Volume máximo permitido , em metro cúbico (m³). (optional) - */ - volumeMaximo?: number; - /** - * Informe o peso cubado. Altura x largura x profundidade x fator de cubagem. (optional) - */ - pesoCubado?: number; - /** - * Id da configuração entrega agendada (optional) - */ - entregaAgendadaConfiguracaoId?: number; - /** - * URL rastreamento (optional) - */ - linkRastreamento?: string; - /** - * Contrato é exclusivo assinatura (optional) - */ - ehAssinatura?: boolean; - /** - * Informe a largura máxima, em centímetros (cm). (optional) - */ - larguraMaxima?: number; - /** - * Informe a altura máxima, em centímetros (cm). (optional) - */ - alturaMaxima?: number; - /** - * Informe o comprimento máximo, em centímetros (cm). (optional) - */ - comprimentoMaximo?: number; - /** - * Informe a soma das três dimensões (Largura + Altura + Comprimento), em centímetros (cm). (optional) - */ - limiteMaximoDimensoes?: number; - /** - * Informe o limite de peso cubado, em gramas (g). (optional) - */ - limitePesoCubado?: number; - /** - * Informe quantos dias no mínimo esse contrato de frete leva para ser enviado ao cliente (optional) - */ - tempoMinimoDespacho?: number; - /** - * Informe o Id do centro de distribuição (optional) - */ - centroDistribuicaoId?: number; - /** - * Informe o valor mínimo em produtos necessário para disponibilidade da tabela de frete (optional) - */ - valorMinimoProdutos?: number; - }; - }; - /** - * Detalhes de uma assinatura - */ - "GET /assinaturas/:assinaturaId": { - response: { - assinaturaId?: number; - usuarioId?: number; - dataProximoPedido?: string; - periodoRecorrencia?: string; - situacaoAssinatura?: string; - dataAssinatura?: string; - grupoAssinatura?: string; - enderecoId?: number; - usuarioCartaoCreditoId?: number; - cupom?: string; - produtos?: { - assinaturaProdutoId?: number; - assinaturaId?: number; - produtoId?: number; - produtoVarianteId?: number; - quantidade?: number; - valor?: number; - removido?: boolean; - }[]; - }; - }; - /** - * Atualiza a situação de uma assinatura específica - */ - "PUT /assinaturas/:assinaturaId": { - body: { - /** - * Id do endereço (optional) - */ - enderecoId?: number; - /** - * Id do cartão de crédito do usuário (optional) - */ - usuarioCartaoCreditoId?: number; - /** - * Período Recorrência (optional) - */ - periodoRecorrencia?: string; - /** - * Situação da Assinatura (optional) - */ - situacaoAssinatura?: "Ativa" | "Pausada" | "Cancelada"; - /** - * Cupom (optional) - */ - cupom?: string; - }; - }; - /** - * Buscar autor pelo nome - */ - "GET /autores/:nomeAutor": {}; - /** - * Lista o conteúdo de uma versão - */ - "GET /gestorscripts/scripts/:scriptId/versao/:versaoId/conteudo": { - response: { - scriptId?: number; - versaoId?: number; - conteudo?: string; - }[]; - }; - /** - * Altera a data de recorrência de uma assinatura - */ - "PUT /assinaturas/:assinaturaId/proximaRecorrencia": { - body: { - /** - * Data da próxima recorrência (Será considerado apenas o dia, mês e ano. Hora e minutos não serão considerados) - */ - proximaRecorrencia?: string; - }; - }; - /** - * Lista de parceiros com pedidos - */ - "GET /parceiros/comPedidos": { - searchParams: { - /** - * Data inicial dos pedidos (aaaa-mm-dd hh:mm:ss) - */ - dataInicial?: string; - /** - * Data final dos pedidos (aaaa-mm-dd hh:mm:ss) - */ - dataFinal?: string; - }; - response: { - parceiroId?: number; - marketPlaceId?: number; - nome?: string; - tabelaPrecoId?: number; - portfolioId?: number; - tipoEscopo?: string; - ativo?: boolean; - isMarketPlace?: boolean; - origem?: string; - }[]; - }; - /** - * Usuário encontrado - */ - "GET /usuarios/cnpj/:cnpj": { - response: { - usuarioId?: number; - bloqueado?: boolean; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - avatar?: string; - ip?: string; - aprovado?: boolean; - }; - }; - /** - * Deleta um produto da lista de sugestões de produtos de um tipo de evento - */ - "DELETE /tiposEvento/:tipoEventoId/produto/:produtoVarianteId": {}; - /** - * Deleta o vinculo de um produto a um evento - */ - "DELETE /eventos/:eventoId/produto/:produtoVarianteId": { - response: string; - }; - /** - * Define uma categoria de um produto como principal - */ - "PUT /produtos/:identificador/categoriaPrincipal": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Id da categoria - */ - categoriaId?: number; - }; - }; - /** - * Atualiza o estoque de vários produtos com base na lista enviada. Limite de 50 produtos por requisição - */ - "PUT /produtos/estoques": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - body: { - /** - * Lista com os dados da atualização do estoque (optional) - */ - RAW_BODY: { - /** - * Valor único utilizado para identificar o produto - */ - identificador?: string; - /** - * Prazo de entrega do produto - */ - prazoEntrega?: number; - /** - * Lista com os dados da atualização do estoque - */ - listaEstoque?: { - /** - * Estoque físico do produto - */ - estoqueFisico?: number; - /** - * Estoque reservado do produto - */ - estoqueReservado?: number; - /** - * Id do centro de distribuição do estoque do produto - */ - centroDistribuicaoId?: number; - /** - * Id do produto variante - */ - produtoVarianteId?: number; - /** - * Quantidade para ativar o alerta de estoque - */ - alertaEstoque?: number; - }[]; - }[]; - }; - response: { - produtosNaoAtualizados?: { - produtoVarianteId?: number; - sku?: string; - centroDistribuicaoId?: number; - resultado?: boolean; - detalhes?: string; - }[]; - produtosAtualizados?: { - produtoVarianteId?: number; - sku?: string; - centroDistribuicaoId?: number; - resultado?: boolean; - detalhes?: string; - }[]; - }; - }; - /** - * Objeto com o estoque total e o estoque por centro de distribuição de um produto variante - */ - "GET /produtos/:identificador/estoque": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - response: { - estoqueFisico?: number; - estoqueReservado?: number; - listProdutoVarianteCentroDistribuicaoEstoque?: { - centroDistribuicaoId?: number; - nome?: string; - estoqueFisico?: number; - estoqueReservado?: number; - }[]; - }; - }; - /** - * Usuário encontrado - */ - "GET /usuarios/usuarioId/:usuarioId": { - response: { - usuarioId?: number; - bloqueado?: boolean; - grupoInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - tipoPessoa?: string; - origemContato?: string; - tipoSexo?: string; - nome?: string; - cpf?: string; - email?: string; - rg?: string; - telefoneResidencial?: string; - telefoneCelular?: string; - telefoneComercial?: string; - dataNascimento?: string; - razaoSocial?: string; - cnpj?: string; - inscricaoEstadual?: string; - responsavel?: string; - dataCriacao?: string; - dataAtualizacao?: string; - revendedor?: boolean; - listaInformacaoCadastral?: { - chave?: string; - valor?: string; - }[]; - avatar?: string; - ip?: string; - aprovado?: boolean; - }; - }; - /** - * Produtos Mais Vendidos - */ - "GET /dashboard/produtos": { - searchParams: { - /** - * Data inicial dos produtos mais vendidos que deverão retonar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos produtos mais vendidos que deverão retonar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Id do parceiro - */ - parceiroId?: number; - }; - response: { - produtoVarianteId?: number; - nomeProduto?: string; - sku?: string; - quantidade?: number; - receita?: string; - }[]; - }; - /** - * Atualiza rastreamento parcial (Rastreamento e UrlRastreamento) - */ - "PUT /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento/:pedidoRastreamentoProdutoId/parcial": - { - body: { - /** - * Objeto Pedido Rastreamento Produto - */ - RAW_BODY: { - /** - * Rastreamento (optional) - */ - rastreamento?: string; - /** - * URL de Rastreamento (optional) - */ - urlRastreamento?: string; - }; - }; - }; - /** - * Atualiza o status do banner pelo id - */ - "PUT /banners/:bannerId/status": { - body: { - /** - * Status para qual deve ir o baner: Ativo (true) ou Inativo (false) - */ - status?: boolean; - }; - }; - /** - * Atualiza um endereço de um usuário pelo id do usuário - */ - "PUT /usuarios/:usuarioId/enderecos/:enderecoId": { - body: { - /** - * Nome de identificação do endereço a ser cadastrado (Max Length: 100) - */ - nomeEndereco?: string; - /** - * Nome da rua (Max Length: 500) - */ - rua?: string; - /** - * Número do local (Max Length: 50) - */ - numero?: string; - /** - * Complemento (Max Length: 250) (optional) - */ - complemento?: string; - /** - * Referência para a localização do endereço (Max Length: 500) (optional) - */ - referencia?: string; - /** - * Bairro do endereço (Max Length: 100) - */ - bairro?: string; - /** - * Cidade em que se localiza o endereço (Max Length: 100) - */ - cidade?: string; - /** - * O estado (Max Length: 100) - */ - estado?: string; - /** - * Código do cep (Max Length: 50) - */ - cep?: string; - }; - }; - /** - * Lista de avaliações de produtos - */ - "GET /produtos/:identificador/avaliacoes": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - /** - * Referente ao status que libera a visualização da avaliação no site = ['Pendente', 'NaoAprovado', 'Aprovado'] - */ - status?: "Pendente" | "NaoAprovado" | "Aprovado"; - /** - * Página da lista (padrão: 1) - */ - pagina?: number; - /** - * Quantidade de registros que deverão retornar (max: 50) - */ - quantidadeRegistros?: number; - }; - response: { - produtoVarianteId?: number; - sku?: string; - produtoAvaliacaoId?: number; - comentario?: string; - avaliacao?: number; - usuarioId?: number; - dataAvaliacao?: string; - nome?: string; - email?: string; - status?: string; - }[]; - }; - /** - * Atualiza um usuário pelo id - */ - "PUT /usuarios/:usuarioId": { - body: { - /** - * Tipo de pessoa - */ - tipoPessoa?: "Fisica" | "Juridica"; - /** - * Origem do contato - */ - origemContato?: - | "Google" - | "Bing" - | "Jornal" - | "PatrocinioEsportivo" - | "RecomendacaoAlguem" - | "Revista" - | "SiteInternet" - | "Televisao" - | "Outro" - | "UsuarioImportadoViaAdmin" - | "PayPalExpress"; - /** - * Tipo Sexo (optional) - */ - tipoSexo?: "Undefined" | "Masculino" | "Feminino"; - /** - * Nome do usuário (Max Length: 100) - */ - nome?: string; - /** - * CPF do usuário caso seja pessoa física (Max Length: 50) (optional) - */ - cpf?: string; - /** - * E-mail do usuário (Max Length: 100) - */ - email?: string; - /** - * RG do usuário caso seja pessoa física (Max Length: 50) (optional) - */ - rg?: string; - /** - * Telefone residencial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) - */ - telefoneResidencial?: string; - /** - * Telefone celular do usuário. Deve ser informado o DDD junto ao número (Max Length: 50) (optional) - */ - telefoneCelular?: string; - /** - * Telefone comercial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) (optional) - */ - telefoneComercial?: string; - /** - * Data de nascimento (optional) - */ - dataNascimento?: string; - /** - * Razão social do usuário, caso seja uma pessoa jurídica(Max Length: 100) (optional) - */ - razaoSocial?: string; - /** - * CNPJ do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) - */ - cnpj?: string; - /** - * Inscrição estadual do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) - */ - inscricaoEstadual?: string; - /** - * Responsável(Max Length: 100) (optional) - */ - responsavel?: string; - /** - * Data de criação do cadastro (optional) - */ - dataCriacao?: string; - /** - * Data de atualização do cadastro (optional) - */ - dataAtualizacao?: string; - /** - * Se o usuário é revendedor (optional) - */ - revendedor?: boolean; - /** - * Informação cadastral (optional) - */ - listaInformacaoCadastral?: { - /** - * Chave - */ - chave?: string; - /** - * Valor - */ - valor?: string; - }[]; - /** - * Avatar (Max Length: 50) (optional) - */ - avatar?: string; - /** - * IP do usuário (Max Length: 20) (optional) - */ - ip?: string; - /** - * Seta ou retorna o valor de Aprovado (optional) - */ - aprovado?: boolean; - }; - }; - /** - * Liberar reservas de pedidos - */ - "POST /pedidos/liberarReservas": { - body: { - /** - * Números dos pedidos que se deseja buscar - */ - RAW_BODY: number[]; - }; - }; - /** - * Atualiza para o mesmo preço, todos os variantes de um produto encontrado com o SKU informado. Limite de 50 produtos por requisição - */ - "PUT /produtos/precos/lote": { - body: { - /** - * Lista com os dados da atualização do preço por lote - */ - RAW_BODY: { - /** - * Identificador do produto (SKU) - */ - sku?: string; - /** - * Preço de custo do produto variante. Se passado 0 irá setar os valores para zero, se for NULO, não irá atualizar o preço de custo (optional) - */ - precoCusto?: number; - /** - * "PrecoDe" do produto variante - */ - precoDe?: number; - /** - * "PrecoPor" do produto variante - */ - precoPor?: number; - /** - * Fator multiplicador que gera o preço de exibição do produto. Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) (optional) - */ - fatorMultiplicadorPreco?: number; - }[]; - }; - response: { - produtosNaoAtualizados?: { - produtoVarianteId?: number; - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - produtosAtualizados?: { - produtoVarianteId?: number; - sku?: string; - resultado?: boolean; - detalhes?: string; - }[]; - }; - }; - /** - * Atualiza a exibição do banner em parceiros, se deve ser em todos ou não - */ - "PUT /banners/:bannerId/Parceiros": { - body: { - /** - * Exibição do banner em parceiros - */ - exibirEmTodosParceiros?: boolean; - }; - }; - /** - * Retorna lista contendo os Id's dos pedidos do usuário - */ - "GET /usuarios/documento/:documento/pedidos": { - searchParams: { - /** - * Define se o documento informado é um CPF ou um CNPJ - */ - tipoDocumento?: "Cpf" | "Cnpj"; - }; - response: { - pedidoId?: number; - links?: { - href?: string; - rel?: string; - method?: string; - }[]; - }[]; - }; - /** - * Objeto com o precoDe e precoPor de um produto variante - */ - "GET /produtos/:identificador/preco": { - searchParams: { - /** - * Define se o identificador informado é um sku ou um id interno. - */ - tipoIdentificador?: "Sku" | "ProdutoVarianteId"; - }; - response: { - precoDe?: number; - precoPor?: number; - fatorMultiplicadorPreco?: number; - }; - }; - /** - * Campo atualizado com sucesso - */ - "PUT /usuarios/bloquear": { - body: { - /** - * Usuários (optional) - */ - RAW_BODY?: { - /** - * E-mail do usuário - */ - email?: string; - /** - * Status do usuário - */ - bloqueado?: boolean; - }[]; - }; - response: { - usuariosAtualizados?: string[]; - usuariosNaoAtualizados?: string[]; - }; - }; - /** - * Frete atualizado com sucesso - */ - "PUT /fretes/:freteId/Ativo": { - body: { - /** - * Status para atualização do contrato de frete - */ - ativo?: boolean; - }; - }; - /** - * Gera um novo pedido para a assinatura - */ - "POST /assinaturas/:assinaturaId/pedido": {}; - /** - * Xml com os dados das mídias entre duas datas - */ - "GET /midias": { - searchParams: { - /** - * Data inicial (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final (aaaa-mm-dd) - */ - dataFinal?: string; - }; - }; - /** - * Relatório de ticket médio de um determinado período - */ - "GET /dashboard/ticketMedio": { - searchParams: { - /** - * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd) - */ - dataInicial?: string; - /** - * Data final dos pedidos que deverão retornar (aaaa-mm-dd) - */ - dataFinal?: string; - /** - * Tipo de agrupamento dos pedidos (hora, dia, semana, mês, ano) - */ - tipoAgrupamento?: "Hora" | "Dia" | "Semana" | "Mes" | "Ano"; - }; - response: { - tipoAgrupamento?: string; - dados?: { - data?: string; - pedidosCaptados?: number; - pedidosPagos?: number; - pedidosEnviados?: number; - pedidosCancelados?: number; - }[]; - }; - }; - /** - * Objeto com as cotações de frete - */ - "GET /fretes/pedidos/:pedidoId/cotacoes": { - searchParams: { - /** - * Força cotação de todos os CD's. - */ - forcarCotacaoTodosCDs?: boolean; - }; - response: { - id?: string; - nome?: string; - prazo?: number; - tabelaFreteId?: string; - tipo?: string; - valor?: number; - centroDistribuicao?: number; - produtos?: { - produtoVarianteId?: number; - valor?: number; - centroDistribuicaoId?: number; - }[]; - }[]; - }; +/** + * Últimos Pedidos + */ +"GET /dashboard/pedidos": { +response: { +pedidoId?: number +situacaoPedidoId?: number +situacaoNome?: string +data?: string +dataFormatado?: string +hora?: string +valorTotal?: string +}[] +} +/** + * Lista de hotsites vinculados ao banner + */ +"GET /banners/:bannerId/hotsites": { +response: { +exibirEmTodosHotSites?: boolean +hotSites?: { +hotSiteId?: number +}[] +} +} +/** + * Vincula hotsites com um banner específico + */ +"POST /banners/:bannerId/hotsites": { +body: { +/** + * lista de identificadores de hotsites a serem vinculados ao banner + */ +RAW_BODY?: { +/** + * Id do hotsite (optional) + */ +hotSiteId?: number +}[] +} +} +/** + * Atualiza a exibição do banner nos hotsites, se deve ser em todos ou não + */ +"PUT /banners/:bannerId/hotsites": { +body: { +/** + * Exibição do banner nos hotsites + */ +exibirEmTodosHotsites?: boolean +} +} +/** + * Deleta o vinculo de um ou mais hotsites com um banner específico + */ +"DELETE /banners/:bannerId/hotsites": { +body: { +/** + * Lista de identificadores de hotsites para desvincular do banner (optional) + */ +listaHotsites?: { +/** + * Id do hotsite para vinculo com banner + */ +hotSiteId?: { +/** + * Id do hotsite para vinculo com banner + */ +hotSiteId?: any[] +}[] +} +} +} +/** + * Retorna se o usuário ativou o recebimento de newsletter + */ +"GET /usuarios/:email/comunicacao": { +response: { +recebimentoNewsletter?: boolean +} +} +/** + * Atualiza a comunicação de um usuário via newsletter + */ +"PUT /usuarios/:email/comunicacao": { +body: { +/** + * Novo status da comunicação via new ajuste realisletter + */ +recebimentoNewsletter?: boolean +} +} +/** + * Buscar autor por id + */ +"GET /autores/:autorId": { + +} +/** + * Atualizar autor + */ +"PUT /autores/:autorId": { +body: { +/** + * Nome do Autor + */ +nome?: string +/** + * Status do autor + */ +ativo?: boolean +} +} +/** + * Deletar autor + */ +"DELETE /autores/:autorId": { + +} +/** + * Retorna lista contendo os Id's dos pedidos do usuário + */ +"GET /usuarios/:email/pedidos": { +response: { +pedidoId?: number +links?: { +href?: string +rel?: string +method?: string +}[] +}[] +} +/** + * Usuário encontrado + */ +"GET /usuarios/cpf/:cpf": { +response: { +usuarioId?: number +bloqueado?: boolean +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +avatar?: string +ip?: string +aprovado?: boolean +} +} +/** + * Loja Física + */ +"GET /lojasFisicas/:lojaFisicaId": { +response: { +lojaId?: number +nome?: string +ddd?: number +telefone?: string +email?: string +cep?: string +logradouro?: string +numero?: string +complemento?: string +bairro?: string +cidade?: string +estadoId?: number +prazoEntrega?: number +prazoMaximoRetirada?: number +ativo?: boolean +valido?: boolean +textoComplementar?: string +retirarNaLoja?: boolean +latitude?: number +longitude?: number +centroDistribuicaoId?: number +centroDistribuicao?: { +centroDistribuicaoId?: number +prazoEntrega?: number +}[] +} +} +/** + * Atualiza uma Loja Física + */ +"PUT /lojasFisicas/:lojaFisicaId": { +body: { +/** + * Id da loja (optional) + */ +lojaId?: number +/** + * Nome da loja (optional) + */ +nome?: string +/** + * DDD da localidade de destino da loja (optional) + */ +ddd?: number +/** + * Telefone da loja (optional) + */ +telefone?: string +/** + * E-mail de contato da loja (optional) + */ +email?: string +/** + * CEP do endereço da loja (optional) + */ +cep?: string +/** + * Logradouro do endereço da loja (optional) + */ +logradouro?: string +/** + * Número de localização do endereço da loja (optional) + */ +numero?: string +/** + * Complemento para localização da loja (optional) + */ +complemento?: string +/** + * Bairro do endereço do loja (optional) + */ +bairro?: string +/** + * Cidade em que a loja se encontra (optional) + */ +cidade?: string +/** + * Id do estado em que a loja se encontra (optional) + */ +estadoId?: number +/** + * Prazo de entrega (optional) + */ +prazoEntrega?: number +/** + * Prazo máximo para retirada (optional) + */ +prazoMaximoRetirada?: number +/** + * Status da loja (optional) + */ +ativo?: boolean +/** + * Valido (optional) + */ +valido?: boolean +/** + * Informações complementares da loja (optional) + */ +textoComplementar?: string +/** + * Se a retirada na loja será ativada (optional) + */ +retirarNaLoja?: boolean +/** + * Latitude (optional) + */ +latitude?: number +/** + * Longitude (optional) + */ +longitude?: number +/** + * Lista com os Identificadores dos centros de distribuição que serão vinculados a loja física (optional) + */ +centroDistribuicao?: { +/** + * Id do centro de distribuição + */ +centroDistribuicaoId?: number +/** + * Prazo de entrega + */ +prazoEntrega?: number +}[] +} +} +/** + * Remove uma Loja Física + */ +"DELETE /lojasFisicas/:lojaFisicaId": { + +} +/** + * Atributo encontrado + */ +"GET /atributos/:nome": { +response: { +nome?: string +tipo?: string +tipoExibicao?: string +prioridade?: number +} +} +/** + * Atualiza um atributo + */ +"PUT /atributos/:nome": { +body: { +/** + * Nome do atributo (optional) + */ +nome?: string +/** + * Tipo do atributo (optional) + */ +tipo?: ("Selecao" | "Filtro" | "Comparacao" | "Configuracao" | "ExclusivoGoogle") +/** + * Tipo de exibição (optional) + */ +tipoExibicao?: ("Combo" | "Div" | "DivComCor" | "DivComFotoDoProdutoVariante" | "Javascript") +/** + * Prioridade do atributo (optional) + */ +prioridade?: number +} +} +/** + * Deleta um atributo + */ +"DELETE /atributos/:nome": { + +} +/** + * Lista de resellers + */ +"GET /resellers": { +response: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +}[] +} +/** + * Insere um novo Seller no marketplace + */ +"POST /resellers": { +body: { +/** + * Razão Social/Nome do Reseller + */ +razaoSocial?: string +/** + * CNPJ do Seller + */ +cnpj?: string +/** + * Inscrição Estadual do Seller + */ +inscricaoEstadual?: string +/** + * Seller isento de inscrição estadual + */ +isento?: boolean +/** + * Email de contato do Seller + */ +email?: string +/** + * Telefone de contato do seller com ddd (xx) xxxx-xxxx + */ +telefone?: string +/** + * Tipo de autonomia do vendedor + */ +tipoAutonomia?: ("ComAutonomia" | "SemAutonomia") +/** + * Seller Ativo + */ +ativo?: boolean +/** + * Se irá ter Split de frete boolean. Default:false + */ +split?: boolean +/** + * Se o produto deverá ser apresentado em BuyBox (apenas para Seller's e Marketplace's TrayCorp) boolean. Default:false, + */ +buyBox?: boolean +/** + * Se os produtos deverão sem ativados automaticamente no marketplace boolean. Default:false, + */ +ativacaoAutomaticaProdutos?: boolean +/** + * Cep do Seller (utilizado para o calculo de frete) + */ +cep?: string +} +} +/** + * Atualiza um novo Seller no marketplace + */ +"PUT /resellers": { +searchParams: { +/** + * Valor único utilizado para identificar o seller + */ +resellerId?: number +} +body: { +/** + * Razão Social/Nome do Reseller + */ +razaoSocial?: string +/** + * CNPJ do Seller + */ +cnpj?: string +/** + * Inscrição Estadual do Seller + */ +inscricaoEstadual?: string +/** + * Seller isento de inscrição estadual + */ +isento?: boolean +/** + * Email de contato do Seller + */ +email?: string +/** + * Telefone de contato do seller com ddd (xx) xxxx-xxxx + */ +telefone?: string +/** + * Tipo de autonomia do vendedor + */ +tipoAutonomia?: ("ComAutonomia" | "SemAutonomia") +/** + * Seller Ativo + */ +ativo?: boolean +/** + * Se irá ter Split de frete boolean. Default:false + */ +split?: boolean +/** + * Se o produto deverá ser apresentado em BuyBox (apenas para Seller's e Marketplace's TrayCorp) boolean. Default:false, + */ +buyBox?: boolean +/** + * Se os produtos deverão sem ativados automaticamente no marketplace boolean. Default:false, + */ +ativacaoAutomaticaProdutos?: boolean +/** + * Cep do Seller (utilizado para o calculo de frete) + */ +cep?: string +} +} +/** + * Reseller específico + */ +"GET /resellers/:resellerId": { +response: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +} +} +/** + * Lista de produtos + */ +"GET /produtos": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Lista de categorias que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as categorias + */ +categorias?: string +/** + * Lista de fabricantes que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as situações + */ +fabricantes?: string +/** + * Lista de centros de distribuição que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará produtos de todos os cd's + */ +centrosDistribuicao?: string +/** + * Retorna apenas os produtos que sofreram alguma alteração a partir da data/hora informada. Formato: aaaa-mm-dd hh:mm:ss com no máximo 48 horas de antecedência + */ +alteradosPartirDe?: string +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Retorna apenas os produtos que estão marcados como válido + */ +somenteValidos?: boolean +/** + * Campos adicionais que se selecionados retornaram junto com o produto, valores aceitos: Atacado, Estoque, Atributo , Informacao, TabelaPreco + */ +camposAdicionais?: string[] +} +response: { +produtoVarianteId?: number +produtoId?: number +idPaiExterno?: string +idVinculoExterno?: string +sku?: string +nome?: string +nomeProdutoPai?: string +urlProduto?: string +exibirMatrizAtributos?: string +contraProposta?: boolean +fabricante?: string +autor?: string +editora?: string +colecao?: string +genero?: string +precoCusto?: number +precoDe?: number +precoPor?: number +fatorMultiplicadorPreco?: number +prazoEntrega?: number +valido?: boolean +exibirSite?: boolean +freteGratis?: string +trocaGratis?: boolean +peso?: number +altura?: number +comprimento?: number +largura?: number +garantia?: number +isTelevendas?: boolean +ean?: string +localizacaoEstoque?: string +listaAtacado?: { +precoPor?: number +quantidade?: number +}[] +estoque?: { +estoqueFisico?: number +estoqueReservado?: number +centroDistribuicaoId?: number +alertaEstoque?: number +}[] +atributos?: { +tipoAtributo?: string +isFiltro?: boolean +nome?: string +valor?: string +exibir?: boolean +}[] +quantidadeMaximaCompraUnidade?: number +quantidadeMinimaCompraUnidade?: number +condicao?: string +informacoes?: { +informacaoId?: number +titulo?: string +texto?: string +tipoInformacao?: string +}[] +tabelasPreco?: { +tabelaPrecoId?: number +nome?: string +precoDe?: number +precoPor?: number +}[] +dataCriacao?: string +dataAtualizacao?: string +urlVideo?: string +spot?: boolean +paginaProduto?: boolean +marketplace?: boolean +somenteParceiros?: boolean +reseller?: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +} +buyBox?: boolean +consumo?: { +quantidadeDias?: number +enviarEmail?: boolean +} +prazoValidade?: number +}[] +} +/** + * Método que insere um produto na base + */ +"POST /produtos": { +body: { +/** + * Representa o ProdutoId agrupador por variante (optional) + */ +idPaiExterno?: string +/** + * Representa o ParentId agrupador por parent (optional) + */ +idVinculoExterno?: string +/** + * (Max Length: 50) Sku do produto + */ +sku?: string +/** + * (Max Length: 300) Nome do produto variante + */ +nome?: string +/** + * Nome do produto (pai do variante) (optional) + */ +nomeProdutoPai?: string +/** + * Tipo de exibição da matriz de atributos (optional) + */ +exibirMatrizAtributos?: ("Sim" | "Nao" | "Neutro") +/** + * Se o produto aceita contra proposta (optional) + */ +contraProposta?: boolean +/** + * (Max Length: 100) Nome do fabricante + */ +fabricante?: string +/** + * (Max Length: 500) Nome do autor (optional) + */ +autor?: string +/** + * (Max Length: 100) Nome da editora (optional) + */ +editora?: string +/** + * (Max Length: 100) Nome da coleção (optional) + */ +colecao?: string +/** + * (Max Length: 100) Nome do gênero (optional) + */ +genero?: string +/** + * Max Length: 8, "0000.0000,00") Preço de custo do produto variante (optional) + */ +precoCusto?: number +/** + * (Max Length: 8, "0000.0000,00") "Preço De" do produto variante (optional) + */ +precoDe?: number +/** + * (Max Length: 8, "0000.0000,00") "Preço Por" de venda do produto variante + */ +precoPor?: number +/** + * (Max Length: 8, "0000.0000,00") Fator multiplicador que gera o preço de exibição do produto.Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) (optional) + */ +fatorMultiplicadorPreco?: number +/** + * Prazo de entrega do produto variante (optional) + */ +prazoEntrega?: number +/** + * Define se um produto variante é valido ou não + */ +valido?: boolean +/** + * Define se um produto deve ser exibido no site + */ +exibirSite?: boolean +/** + * Define a qual regra de calculo de frete o produto vai pertencer + */ +freteGratis?: ("Sempre" | "Nunca" | "Neutro" | "Desconsiderar_Regras") +/** + * Define se o produto variante tem troca grátis (optional) + */ +trocaGratis?: boolean +/** + * (Max Length: 8, "0000.0000,00") Peso do produto variante, em gramas (g). + */ +peso?: number +/** + * (Max Length: 8, "0000.0000,00") Altura do produto variante, em centímetros (cm). + */ +altura?: number +/** + * (Max Length: 8, "0000.0000,00") Comprimento do produto variante, em centímetros (cm). + */ +comprimento?: number +/** + * (Max Length: 8, "0000.0000,00") Largura do produto variante, em centímetros (cm). + */ +largura?: number +/** + * Define se o produto variante tem garantia (optional) + */ +garantia?: number +/** + * Define se o produto contém televendas (optional) + */ +isTelevendas?: boolean +/** + * (Max Length: 25) EAN do produto variante (optional) + */ +ean?: string +/** + * (Max Length: 255) Localização no estoque do produto variante (optional) + */ +localizacaoEstoque?: string +/** + * Dados de atacado do produto variante (optional) + */ +listaAtacado?: { +/** + * (Max Length: 8, "0000.0000,00") - Preco Por do item por atacado + */ +precoPor?: number +/** + * Quantidade para compra de atacado + */ +quantidade?: number +}[] +/** + * Lista de estoque/centro de distribuição do produto. Obrigatório se valido for true (optional) + */ +estoque?: { +/** + * Estoque físico do produto + */ +estoqueFisico?: number +/** + * Estoque reservado do produto + */ +estoqueReservado?: number +/** + * Id do centro de distribuição do estoque do produto + */ +centroDistribuicaoId?: number +/** + * Quantidade para ativar o alerta de estoque + */ +alertaEstoque?: number +}[] +/** + * Lista de atributos do produto + */ +listaAtributos?: { +/** + * (Max Length: 100) - Define o nome do atributo + */ +nome?: string +/** + * (Max Length: 8, "0000.0000,00") - Define o valor do atributo + */ +valor?: string +/** + * Define se o atributo deverá ser exibido + */ +exibir?: boolean +}[] +/** + * Quantidade máxima de compra do produto variante (optional) + */ +quantidadeMaximaCompraUnidade?: number +/** + * Quantidade mínima de compra do produto variante (optional) + */ +quantidadeMinimaCompraUnidade?: number +/** + * Condição do produto variante (optional) + */ +condicao?: ("Novo" | "Usado" | "Renovado" | "Danificado") +/** + * Url do vídeo do Produto (optional) + */ +urlVideo?: string +/** + * Se o produto aparece no Spot (optional) + */ +spot?: boolean +/** + * Se o produto aparece na Url (optional) + */ +paginaProduto?: boolean +/** + * Se o produto aparece no Marketplace (optional) + */ +marketplace?: boolean +/** + * Se o produto aparece somente nos Parceiros (optional) + */ +somenteParceiros?: boolean +/** + * Se o produto deve ser agrupado pelo EAN (optional) + */ +buyBox?: boolean +/** + * Prazo de validade ou consumo do produto (optional) + */ +prazoValidade?: number +/** + * Dados de consumo de produto e se deve enviar os dias de consumo por e-mail. + */ +consumo?: { +/** + * Quantidade de Dias (optional) + */ +quantidadeDias?: number +/** + * Enviar e-mail (optional) + */ +enviarEmail?: boolean +} +} +} +/** + * Remove um produto de uma tabela de preço + */ +"DELETE /tabelaPrecos/:tabelaPrecoId/:sku": { + +} +/** + * Atualiza o frete de todos os produtos de um pedido + */ +"PUT /pedidos/:pedidoId/changeseller": { +body: { +/** + * Objeto com os dados de cotação e responsável + */ +RAW_BODY: { +/** + * ID da cotação retornada em GET /fretes/pedidos/{pedidoId}/cotacoes + */ +cotacao?: string +/** + * Responsável pela cotação + */ +responsavel?: string +} +} +} +/** + * Objeto do banner + */ +"GET /banners/:bannerId": { +response: { +id?: number +nome?: string +dataInicio?: string +dataFim?: string +ativo?: boolean +detalhe?: { +posicionamentoId?: number +urlBanner?: string +imagemBanner?: { +nome?: string +base64?: string +formato?: string +} +ordemExibicao?: number +abrirBannerNovaAba?: boolean +largura?: number +altura?: number +title?: string +urlClique?: string +urlBannerAlternativo?: string +titleAlternativo?: string +diasExibicao?: { +todosDias?: boolean +domingo?: boolean +segunda?: boolean +terca?: boolean +quarta?: boolean +quinta?: boolean +sexta?: boolean +sabado?: boolean +} +textoAlternativo?: string +} +apresentacao?: { +exibirNoSite?: boolean +exibirEmTodasBuscas?: boolean +naoExibirEmBuscas?: boolean +termosBusca?: string +listaHotsites?: { +exibirEmTodosHotSites?: boolean +hotSites?: { +hotSiteId?: number +}[] +} +exibirEmTodasCategorias?: boolean +listaParceiros?: { +exibirEmTodosParceiros?: boolean +parceiros?: { +parceiroId?: number +}[] +} +} +} +} +/** + * Atualiza um banner existente + */ +"PUT /banners/:bannerId": { +body: { +/** + * Nome do banner + */ +nome?: string +/** + * Data de inicio de exibição do banner + */ +dataInicio?: string +/** + * Data de termino de exibição do banner (optional) + */ +dataFim?: string +/** + * Banner ativo/inativo (optional) + */ +ativo?: boolean +/** + * Detalhes do banner + */ +detalhe?: { +/** + * Local de posicionamento do banner + */ +posicionamentoId?: number +/** + * Imagem do banner (caso o campo "UrlBanner" estiver preenchido esse campo será desconsiderado) (optional) + */ +imagemBanner?: { +/** + * string da imagem em base 64 + */ +base64?: string +/** + * formato da imagem + */ +formato?: ("PNG" | "JPG" | "JPEG") +/** + * nome da imagem + */ +nome?: string +} +/** + * Url de onde o banner deve ser carregado (Ex.: http://www.site.com.br/banner.swf). O Banner poderá ser do tipo flash ou imagem (optional) + */ +urlBanner?: string +/** + * Ordem de exibição do banner (optional) + */ +ordemExibicao?: number +/** + * Se o banner deve ou não abrir em nova aba (optional) + */ +abrirLinkNovaAba?: boolean +/** + * Largura do banner em pixels (optional) + */ +largura?: number +/** + * Altura do banner em pixels (optional) + */ +altura?: number +/** + * Title da imagem do banner (optional) + */ +title?: string +/** + * Url de destino para quando o usuário clicar no Banner (optional) + */ +urlClique?: string +/** + * URL para um Banner alternativo que será exibido caso ocorra algum problema para exibição do Banner (optional) + */ +urlBannerAlternativo?: string +/** + * Title alternativo que será exibido caso ocorra algum problema para a exibição do Banner + */ +textoAlternativo?: string +} +/** + * Dias da semana que o banner deverá ser exibido (optional) + */ +diasExibicao?: { +/** + * Se o banner deverá ser exibido todos os dias (caso esse campo estiver preenchido como "true" os demais serão desconsiderados) + */ +todosDias?: boolean +/** + * Se o banner deverá ser apresentado no domingo + */ +domingo?: boolean +/** + * Se o banner deverá ser apresentado na segunda + */ +segunda?: boolean +/** + * Se o banner deverá ser apresentado na terça + */ +terca?: boolean +/** + * Se o banner deverá ser apresentado na quarta + */ +quarta?: boolean +/** + * Se o banner deverá ser apresentado na quinta + */ +quinta?: boolean +/** + * Se o banner deverá ser apresentado na sexta + */ +sexta?: boolean +/** + * Se o banner deverá ser apresentado no sábado + */ +sabado?: boolean +} +/** + * Apresentação do banner (optional) + */ +apresentacao?: { +/** + * Se o banner deverá ser exibido em todo o site + */ +exibirNoSite?: boolean +/** + * Se o banner deverá ser exibido em todas as buscas + */ +exibirEmTodasBuscas?: boolean +/** + * Se o banner não deverá ser exibido em nenhuma busca (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) + */ +naoExibirEmBuscas?: boolean +/** + * Termos que o banner será exibido na busca + */ +termosBusca?: string +/** + * Se o banner deverá ser exibido em todas categorias (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) + */ +exibirEmTodasCategorias?: boolean +/** + * Em quais hotsites o banner deve ser exibido + */ +listaHotsites?: { +/** + * Se o banner deverá ser exibido em todos as hotsite's (Caso esse campo estiver como "true" o campo HotSites será desconsiderado) (optional) + */ +exibirEmTodosHotsites?: boolean +/** + * Lista de hotsite's que o banner será exibido + */ +hotsites?: { +/** + * Id do hotsite (optional) + */ +hotSiteId?: number +}[] +} +} +/** + * Em quais parceiros o banner deve ser exibido + */ +listaParceiros?: { +/** + * Se o banner deverá ser exibido em todos parceiros (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) (optional) + */ +exibirEmTodosParceiros?: boolean +/** + * Lista de parceiros que o banner será exibido + */ +parceiros?: { +/** + * Id do parceiro (optional) + */ +parceiroId?: number +}[] +} +} +} +/** + * Deleta um banner existente + */ +"DELETE /banners/:bannerId": { + +} +/** + * Atualiza um produto em uma assinatura + */ +"PUT /assinaturas/produtos/:assinaturaProdutoId/Alterar": { +body: { +/** + * Novo valor do produto na assinatura (optional) + */ +valor?: number +/** + * Se o produto será considerado removido ou não da assinatura (optional) + */ +removido?: boolean +/** + * Quantidade do produto na assinatura (optional) + */ +quantidade?: number +} +} +/** + * Parceiro encontrado + */ +"GET /parceiros/:parceiroId": { +response: { +parceiroId?: number +marketPlaceId?: number +nome?: string +tabelaPrecoId?: number +portfolioId?: number +tipoEscopo?: string +ativo?: boolean +isMarketPlace?: boolean +origem?: string +} +} +/** + * Parceiro atualizado com sucesso + */ +"PUT /parceiros/:parceiroId": { +body: { +/** + * Nome do parceiro + */ +nome?: string +/** + * Id da tabela de preço (optional) + */ +tabelaPrecoId?: number +/** + * Id do portfolio (optional) + */ +portfolioId?: number +/** + * Tipo de escopo + */ +tipoEscopo?: ("Aberto\"" | "Fechado" | "PorCliente") +/** + * Status do parceiro + */ +ativo?: boolean +/** + * Se o parceiro é marketplace (optional) + */ +isMarketPlace?: boolean +/** + * Origem (optional) + */ +origem?: string +/** + * alias (optional) + */ +alias?: string +} +response: { +resultadoOperacao?: boolean +codigo?: number +mensagem?: string +}[] +} +/** + * Parceiro excluído com sucesso + */ +"DELETE /parceiros/:parceiroId": { +response: { +resultadoOperacao?: boolean +codigo?: number +mensagem?: string +} +} +/** + * Lista de parceiros + */ +"GET /parceiros": { +response: { +parceiroId?: number +marketPlaceId?: number +nome?: string +tabelaPrecoId?: number +portfolioId?: number +tipoEscopo?: string +ativo?: boolean +isMarketPlace?: boolean +origem?: string +}[] +} +/** + * Insere um novo parceiro + */ +"POST /parceiros": { +body: { +/** + * Nome do parceiro + */ +nome?: string +/** + * Id da tabela de preço (optional) + */ +tabelaPrecoId?: number +/** + * Id do portfolio (optional) + */ +portfolioId?: number +/** + * Tipo de escopo + */ +tipoEscopo?: ("Aberto\"" | "Fechado" | "PorCliente") +/** + * Status do parceiro + */ +ativo?: boolean +/** + * Se o parceiro é marketplace (optional) + */ +isMarketPlace?: boolean +/** + * Origem (optional) + */ +origem?: string +} +} +/** + * Lista de tipos de evento + */ +"GET /tiposEvento": { +searchParams: { +/** + * Status do tipo de evento + */ +ativo?: boolean +/** + * Se o tipo de evento está disponível + */ +disponivel?: boolean +/** + * Nome do tipo de evento + */ +nome?: string +} +response: { +tipoEventoId?: number +nome?: string +tipoEntrega?: string +tipoDisponibilizacao?: string +permitirRemocaoAutomaticaProdutos?: boolean +corHexTituloInformacoes?: string +corHexCorpoInformacoes?: string +numeroAbasInformacoes?: number +quantidadeDiasParaEventoExpirar?: number +numeroLocaisEvento?: number +ativo?: boolean +disponivel?: boolean +tipoBeneficiarioFrete?: string +caminhoLogoEvento?: string +caminhoSubTemplate?: string +sugestaoProdutos?: { +tipoEventoId?: number +produtoVarianteId?: number +}[] +}[] +} +/** + * Insere um novo tipo de evento + */ +"POST /tiposEvento": { +body: { +/** + * Nome do Tipo de Evento + */ +nome?: string +/** + * Tipo de entrega + */ +tipoEntrega?: ("EntregaAgendada" | "EntregaConformeCompraRealizada" | "Todos" | "Nenhum") +/** + * Disponibilização do Tipo de Evento + */ +tipoDisponibilizacao?: ("DisponibilizacaoDeCreditos" | "DisponibilizacaoDeProdutos" | "Todos") +/** + * Permissão para remoção automática de produtos + */ +permitirRemocaoAutomaticaProdutos?: boolean +/** + * Cor em hexadecimal para o titulo de informações + */ +corHexTituloInformacoes?: string +/** + * Cor em hexadecimal para o corpo de informações + */ +corHexCorpoInformacoes?: string +/** + * Número de abas de informações, podendo ser de 1 a 2 + */ +numeroAbasInformacoes?: number +/** + * Quantidade de dias para que o evento expire + */ +quantidadeDiasParaEventoExpirar?: number +/** + * Quantidade de locais do evento + */ +numeroLocaisEvento?: number +/** + * Informa se o evento está ativo ou inativo + */ +ativo?: boolean +/** + * Informa a disponibilidade do evento + */ +disponivel?: boolean +/** + * O beneficiário do frete + */ +tipoBeneficiarioFrete?: ("DonodaLista" | "Convidado") +/** + * Imagem da logo do evento em base64 + */ +imagemLogoEvento?: string +/** + * Produtos Sugeridos para este evento (optional) + */ +sugestaoProdutos?: { +/** + * Id do tipo de evento + */ +tipoEventoId?: number +/** + * Identificador do produto variante + */ +produtoVarianteId?: number +}[] +} +} +/** + * Lista de preços e estoque de produtos que sofreram alterações + */ +"GET /produtos/alteracoes": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Retorna apenas os produtos que sofreram alguma alteração a partir da data/hora informada. Formato: aaaa-mm-dd hh:mm:ss com no máximo 48 horas de antecedência + */ +alteradosPartirDe?: string +} +response: { +produtoId?: number +produtoVarianteId?: number +sku?: string +precoDe?: number +precoPor?: number +disponivel?: boolean +valido?: boolean +exibirSite?: boolean +estoque?: { +estoqueFisico?: number +estoqueReservado?: number +centroDistribuicaoId?: number +alertaEstoque?: number +}[] +tabelasPreco?: { +tabelaPrecoId?: number +nome?: string +precoDe?: number +precoPor?: number +}[] +}[] +} +/** + * Retorna a situação reseller de um produto + */ +"GET /produtos/:identificador/situacaoReseller": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +} +/** + * Lista de atributos + */ +"GET /atributos": { +response: { +nome?: string +tipo?: string +tipoExibicao?: string +prioridade?: number +}[] +} +/** + * Insere um novo atributo + */ +"POST /atributos": { +body: { +/** + * Nome do atributo (optional) + */ +nome?: string +/** + * Tipo do atributo (optional) + */ +tipo?: ("Selecao" | "Filtro" | "Comparacao" | "Configuracao" | "ExclusivoGoogle") +/** + * Tipo de exibição (optional) + */ +tipoExibicao?: ("Combo" | "Div" | "DivComCor" | "DivComFotoDoProdutoVariante" | "Javascript") +/** + * Prioridade do atributo (optional) + */ +prioridade?: number +} +} +/** + * Inscrição + */ +"GET /webhook/inscricao/:inscricaoId": { +response: { +inscricaoId?: number +nome?: string +appUrl?: string +ativo?: boolean +emailResponsavel?: string +topico?: string[] +usuario?: string +header?: { +headerId?: number +chave?: string +valor?: string +}[] +} +} +/** + * Atualiza uma inscrição + */ +"PUT /webhook/inscricao/:inscricaoId": { +body: { +/** + * Nome da inscrição + */ +nome?: string +/** + * Url para qual deve ser enviada as notificações + */ +appUrl?: string +/** + * Tópicos em que deseja se inscrever + */ +topicos: string[] +/** + * Usuário que está realizando a inscrição + */ +usuario?: string +/** + * Status da inscrição, se ativada ou desativada + */ +ativo?: boolean +/** + * E-mail do responsável para notificá-lo quando não seja possível notificá-lo pelo AppUrl informado + */ +emailResponsavel?: string +/** + * Headers que devam ser adicionados ao realizar a requisição para o AppUrl. Headers de Conteúdo como 'ContentType' não são necessário. As requisições realizada sempre serão no formato 'application/json' (optional) + */ +headers?: { +/** + * Chave do header, por exemplo: 'Authorization' + */ +chave?: string +/** + * Valor / Conteúdo do header, por exemplo: 'Basic 0G3EQWD-W324F-234SD-2421OFSD' + */ +valor?: string +}[] +} +} +/** + * Produtos de uma assinatura + */ +"GET /assinaturas/:assinaturaId/produtos": { +response: { +assinaturaProdutoId?: number +assinaturaId?: number +produtoId?: number +produtoVarianteId?: number +quantidade?: number +valor?: number +removido?: boolean +}[] +} +/** + * Insere um novo produto na assinatura + */ +"POST /assinaturas/:assinaturaId/produtos": { +body: { +/** + * Produto Variante que será incluído na assinatura + */ +produtoVarianteId?: number +/** + * Quantidade do produto que será inserido na assinatura + */ +quantidade?: number +} +} +/** + * Categoria encontrada + */ +"GET /categorias/:id": { +searchParams: { +/** + * Hierarquia da categoria + */ +hierarquia?: boolean +/** + * Se será apresentado somente categorias filhas + */ +somenteFilhos?: boolean +} +response: { +id?: number +nome?: string +categoriaPaiId?: number +categoriaERPId?: string +ativo?: boolean +isReseller?: boolean +exibirMatrizAtributos?: string +quantidadeMaximaCompraUnidade?: number +valorMinimoCompra?: number +exibeMenu?: boolean +urlHotSite?: string +} +} +/** + * Atualiza uma categoria + */ +"PUT /categorias/:id": { +body: { +/** + * Nome da categoria (optional) + */ +nome?: string +/** + * Id da categoria pai (optional) + */ +categoriaPaiId?: number +/** + * Id da categoria ERP (optional) + */ +categoriaERPId?: string +/** + * Categoria ativo/inativo (optional) + */ +ativo?: boolean +/** + * Categoria de reseller (optional) + */ +isReseller?: boolean +/** + * Exibir Matriz de Atributos (optional) + */ +exibirMatrizAtributos?: ("Sim" | "Nao" | "Neutro") +/** + * Informe a quantidade máxima permitida para compra por produtos desta categoria. Informe zero para assumir a configuração geral da loja (optional) + */ +quantidadeMaximaCompraUnidade?: number +/** + * Informe o valor mínimo para compra em produtos desta categoria (optional) + */ +valorMinimoCompra?: number +/** + * Informe se será exibida no menu (optional) + */ +exibeMenu?: boolean +} +} +/** + * Exclui uma categoria + */ +"DELETE /categorias/:id": { + +} +/** + * Retorna todos os identificadores dos produtos/variantes relacionados ao produto pesquisado + */ +"GET /produtos/:identificador/relacionados": { +searchParams: { +/** + * Define se o identificador informado é um Sku, um ProdutoId (Agrupador de variantes) ou um ProdutoVarianteId + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +response: { +produtoId?: number +parentId?: number +produtoVarianteId?: number +sku?: string +}[] +} +/** + * Atualiza um valor pré definido pelo id + */ +"PUT /usuarios/valoresdefinidoscadastropersonalizado/:valoresDefinidosCampoGrupoInformacaoId": { +body: { +/** + * Valor para o campo (optional) + */ +valor?: string +/** + * Ordem (optional) + */ +ordem?: number +} +} +/** + * Remove um valor pré definido + */ +"DELETE /usuarios/valoresdefinidoscadastropersonalizado/:valoresDefinidosCampoGrupoInformacaoId": { + +} +/** + * Lista de banners + */ +"GET /banners": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadePorPagina?: number +} +response: { +id?: number +nome?: string +dataInicio?: string +dataFim?: string +ativo?: boolean +detalhe?: { +posicionamentoId?: number +urlBanner?: string +imagemBanner?: { +nome?: string +base64?: string +formato?: string +} +ordemExibicao?: number +abrirBannerNovaAba?: boolean +largura?: number +altura?: number +title?: string +urlClique?: string +urlBannerAlternativo?: string +titleAlternativo?: string +diasExibicao?: { +todosDias?: boolean +domingo?: boolean +segunda?: boolean +terca?: boolean +quarta?: boolean +quinta?: boolean +sexta?: boolean +sabado?: boolean +} +textoAlternativo?: string +} +apresentacao?: { +exibirNoSite?: boolean +exibirEmTodasBuscas?: boolean +naoExibirEmBuscas?: boolean +termosBusca?: string +listaHotsites?: { +exibirEmTodosHotSites?: boolean +hotSites?: { +hotSiteId?: number +}[] +} +exibirEmTodasCategorias?: boolean +listaParceiros?: { +exibirEmTodosParceiros?: boolean +parceiros?: { +parceiroId?: number +}[] +} +} +}[] +} +/** + * Insere um novo banner + */ +"POST /banners": { +body: { +/** + * Nome do banner + */ +nome?: string +/** + * Data de inicio de exibição do banner + */ +dataInicio?: string +/** + * Data de termino de exibição do banner (optional) + */ +dataFim?: string +/** + * Banner ativo/inativo (optional) + */ +ativo?: boolean +/** + * Detalhes do banner + */ +detalhe?: { +/** + * Local de posicionamento do banner + */ +posicionamentoId?: number +/** + * Imagem do banner (caso o campo "UrlBanner" estiver preenchido esse campo será desconsiderado) (optional) + */ +imagemBanner?: { +/** + * string da imagem em base 64 + */ +base64?: string +/** + * formato da imagem + */ +formato?: ("PNG" | "JPG" | "JPEG") +/** + * nome da imagem + */ +nome?: string +} +/** + * Url de onde o banner deve ser carregado (Ex.: http://www.site.com.br/banner.swf). O Banner poderá ser do tipo flash ou imagem (optional) + */ +urlBanner?: string +/** + * Ordem de exibição do banner (optional) + */ +ordemExibicao?: number +/** + * Se o banner deve ou não abrir em nova aba (optional) + */ +abrirLinkNovaAba?: boolean +/** + * Largura do banner em pixels (optional) + */ +largura?: number +/** + * Altura do banner em pixels (optional) + */ +altura?: number +/** + * Title da imagem do banner (optional) + */ +title?: string +/** + * Url de destino para quando o usuário clicar no Banner (optional) + */ +urlClique?: string +/** + * URL para um Banner alternativo que será exibido caso ocorra algum problema para exibição do Banner (optional) + */ +urlBannerAlternativo?: string +/** + * Title alternativo que será exibido caso ocorra algum problema para a exibição do Banner + */ +textoAlternativo?: string +} +/** + * Dias da semana que o banner deverá ser exibido (optional) + */ +diasExibicao?: { +/** + * Se o banner deverá ser exibido todos os dias (caso esse campo estiver preenchido como "true" os demais serão desconsiderados) + */ +todosDias?: boolean +/** + * Se o banner deverá ser apresentado no domingo + */ +domingo?: boolean +/** + * Se o banner deverá ser apresentado na segunda + */ +segunda?: boolean +/** + * Se o banner deverá ser apresentado na terça + */ +terca?: boolean +/** + * Se o banner deverá ser apresentado na quarta + */ +quarta?: boolean +/** + * Se o banner deverá ser apresentado na quinta + */ +quinta?: boolean +/** + * Se o banner deverá ser apresentado na sexta + */ +sexta?: boolean +/** + * Se o banner deverá ser apresentado no sábado + */ +sabado?: boolean +} +/** + * Detalhes de apresentação do banner (optional) + */ +apresentacao?: { +/** + * Se o banner deverá ser exibido em todo o site + */ +exibirNoSite?: boolean +/** + * Se o banner deverá ser exibido em todas as buscas + */ +exibirEmTodasBuscas?: boolean +/** + * Se o banner não deverá ser exibido em nenhuma busca (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) + */ +naoExibirEmBuscas?: boolean +/** + * Termos que o banner será exibido na busca + */ +termosBusca?: string +/** + * Se o banner deverá ser exibido em todas categorias (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) + */ +exibirEmTodasCategorias?: boolean +/** + * Em quais hotsites o banner deve ser exibido + */ +listaHotsites?: { +/** + * Se o banner deverá ser exibido em todos as hotsite's (Caso esse campo estiver como "true" o campo HotSites será desconsiderado) (optional) + */ +exibirEmTodosHotsites?: boolean +/** + * Lista de hotsite's que o banner será exibido + */ +hotsites?: { +/** + * Id do hotsite (optional) + */ +hotSiteId?: number +}[] +} +} +/** + * Em quais parceiros o banner deve ser exibido + */ +listaParceiros?: { +/** + * Se o banner deverá ser exibido em todos parceiros (Caso esse campo estiver como "true" o campo TermosBusca será desconsiderado) (optional) + */ +exibirEmTodosParceiros?: boolean +/** + * Lista de parceiros que o banner será exibido + */ +parceiros?: { +/** + * Id do parceiro (optional) + */ +parceiroId?: number +}[] +} +} +} +/** + * Avatar do usuário encontrado + */ +"GET /usuarios/:email/avatar": { +response: { +urlAvatar?: string +} +} +/** + * Insere um novo avatar para o usuário + */ +"POST /usuarios/:email/avatar": { +body: { +/** + * Imagem do avatar em base64 (optional) + */ +base64?: string +/** + * Formato da imagem (optional) + */ +formato?: string +} +response: { +urlAvatar?: string +} +} +/** + * Deleta um avatar de um usuário + */ +"DELETE /usuarios/:email/avatar": { + +} +/** + * Fabricante encontrado + */ +"GET /fabricantes/:fabricanteId": { +response: { +fabricanteId?: number +ativo?: boolean +nome?: string +urlLogoTipo?: string +urlLink?: string +urlCarrossel?: string +} +} +/** + * Atualiza um fabricante + */ +"PUT /fabricantes/:fabricanteId": { +body: { +/** + * Nome do fabricante (optional) + */ +nome?: string +/** + * URL tipo logo (optional) + */ +urlLogoTipo?: string +/** + * Insira neste campo uma URL para redirecionamento. A URL deve ser inserida por completa (optional) + */ +urlLink?: string +/** + * Insira nesse campo a URL do Carrossel da Marca (optional) + */ +urlCarrossel?: string +} +} +/** + * Exclui um fabricante + */ +"DELETE /fabricantes/:fabricanteId": { + +} +/** + * Lista de posicionamentos do banner + */ +"GET /banners/posicionamentos": { +response: { +posicionamentoId?: number +descricao?: string +}[] +} +/** + * Preços do produto variante informado + */ +"GET /produtos/:identificador/precos": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +response: { +produtoVarianteId?: number +sku?: string +precoDe?: number +precoPor?: number +fatorMultiplicadorPreco?: number +precosTabelaPreco?: { +produtoVarianteId?: number +tabelaPrecoId?: number +nome?: string +precoDe?: number +precoPor?: number +}[] +} +} +/** + * Atualiza a autonomia de um Seller + */ +"PUT /resellers/:resellerId/autonomia": { +body: { +/** + * Status da autonomia do seller + */ +ativo?: boolean +} +} +/** + * Lista de produtos variantes vinculados aos tipo de evento + */ +"GET /eventos/:eventoId/produtos": { +response: { +eventoId?: number +produtoVarianteId?: number +recebidoForaLista?: boolean +removido?: boolean +}[] +} +/** + * Vincula um ou mais produtos a um evento sem remover os produtos vinculados anteriormente + */ +"POST /eventos/:eventoId/produtos": { +body: { +/** + * Identificadores dos produtos variantes a serem vinculados ao evento desejado + */ +produtosVariante?: { +/** + * Identificador do produto variante + */ +produtoVarianteId?: number +}[] +} +} +/** + * Atualiza lista de produtos vinculados a um evento removendo os itens vinculados anteriormente e mantendo apenas os enviados pelo request + */ +"PUT /eventos/:eventoId/produtos": { +body: { +/** + * Identificadores dos produtos variantes a serem vinculados ao evento desejado + */ +produtosVariante?: { +/** + * Identificador do produto variante + */ +produtoVarianteId?: number +}[] +} +} +/** + * Atualiza o status do hotsite, sendo ativo (true) ou inativo (false) + */ +"PUT /hotsites/:hotsiteId/status": { +body: { +/** + * Status para qual o hotsite indicado deve ir + */ +ativo?: boolean +} +} +/** + * Autenticação realizada com sucesso + */ +"POST /autenticacao/login": { +body: { +/** + * Login do usuário (optional) + */ +login?: string +/** + * Senha do usuário (optional) + */ +senha?: string +} +} +/** + * Parceiro encontrado + */ +"GET /parceiros/:nome": { +response: { +parceiroId?: number +marketPlaceId?: number +nome?: string +tabelaPrecoId?: number +portfolioId?: number +tipoEscopo?: string +ativo?: boolean +isMarketPlace?: boolean +origem?: string +} +} +/** + * Seta status do produto variante como ativo ou inativo + */ +"PUT /produtos/:identificador/situacao": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Define se o produto variante informado será ativo ou inativo + */ +status?: boolean +} +} +/** + * Lista de Grupos de Personalização + */ +"GET /grupospersonalizacao": { +response: { +grupoPersonalizacaoId?: number +nome?: string +ativo?: boolean +obrigatorio?: boolean +}[] +} +/** + * Retorna o saldo de um usuário + */ +"GET /contascorrentes/:email": { + +} +/** + * Realiza um novo lançamento na conta corrente do cliente + */ +"POST /contascorrentes/:email": { +body: { +/** + * Valor da conta corrente (optional) + */ +valor?: number +/** + * Tipo de Lançamento (optional) + */ +tipoLancamento?: ("Credito" | "Debito") +/** + * Observação (optional) + */ +observacao?: string +/** + * Se será visível para o cliente (optional) + */ +visivelParaCliente?: boolean +} +} +/** + * Lista de produtos + */ +"GET /resellers/produtos/:identificador": { +searchParams: { +/** + * Define se o identificador informado é um id interno da fstore ou a Razão social do Reseller + */ +tipoIdentificador?: ("ResellerId" | "RazaoSocial") +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Se deve retornar apenas produtos válidos (padrão: false) + */ +somenteValidos?: boolean +/** + * Campos adicionais que se selecionados retornaram junto com o produto: Atacado, Estoque, Atributo, Informacao, TabelaPreo + */ +camposAdicionais?: string[] +} +response: { +produtoVarianteId?: number +produtoId?: number +idPaiExterno?: string +idVinculoExterno?: string +sku?: string +nome?: string +nomeProdutoPai?: string +urlProduto?: string +exibirMatrizAtributos?: string +contraProposta?: boolean +fabricante?: string +autor?: string +editora?: string +colecao?: string +genero?: string +precoCusto?: number +precoDe?: number +precoPor?: number +fatorMultiplicadorPreco?: number +prazoEntrega?: number +valido?: boolean +exibirSite?: boolean +freteGratis?: string +trocaGratis?: boolean +peso?: number +altura?: number +comprimento?: number +largura?: number +garantia?: number +isTelevendas?: boolean +ean?: string +localizacaoEstoque?: string +listaAtacado?: { +precoPor?: number +quantidade?: number +}[] +estoque?: { +estoqueFisico?: number +estoqueReservado?: number +centroDistribuicaoId?: number +alertaEstoque?: number +}[] +atributos?: { +tipoAtributo?: string +isFiltro?: boolean +nome?: string +valor?: string +exibir?: boolean +}[] +quantidadeMaximaCompraUnidade?: number +quantidadeMinimaCompraUnidade?: number +condicao?: string +informacoes?: { +informacaoId?: number +titulo?: string +texto?: string +tipoInformacao?: string +}[] +tabelasPreco?: { +tabelaPrecoId?: number +nome?: string +precoDe?: number +precoPor?: number +}[] +dataCriacao?: string +dataAtualizacao?: string +urlVideo?: string +spot?: boolean +paginaProduto?: boolean +marketplace?: boolean +somenteParceiros?: boolean +reseller?: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +} +buyBox?: boolean +}[] +} +/** + * Lista de pedidos + */ +"GET /pedidos/formaPagamento/:formasPagamento": { +searchParams: { +/** + * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final dos pedidos que deverão retonar (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +/** + * Tipo de filtro da data (Ordenação "desc" - padrão: DataPedido) + */ +enumTipoFiltroData?: ("DataPedido" | "DataAprovacao" | "DataModificacaoStatus" | "DataAlteracao" | "DataCriacao") +/** + * Lista de situações que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as situações + */ +situacoesPedido?: string +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +} +response: { +pedidoId?: number +situacaoPedidoId?: number +tipoRastreamentoPedido?: string +transacaoId?: number +data?: string +dataPagamento?: string +dataUltimaAtualizacao?: string +valorFrete?: number +valorTotalPedido?: number +valorDesconto?: number +valorDebitoCC?: number +cupomDesconto?: string +marketPlacePedidoId?: string +marketPlacePedidoSiteId?: string +canalId?: number +canalNome?: string +canalOrigem?: string +retiradaLojaId?: number +isPedidoEvento?: boolean +usuario?: { +usuarioId?: number +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +} +pedidoEndereco?: { +tipo?: string +nome?: string +endereco?: string +numero?: string +complemento?: string +referencia?: string +cep?: string +tipoLogradouro?: string +logradouro?: string +bairro?: string +cidade?: string +estado?: string +pais?: string +}[] +frete?: { +freteContratoId?: number +freteContrato?: string +referenciaConector?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +retiradaLojaId?: number +centrosDistribuicao?: { +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +servico?: { +servicoId?: number +nome?: string +transportadora?: string +prazo?: number +servicoNome?: string +preco?: number +servicoTransporte?: number +codigo?: number +servicoMeta?: string +custo?: number +token?: string +} +retiradaAgendada?: { +lojaId?: number +retiradaData?: string +retiradaPeriodo?: string +nome?: string +documento?: string +codigoRetirada?: string +} +agendamento?: { +de?: string +ate?: string +} +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +} +itens?: { +produtoVarianteId?: number +sku?: string +nome?: string +quantidade?: number +precoCusto?: number +precoVenda?: number +isBrinde?: boolean +valorAliquota?: number +isMarketPlace?: boolean +precoPor?: number +desconto?: number +totais?: { +precoCusto?: number +precoVenda?: number +precoPor?: number +desconto?: number +} +ajustes?: { +tipo?: string +valor?: number +observacao?: string +nome?: string +}[] +centroDistribuicao?: { +centroDistribuicaoId?: number +quantidade?: number +situacaoProdutoId?: number +valorFreteEmpresa?: number +valorFreteCliente?: number +}[] +valoresAdicionais?: { +tipo?: string +origem?: string +texto?: string +valor?: number +}[] +atributos?: { +produtoVarianteAtributoValor?: string +produtoVarianteAtributoNome?: string +}[] +embalagens?: { +tipoEmbalagemId?: number +nomeTipoEmbalagem?: string +mensagem?: string +valor?: number +descricao?: string +}[] +personalizacoes?: { +nomePersonalizacao?: string +valorPersonalizacao?: string +valor?: number +}[] +frete?: { +quantidade?: number +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +dadosProdutoEvento?: { +tipoPresenteRecebimento?: string +} +formulas?: { +chaveAjuste?: string +valor?: number +nome?: string +expressao?: string +expressaoInterpretada?: string +endPoint?: string +}[] +seller?: { +sellerId?: number +sellerNome?: string +sellerPedidoId?: number +} +}[] +assinatura?: { +assinaturaId?: number +grupoAssinaturaId?: number +tipoPeriodo?: string +tempoPeriodo?: number +percentualDesconto?: number +}[] +pagamento?: { +formaPagamentoId?: number +numeroParcelas?: number +valorParcela?: number +valorDesconto?: number +valorJuros?: number +valorTotal?: number +boleto?: { +urlBoleto?: string +codigoDeBarras?: string +} +cartaoCredito?: { +numeroCartao?: string +nomeTitular?: string +dataValidade?: string +codigoSeguranca?: string +documentoCartaoCredito?: string +token?: string +info?: string +bandeira?: string +}[] +pagamentoStatus?: { +numeroAutorizacao?: string +numeroComprovanteVenda?: string +dataAtualizacao?: string +dataUltimoStatus?: string +adquirente?: string +tid?: string +}[] +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +}[] +observacao?: { +observacao?: string +usuario?: string +data?: string +publica?: boolean +}[] +valorCreditoFidelidade?: number +valido?: boolean +valorSubTotalSemDescontos?: number +pedidoSplit?: number[] +}[] +} +/** + * Lista de pedidos + */ +"GET /pedidos": { +searchParams: { +/** + * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final dos pedidos que deverão retonar (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +/** + * Tipo de filtro da data (Ordenação "desc" - padrão: DataPedido) + */ +enumTipoFiltroData?: ("DataPedido" | "DataAprovacao" | "DataModificacaoStatus" | "DataAlteracao" | "DataCriacao") +/** + * Lista de situações que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as situações + */ +situacoesPedido?: string +/** + * Lista de formas de pagamento que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as formas de pagamento + */ +formasPagamento?: string +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Deverá retornar apenas pedidos realizados pelo usuário com o e-mail passado + */ +email?: string +/** + * Deverá retornar apenas pedidos válidos, inválidos ou todos (caso não seja informado) + */ +valido?: boolean +/** + * Deverá retornar apenas pedidos que o produto de determinado sku foi comprado + */ +sku?: string +/** + * Quando passado o valor true, deverá retornar apenas pedidos de assinatura. Quando falso, deverá retornar todos os pedidos. + */ +apenasAssinaturas?: boolean +} +response: { +pedidoId?: number +situacaoPedidoId?: number +tipoRastreamentoPedido?: string +transacaoId?: number +data?: string +dataPagamento?: string +dataUltimaAtualizacao?: string +valorFrete?: number +valorTotalPedido?: number +valorDesconto?: number +valorDebitoCC?: number +cupomDesconto?: string +marketPlacePedidoId?: string +marketPlacePedidoSiteId?: string +canalId?: number +canalNome?: string +canalOrigem?: string +retiradaLojaId?: number +isPedidoEvento?: boolean +usuario?: { +usuarioId?: number +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +} +pedidoEndereco?: { +tipo?: string +nome?: string +endereco?: string +numero?: string +complemento?: string +referencia?: string +cep?: string +tipoLogradouro?: string +logradouro?: string +bairro?: string +cidade?: string +estado?: string +pais?: string +}[] +frete?: { +freteContratoId?: number +freteContrato?: string +referenciaConector?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +retiradaLojaId?: number +centrosDistribuicao?: { +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +servico?: { +servicoId?: number +nome?: string +transportadora?: string +prazo?: number +servicoNome?: string +preco?: number +servicoTransporte?: number +codigo?: number +servicoMeta?: string +custo?: number +token?: string +} +retiradaAgendada?: { +lojaId?: number +retiradaData?: string +retiradaPeriodo?: string +nome?: string +documento?: string +codigoRetirada?: string +} +agendamento?: { +de?: string +ate?: string +} +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +} +itens?: { +produtoVarianteId?: number +sku?: string +nome?: string +quantidade?: number +precoCusto?: number +precoVenda?: number +isBrinde?: boolean +valorAliquota?: number +isMarketPlace?: boolean +precoPor?: number +desconto?: number +totais?: { +precoCusto?: number +precoVenda?: number +precoPor?: number +desconto?: number +} +ajustes?: { +tipo?: string +valor?: number +observacao?: string +nome?: string +}[] +centroDistribuicao?: { +centroDistribuicaoId?: number +quantidade?: number +situacaoProdutoId?: number +valorFreteEmpresa?: number +valorFreteCliente?: number +}[] +valoresAdicionais?: { +tipo?: string +origem?: string +texto?: string +valor?: number +}[] +atributos?: { +produtoVarianteAtributoValor?: string +produtoVarianteAtributoNome?: string +}[] +embalagens?: { +tipoEmbalagemId?: number +nomeTipoEmbalagem?: string +mensagem?: string +valor?: number +descricao?: string +}[] +personalizacoes?: { +nomePersonalizacao?: string +valorPersonalizacao?: string +valor?: number +}[] +frete?: { +quantidade?: number +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +dadosProdutoEvento?: { +tipoPresenteRecebimento?: string +} +formulas?: { +chaveAjuste?: string +valor?: number +nome?: string +expressao?: string +expressaoInterpretada?: string +endPoint?: string +}[] +seller?: { +sellerId?: number +sellerNome?: string +sellerPedidoId?: number +} +}[] +assinatura?: { +assinaturaId?: number +grupoAssinaturaId?: number +tipoPeriodo?: string +tempoPeriodo?: number +percentualDesconto?: number +}[] +pagamento?: { +formaPagamentoId?: number +numeroParcelas?: number +valorParcela?: number +valorDesconto?: number +valorJuros?: number +valorTotal?: number +boleto?: { +urlBoleto?: string +codigoDeBarras?: string +} +cartaoCredito?: { +numeroCartao?: string +nomeTitular?: string +dataValidade?: string +codigoSeguranca?: string +documentoCartaoCredito?: string +token?: string +info?: string +bandeira?: string +}[] +pagamentoStatus?: { +numeroAutorizacao?: string +numeroComprovanteVenda?: string +dataAtualizacao?: string +dataUltimoStatus?: string +adquirente?: string +tid?: string +}[] +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +}[] +observacao?: { +observacao?: string +usuario?: string +data?: string +publica?: boolean +}[] +valorCreditoFidelidade?: number +valido?: boolean +valorSubTotalSemDescontos?: number +pedidoSplit?: number[] +}[] +} +/** + * Caso a loja utilize as formas de pagamento do gateway o campo "formaPagamentoId" do objeto "pagamento" deverá conter o valor "200". + */ +"POST /pedidos": { +body: { +/** + * Id do pedido que está sendo inserido. Caso seja informado deve ser um Id disponível na loja. Caso não seja informado um Id será gerado (optional) + */ +pedidoId?: number +/** + * Id do carrinho que foi utilizado no pedido (optional) + */ +carrinhoId?: string +/** + * Define em qual situação está o pedido. A lista completa das possíveis situações se encontra no GET /situacoesPedido + */ +situacaoPedidoId?: number +/** + * Data em que o pedido foi realizado + */ +data?: string +/** + * Valor total do pedido. Se informado deve ser igual a soma de todos os valores inclusos no pedido (preços dos produtos, ajustes, frete, etc) (optional) + */ +valorTotal?: number +/** + * Informação do juros do pedido + */ +valorJuros?: number +/** + * Informação de desconto do pedido + */ +valorDesconto?: number +/** + * Id do usuário que realizou a compra. É possível recuperar o Id de um usuário no GET /usuarios + */ +usuarioId?: number +/** + * Id do endereço do usuário que deve ser utilizado como endereço de entrega. Para buscar os endereços de um usuário utilize o GET /usuarios/{usuarioId}/enderecos + */ +enderecoId?: number +/** + * Define se o pedido foi feito através de um dispositivo móvel ou não + */ +isMobile?: boolean +/** + * Id do evento ao qual o pedido está vinculado (opcional) + */ +eventoId?: number +/** + * Lista contendo os produtos do pedido + */ +produtos?: { +/** + * Id do produto variante que está vinculado a esse pedido. + */ +produtoVarianteId?: number +/** + * Define a quantidade do produto, podendo ser dividida por diferentes centros de distribuição + */ +quantidade?: { +/** + * Quantidade por centro de distribuição + */ +quantidadeTotal?: number +/** + * Quantidade (optional) + */ +quantidadePorCentroDeDistribuicao?: { +/** + * Id do centro de distribuição + */ +centroDistribuicaoId?: number +/** + * Quantidade + */ +quantidade?: number +}[] +} +/** + * Preço de venda do produto, sem adição ou subtração de valores. + */ +precoVenda?: number +/** + * Define se esse produto é um brinde ou não + */ +isBrinde?: boolean +/** + * Lista contendo todos os ajustes de preço do produto + */ +ajustes?: { +/** + * Define o tipo do ajuste de valor de um produto contido em um pedido. = ['Frete', 'Pricing', 'Atacarejo', 'Personalizacao', 'Embalagem', 'Promocao', 'PromocaoFrete', 'ContaCorrente', 'FormaPagamento', 'PromocaoProduto', 'TipoFreteProduto', 'Formula']stringEnum:"Frete", "Pricing", "Atacarejo", "Personalizacao", "Embalagem", "Promocao", "PromocaoFrete", "ContaCorrente", "FormaPagamento", "PromocaoProduto", "TipoFreteProduto", "Formula" + */ +tipo?: string +/** + * Define o valor do ajuste a ser aplicado no produto. O valor pode ser positivo ou negativo + */ +valor?: number +/** + * Observação (optional) + */ +observacao?: string +/** + * Nome (optional) + */ +nome?: string +}[] +}[] +/** + * Informações de frete do pedido + */ +fretes?: { +/** + * Identificador do centro de distribuição de origem + */ +centroDistribuicaoId?: number +/** + * Identificador do contrato de frete (optional) + */ +freteContratoId?: number +/** + * Peso em gramas (g) do frete calculado (optional) + */ +peso?: number +/** + * Peso em gramas cobrado do cliente (optional) + */ +pesoCobrado?: number +/** + * Volume em metro cúbico (m³) calculado (optional) + */ +volume?: number +/** + * Volume em metro cúbico (m³) cobrado do cliente (optional) + */ +volumeCobrado?: number +/** + * Prazo do envio do frete em dias úteis + */ +prazoEnvio?: number +/** + * Valor do frete (optional) + */ +valorFreteEmpresa?: number +/** + * Valor do frete cobrado do cliente + */ +valorFreteCliente?: number +/** + * Data estimada da entrega do produto (optional) + */ +dataEntrega?: string +/** + * Informações adicionais do frete + */ +informacoesAdicionais?: { +/** + * Chave + */ +chave?: string +/** + * Valor + */ +valor?: string +}[] +}[] +/** + * Informações de pagamento do pedido + */ +pagamento?: { +/** + * Id da forma de pagamento + */ +formaPagamentoId?: number +/** + * Número parcelas + */ +numeroParcelas?: number +/** + * Valor da parcela + */ +valorParcela?: number +/** + * Informações adicionais de pagamento (optional) + */ +informacaoAdicional?: { +/** + * Chave + */ +chave?: string +/** + * Valor + */ +valor?: string +}[] +} +/** + * ParceiroId vinculado ao pedido (optional) + */ +canalId?: number +/** + * Dados do pedido no marketplace (optional) + */ +omniChannel?: { +/** + * Id do pedido que o cliente vê no momento que fecha a compra + */ +pedidoIdPublico?: string +/** + * Id interno do marketplace + */ +pedidoIdPrivado?: string +/** + * Dados do pedido no integrador + */ +integrador?: { +/** + * Nome do parceiro integrador + */ +nome?: string +/** + * Numero do pedido dentro do integrador + */ +pedidoId?: string +/** + * Url do pedido dentro painel do integrador + */ +pedidoUrl?: string +} +} +/** + * Id da transação (optional) + */ +transacaoId?: number +/** + * Observação do pedido (optional) + */ +observacao?: string +/** + * Se um pedido é valido (optional) + */ +valido?: boolean +/** + * Cupom de desconto (optional) + */ +cupomDesconto?: string +/** + * IP da criação do pedido (optional) + */ +ip?: string +/** + * ID do usuário master que realizou o pedido, se houver (optional) + */ +usuarioMaster?: number +} +} +/** + * Lista de portfolios + */ +"GET /portfolios": { +response: { +portfolioId?: number +nome?: string +ativo?: boolean +}[] +} +/** + * Insere um novo portfolio + */ +"POST /portfolios": { +body: { +/** + * Nome do portfolio + */ +nome?: string +} +} +/** + * Lista de imagens vinculadas a um produtos + */ +"GET /produtos/:identificador/imagens": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +produtosIrmaos?: boolean +} +response: { +idImagem?: number +nomeArquivo?: string +url?: string +ordem?: number +estampa?: boolean +exibirMiniatura?: boolean +}[] +} +/** + * Adiciona uma nova imagem vinculada a um produto + */ +"POST /produtos/:identificador/imagens": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +/** + * Define o tipo de retorno a ser recebido. ListaIds retorna lista de Ids das imagens inseridas, Booleano retorna true ou false, de acordo com o resultado da operação. Valor padrão Booleano + */ +tipoRetorno?: ("ListaIds" | "Booleano") +} +body: { +/** + * Lista com as imagens do produto no formato base 64 (optional) + */ +RAW_BODY: { +/** + * Imagem do produto em base64 + */ +base64?: string +/** + * JPG ou PNG + */ +formato?: string +/** + * Se a imagem será apresentada como miniatura + */ +exibirMiniatura?: boolean +/** + * Se a imagem será apresentada como estampa + */ +estampa?: boolean +/** + * Ordem para apresentação da imagem + */ +ordem?: number +}[] +} +} +/** + * Limite de crédito de um usuário específico + */ +"GET /usuarios/limiteCreditoPorUsuarioId/:usuarioId": { +response: { +usuarioId?: number +valor?: number +saldo?: number +} +} +/** + * SEO do produto informado + */ +"GET /produtos/:identificador/seo": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +response: { +tagCanonical?: string +title?: string +metatags?: { +metatagId?: number +content?: string +httpEquiv?: string +name?: string +scheme?: string +}[] +} +} +/** + * Insere um SEO para um produto específico + */ +"POST /produtos/:identificador/seo": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +body: { +/** + * Informe a URL a ser inserida na TAG Canonical. Caso nenhum dado seja inserido, a TAG Canonical não será inserida na Página do Produto (optional) + */ +tagCanonical?: string +/** + * Informe o title da página do produto (optional) + */ +title?: string +/** + * Informe os dados da Meta Tag (optional) + */ +metaTags?: { +/** + * Dados da Meta Tag + */ +content?: string +/** + * Dados da Meta Tag + */ +httpEquiv?: string +/** + * Dados da Meta Tag + */ +name?: string +/** + * Dados da Meta Tag + */ +scheme?: string +}[] +} +} +/** + * Atualiza um SEO de um produto específico + */ +"PUT /produtos/:identificador/seo": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +body: { +/** + * Informe a URL a ser inserida na TAG Canonical. Caso nenhum dado seja inserido, a TAG Canonical não será inserida na Página do Produto (optional) + */ +tagCanonical?: string +/** + * Informe o title da página do produto (optional) + */ +title?: string +/** + * Informe os dados da Meta Tag (optional) + */ +metaTags?: { +/** + * Dados da Meta Tag + */ +content?: string +/** + * Dados da Meta Tag + */ +httpEquiv?: string +/** + * Dados da Meta Tag + */ +name?: string +/** + * Dados da Meta Tag + */ +scheme?: string +}[] +} +} +/** + * Deleta o SEO de um produto específico + */ +"DELETE /produtos/:identificador/seo": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +} +/** + * Adiciona um vínculo entre usuário e parceiro + */ +"POST /usuarios/:email/parceiro": { +body: { +/** + * Id do parceiro (optional) + */ +parceiroId?: number +/** + * Vinculo vitalício (optional) + */ +vinculoVitalicio?: boolean +/** + * Data inicial do vinculo entre usuário e parceiro (optional) + */ +dataInicial?: string +/** + * Data final do vinculo entre usuário e parceiro (optional) + */ +dataFinal?: string +} +} +/** + * Atualiza um vínculo entre usuário e parceiro + */ +"PUT /usuarios/:email/parceiro": { +body: { +/** + * Vinculo vitalício (optional) + */ +vinculoVitalicio?: boolean +/** + * Data inicial do vinculo entre usuário e parceiro (optional) + */ +dataInicial?: string +/** + * Data final do vinculo entre usuário e parceiro (optional) + */ +dataFinal?: string +} +} +/** + * Remove o vínculo entre usuário e parceiro + */ +"DELETE /usuarios/:email/parceiro": { +body: { +/** + * Número identificador do parceiro (Max Length: 4) + */ +parceiroId?: number +} +} +/** + * Retorna usuário encontrado + */ +"GET /usuarios/:email/enderecos": { +response: { +enderecoId?: number +nomeEndereco?: string +rua?: string +numero?: string +complemento?: string +referencia?: string +bairro?: string +cidade?: string +estado?: string +cep?: string +utilizadoUltimoPedido?: boolean +pais?: string +}[] +} +/** + * Insere um endereço para um usuário pelo e-mail + */ +"POST /usuarios/:email/enderecos": { +body: { +/** + * Nome de identificação do endereço a ser cadastrado (Max Length: 100) + */ +nomeEndereco?: string +/** + * Nome da rua (Max Length: 500) + */ +rua?: string +/** + * Número do local (Max Length: 50) + */ +numero?: string +/** + * Complemento (Max Length: 250) (optional) + */ +complemento?: string +/** + * Referência para a localização do endereço (Max Length: 500) (optional) + */ +referencia?: string +/** + * Bairro do endereço (Max Length: 100) + */ +bairro?: string +/** + * Cidade em que se localiza o endereço (Max Length: 100) + */ +cidade?: string +/** + * O estado (Max Length: 100) + */ +estado?: string +/** + * Código do cep (Max Length: 50) + */ +cep?: string +} +} +/** + * Atualiza um script existente + */ +"PUT /gestorscripts/scripts/:scriptId": { +body: { +/** + * Nome do script + */ +nome?: string +/** + * Data inicial do script + */ +dataInicial?: string +/** + * Data final do script + */ +dataFinal?: string +/** + * Informe se o script está ativo ou não + */ +ativo?: boolean +/** + * Prioridade do script + */ +prioridade?: number +/** + * Posição do script + */ +posicao?: ("HeaderPrimeiraLinha" | "HeaderUltimaLinha" | "BodyPrimeiraLinha" | "BodyUltimaLinha" | "FooterPrimeiraLinha" | "FooterUltimeLinha") +/** + * Tipo da página do script + */ +tipoPagina?: ("Todas" | "Home" | "Busca" | "Categoria" | "Fabricante" | "Estaticas" | "Produto" | "Carrinho") +/** + * Identificador da página + */ +identificadorPagina?: string +/** + * Conteúdo do script + */ +conteudo?: string +/** + * Status do script + */ +publicado?: boolean +} +} +/** + * Exclui um Script + */ +"DELETE /gestorscripts/scripts/:scriptId": { + +} +/** + * Ativa ou desativa um endereço de um usuário com base no id do usuário + */ +"PUT /usuarios/:usuarioId/enderecos/:enderecoId/ativar": { +body: { +/** + * Status do endereço + */ +status?: boolean +} +} +/** + * Ativa ou desativa um Seller + */ +"PUT /resellers/:resellerId/status": { +body: { +/** + * Status do seller (ativo / inativo) + */ +ativo?: boolean +} +} +/** + * Atacarejo + */ +"GET /produtos/:identificador/atacarejo/:produtoVarianteAtacadoId": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +response: { +produtoVarianteAtacadoId?: number +precoAtacado?: number +quantidade?: number +} +} +/** + * Atualiza um Atacarejo + */ +"PUT /produtos/:identificador/atacarejo/:produtoVarianteAtacadoId": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Preço atacado (optional) + */ +precoAtacado?: number +/** + * Quantidade do produto (optional) + */ +quantidade?: number +} +} +/** + * Remove um Atacarejo + */ +"DELETE /produtos/:identificador/atacarejo/:produtoVarianteAtacadoId": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +} +/** + * Buscar todos os autores + */ +"GET /autores": { + +} +/** + * Inserir autor + */ +"POST /autores": { +body: { +/** + * Nome do Autor + */ +nome?: string +/** + * Status do autor + */ +ativo?: boolean +} +} +/** + * Lista dos estados + */ +"GET /lojasFisicas/estados": { +response: { +estadoId?: number +nome?: string +sigla?: string +regiao?: string +}[] +} +/** + * Método responsável por retornar um produto específico buscando pelo seu identificador, que pode ser um sku ou produto variante. O tipo do identificador pode ser definido no campo tipoIdentificador. Também é possível informar quais informações adicionais devem ser retornadas na consulta utilizando o campo campos adicionais. + */ +"GET /produtos/:identificador": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId" | "ProdutoId") +/** + * Campo opcional que define quais dados extras devem ser retornados em conjunto com os dados básicos do produto, valores aceitos: Atacado, Estoque, Atributo , Informacao, TabelaPreco + */ +camposAdicionais?: string[] +} +response: { +produtoVarianteId?: number +produtoId?: number +idPaiExterno?: string +idVinculoExterno?: string +sku?: string +nome?: string +nomeProdutoPai?: string +urlProduto?: string +exibirMatrizAtributos?: string +contraProposta?: boolean +fabricante?: string +autor?: string +editora?: string +colecao?: string +genero?: string +precoCusto?: number +precoDe?: number +precoPor?: number +fatorMultiplicadorPreco?: number +prazoEntrega?: number +valido?: boolean +exibirSite?: boolean +freteGratis?: string +trocaGratis?: boolean +peso?: number +altura?: number +comprimento?: number +largura?: number +garantia?: number +isTelevendas?: boolean +ean?: string +localizacaoEstoque?: string +listaAtacado?: { +precoPor?: number +quantidade?: number +}[] +estoque?: { +estoqueFisico?: number +estoqueReservado?: number +centroDistribuicaoId?: number +alertaEstoque?: number +}[] +atributos?: { +tipoAtributo?: string +isFiltro?: boolean +nome?: string +valor?: string +exibir?: boolean +}[] +quantidadeMaximaCompraUnidade?: number +quantidadeMinimaCompraUnidade?: number +condicao?: string +informacoes?: { +informacaoId?: number +titulo?: string +texto?: string +tipoInformacao?: string +}[] +tabelasPreco?: { +tabelaPrecoId?: number +nome?: string +precoDe?: number +precoPor?: number +}[] +dataCriacao?: string +dataAtualizacao?: string +urlVideo?: string +spot?: boolean +paginaProduto?: boolean +marketplace?: boolean +somenteParceiros?: boolean +reseller?: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +} +buyBox?: boolean +consumo?: { +quantidadeDias?: number +enviarEmail?: boolean +} +prazoValidade?: number +} +} +/** + * Atualiza um produto com base nos dados enviados + */ +"PUT /produtos/:identificador": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Representa o ProdutoId agrupador por variante (optional) + */ +idPaiExterno?: string +/** + * Representa o ParentId agrupador por parent (optional) + */ +idVinculoExterno?: string +/** + * (Max Length: 50) Sku do produto + */ +sku?: string +/** + * (Max Length: 300) Nome do produto variante + */ +nome?: string +/** + * Nome do produto (pai do variante) (optional) + */ +nomeProdutoPai?: string +/** + * Tipo de exibição da matriz de atributos (optional) + */ +exibirMatrizAtributos?: ("Sim" | "Nao" | "Neutro") +/** + * Se o produto aceita contra proposta (optional) + */ +contraProposta?: boolean +/** + * (Max Length: 100) Nome do fabricante + */ +fabricante?: string +/** + * (Max Length: 500) Nome do autor (optional) + */ +autor?: string +/** + * (Max Length: 100) Nome da editora (optional) + */ +editora?: string +/** + * (Max Length: 100) Nome da coleção (optional) + */ +colecao?: string +/** + * (Max Length: 100) Nome do gênero (optional) + */ +genero?: string +/** + * Max Length: 8, "0000.0000,00") Preço de custo do produto variante (optional) + */ +precoCusto?: number +/** + * (Max Length: 8, "0000.0000,00") "Preço De" do produto variante (optional) + */ +precoDe?: number +/** + * (Max Length: 8, "0000.0000,00") "Preço Por" de venda do produto variante + */ +precoPor?: number +/** + * (Max Length: 8, "0000.0000,00") Fator multiplicador que gera o preço de exibição do produto.Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) (optional) + */ +fatorMultiplicadorPreco?: number +/** + * Prazo de entrega do produto variante (optional) + */ +prazoEntrega?: number +/** + * Define se um produto variante é valido ou não (optional) + */ +valido?: boolean +/** + * Define se um produto deve ser exibido no site (optional) + */ +exibirSite?: boolean +/** + * Define a qual regra de calculo de frete o produto vai pertencer + */ +freteGratis?: ("Sempre" | "Nunca" | "Neutro" | "Desconsiderar_Regras") +/** + * Define se o produto variante tem troca grátis (optional) + */ +trocaGratis?: boolean +/** + * (Max Length: 8, "0000.0000,00") Peso do produto variante, em gramas (g) + */ +peso?: number +/** + * (Max Length: 8, "0000.0000,00") Altura do produto variante, em centímetros (cm). + */ +altura?: number +/** + * (Max Length: 8, "0000.0000,00") Comprimento do produto variante, em centímetros (cm). + */ +comprimento?: number +/** + * (Max Length: 8, "0000.0000,00") Largura do produto variante, em centímetros (cm). + */ +largura?: number +/** + * Define se o produto variante tem garantia (optional) + */ +garantia?: number +/** + * Define se o produto contém televendas (optional) + */ +isTelevendas?: boolean +/** + * (Max Length: 25) EAN do produto variante (optional) + */ +ean?: string +/** + * (Max Length: 255) Localização no estoque do produto variante (optional) + */ +localizacaoEstoque?: string +/** + * Dados de atacado do produto variante (optional) + */ +listaAtacado?: { +/** + * (Max Length: 8, "0000.0000,00") - Preco Por do item por atacado + */ +precoPor?: number +/** + * Quantidade para compra de atacado + */ +quantidade?: number +}[] +/** + * Lista de estoque/centro de distribuição do produto. Obrigatório se valido for true (optional) + */ +estoque?: { +/** + * Estoque físico do produto + */ +estoqueFisico?: number +/** + * Estoque reservado do produto + */ +estoqueReservado?: number +/** + * Id do centro de distribuição do estoque do produto + */ +centroDistribuicaoId?: number +/** + * Quantidade para ativar o alerta de estoque + */ +alertaEstoque?: number +}[] +/** + * Lista de atributos do produto + */ +listaAtributos?: { +/** + * (Max Length: 100) - Define o nome do atributo + */ +nome?: string +/** + * (Max Length: 8, "0000.0000,00") - Define o valor do atributo + */ +valor?: string +/** + * Define se o atributo deverá ser exibido + */ +exibir?: boolean +}[] +/** + * Quantidade máxima de compra do produto variante (optional) + */ +quantidadeMaximaCompraUnidade?: number +/** + * Quantidade mínima de compra do produto variante (optional) + */ +quantidadeMinimaCompraUnidade?: number +/** + * Condição do produto variante (optional) + */ +condicao?: ("Novo" | "Usado" | "Renovado" | "Danificado") +/** + * Url do vídeo do Produto (optional) + */ +urlVideo?: string +/** + * Se o produto aparece no Spot (optional) + */ +spot?: boolean +/** + * Se o produto aparece na Url (optional) + */ +paginaProduto?: boolean +/** + * Se o produto aparece no Marketplace (optional) + */ +marketplace?: boolean +/** + * Se o produto aparece somente nos Parceiros + */ +somenteParceiros?: boolean +/** + * Se o produto deve ser agrupado pelo EAN (optional) + */ +buyBox?: boolean +/** + * Prazo de validade ou consumo do produto (optional) + */ +prazoValidade?: number +/** + * Dados de consumo de produto e se deve enviar os dias de consumo por e-mail (optional) + */ +consumo?: { +/** + * Quantidade de Dias (optional) + */ +quantidadeDias?: number +/** + * Enviar e-mail (optional) + */ +enviarEmail?: boolean +} +} +} +/** + * Lista de versões + */ +"GET /gestorscripts/scripts/:scriptId/versoes": { +response: { +versaoId?: number +scriptId?: number +dataCadastro?: string +identificadorPagina?: string +publicado?: boolean +usuario?: string +}[] +} +/** + * Insere uma versão para um script existente + */ +"POST /gestorscripts/scripts/:scriptId/versoes": { +body: { +/** + * Identificador da página + */ +identificadorPagina?: string +/** + * Conteúdo do script + */ +conteudo?: string +/** + * Status do script + */ +publicado?: boolean +} +} +/** + * Reseller específico + */ +"GET /resellers/token": { +response: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +} +} +/** + * Categoria encontrada + */ +"GET /categorias/erp/:id": { +searchParams: { +/** + * Hierarquia da categoria + */ +hierarquia?: boolean +/** + * Se será apresentado somente categorias filhas + */ +somenteFilhos?: boolean +} +response: { +id?: number +nome?: string +categoriaPaiId?: number +categoriaERPId?: string +ativo?: boolean +isReseller?: boolean +exibirMatrizAtributos?: string +quantidadeMaximaCompraUnidade?: number +valorMinimoCompra?: number +exibeMenu?: boolean +urlHotSite?: string +} +} +/** + * Atualiza uma categoria utilizando o id do erp como identificador + */ +"PUT /categorias/erp/:id": { +body: { +/** + * Nome da categoria (optional) + */ +nome?: string +/** + * Id da categoria pai (optional) + */ +categoriaPaiId?: number +/** + * Id da categoria ERP (optional) + */ +categoriaERPId?: string +/** + * Categoria ativo/inativo (optional) + */ +ativo?: boolean +/** + * Categoria de reseller (optional) + */ +isReseller?: boolean +/** + * Exibir Matriz de Atributos (optional) + */ +exibirMatrizAtributos?: ("Sim" | "Nao" | "Neutro") +/** + * Informe a quantidade máxima permitida para compra por produtos desta categoria. Informe zero para assumir a configuração geral da loja (optional) + */ +quantidadeMaximaCompraUnidade?: number +/** + * Informe o valor mínimo para compra em produtos desta categoria (optional) + */ +valorMinimoCompra?: number +/** + * Informe se será exibida no menu (optional) + */ +exibeMenu?: boolean +} +} +/** + * Categoria excluída com sucesso + */ +"DELETE /categorias/erp/:id": { + +} +/** + * Templates + */ +"GET /templates": { + +} +/** + * Lista de usuários + */ +"GET /usuarios": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Data inicial da data de criação do usuário que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final da data de criação do usuário que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +/** + * Tipo de filtro de data + */ +enumTipoFiltroData?: ("DataAlteracao" | "DataCriacao") +/** + * Status de aprovação + */ +aprovado?: boolean +} +response: { +usuarioId?: number +bloqueado?: boolean +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +avatar?: string +ip?: string +aprovado?: boolean +}[] +} +/** + * Insere um novo usuário + */ +"POST /usuarios": { +body: { +/** + * Tipo de pessoa + */ +tipoPessoa?: ("Fisica" | "Juridica") +/** + * Origem do contato + */ +origemContato?: ("Google" | "Bing" | "Jornal" | "PatrocinioEsportivo" | "RecomendacaoAlguem" | "Revista" | "SiteInternet" | "Televisao" | "Outro" | "UsuarioImportadoViaAdmin" | "PayPalExpress") +/** + * Tipo Sexo (optional) + */ +tipoSexo?: ("Undefined" | "Masculino" | "Feminino") +/** + * Nome do usuário (Max Length: 100) + */ +nome?: string +/** + * CPF do usuário caso seja pessoa física (Max Length: 50) (optional) + */ +cpf?: string +/** + * E-mail do usuário (Max Length: 100) + */ +email?: string +/** + * RG do usuário caso seja pessoa física (Max Length: 50) (optional) + */ +rg?: string +/** + * Telefone residencial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) + */ +telefoneResidencial?: string +/** + * Telefone celular do usuário. Deve ser informado o DDD junto ao número (Max Length: 50) (optional) + */ +telefoneCelular?: string +/** + * Telefone comercial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) (optional) + */ +telefoneComercial?: string +/** + * Data de nascimento (optional) + */ +dataNascimento?: string +/** + * Razão social do usuário, caso seja uma pessoa jurídica(Max Length: 100) (optional) + */ +razaoSocial?: string +/** + * CNPJ do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) + */ +cnpj?: string +/** + * Inscrição estadual do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) + */ +inscricaoEstadual?: string +/** + * Responsável(Max Length: 100) (optional) + */ +responsavel?: string +/** + * Data de criação do cadastro (optional) + */ +dataCriacao?: string +/** + * Data de atualização do cadastro (optional) + */ +dataAtualizacao?: string +/** + * Se o usuário é revendedor (optional) + */ +revendedor?: boolean +/** + * Informação cadastral (optional) + */ +listaInformacaoCadastral?: { +/** + * Chave + */ +chave?: string +/** + * Valor + */ +valor?: string +}[] +/** + * Avatar (Max Length: 50) (optional) + */ +avatar?: string +/** + * IP do usuário (Max Length: 20) (optional) + */ +ip?: string +/** + * Seta ou retorna o valor de Aprovado (optional) + */ +aprovado?: boolean +} +} +/** + * Dados da loja + */ +"GET /loja": { +response: { +nome?: string +urlSite?: string +urlCarrinho?: string +} +} +/** + * Indicadores de Faturamento + */ +"GET /dashboard/faturamento": { +searchParams: { +/** + * Data inicial dos indicadores que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos indicadores que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Data inicial do comparativo dos indicadores que deverão retonar (aaaa-mm-dd) + */ +dataInicialComparativo?: string +/** + * Data final do comparativo dos indicadores que deverão retonar (aaaa-mm-dd) + */ +dataFinalComparativo?: string +} +response: { +indicadorReceita?: number +indicadorPedido?: number +indicadorTicketMedio?: number +indicadorReceitaComparativo?: number +indicadorPedidoComparativo?: number +indicadorTicketMedioComparativo?: number +indicadorReceitaFormatado?: string +indicadorPedidoFormatado?: string +indicadorTicketMedioFormatado?: string +indicadorReceitaComparativoFormatado?: string +indicadorPedidoComparativoFormatado?: string +indicadorTicketMedioComparativoFormatado?: string +indicadorReceitaPorcentagem?: string +indicadorPedidoPorcentagem?: string +indicadorTicketMedioPorcentagem?: string +} +} +/** + * Grupo de assinatura + */ +"GET /assinaturas/grupoassinatura": { +response: { +grupoAssinaturaId?: number +nome?: string +recorrencias?: { +recorrenciaId?: number +nome?: string +dias?: number +}[] +}[] +} +/** + * Lista de pedidos + */ +"GET /pedidos/:pedidoId/rastreamento": { +response: { +pedidoRastreamentoId?: number +dataAtualizacao?: string +notaFiscal?: string +serieNF?: string +cfop?: number +dataEnviado?: string +urlNFE?: string +chaveAcessoNFE?: string +rastreamento?: string +urlRastreamento?: string +transportadora?: string +dataEntrega?: string +} +} +/** + * Insere um rastreamento e status a um pedido + */ +"POST /pedidos/:pedidoId/rastreamento": { +body: { +/** + * Id da situação do pedido + */ +situacaoPedidoId?: number +/** + * Id do centro de distribuição + */ +centroDistribuicaoId?: number +/** + * Rastreamento (optional) + */ +rastreamento?: string +/** + * Data do pedido (optional) + */ +dataEvento?: string +/** + * Número da nota fiscal (optional) + */ +numeroNotaFiscal?: string +/** + * Chave acesso NFE (optional) + */ +chaveAcessoNFE?: string +/** + * URL NFE (optional) + */ +urlNFE?: string +/** + * Serie NFE (optional) + */ +serieNFE?: string +/** + * CFOP (optional) + */ +cfop?: string +/** + * URL Rastreamento (optional) + */ +urlRastreamento?: string +} +} +/** + * Atualiza a data de entrega do pedido + */ +"PUT /pedidos/:pedidoId/rastreamento": { +body: { +/** + * Objeto com os dados do rastreamento + */ +RAW_BODY: { +/** + * Código de verificação do transporte do produto + */ +rastreamento?: string +/** + * Data que a entrega foi realizada + */ +dataEntrega?: string +} +} +} +/** + * Rastreamento de produto encontrado + */ +"GET /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento/:pedidoRastreamentoProdutoId": { +response: { +pedidoRastreamentoProdutoId?: number +pedidoId?: number +produtoVarianteId?: number +pedidoProdutoId?: number +dataInclusao?: string +dataAlteracao?: string +notaFiscal?: string +cfop?: number +dataEnviado?: string +chaveAcessoNFE?: string +rastreamento?: string +urlRastreamento?: string +quantidade?: number +urlNFE?: string +serieNFE?: string +tipoPostagem?: string +centroDistribuicao?: string +transportadora?: string +dataEntrega?: string +} +} +/** + * Atualiza rastreamento de produto completo (com os dados da N.F.) + */ +"PUT /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento/:pedidoRastreamentoProdutoId": { +body: { +/** + * Nota Fiscal + */ +notaFiscal?: string +/** + * CFOP + */ +cfop?: number +/** + * Data Enviado + */ +dataEnviado?: string +/** + * Chave de acesso NFE + */ +chaveAcessoNFE?: string +/** + * Rastreamento (optional) + */ +rastreamento?: string +/** + * URL de rastreamento (optional) + */ +urlRastreamento?: string +/** + * Transportadora (optional) + */ +transportadora?: string +/** + * Data da entrega (optional) + */ +dataEntrega?: string +} +} +/** + * Lista de detalhes de frete + */ +"GET /fretes/:freteId/detalhes": { +response: { +freteId?: number +cepInicial?: number +cepFinal?: number +variacoesFreteDetalhe?: { +pesoInicial?: number +pesoFinal?: number +valorFrete?: number +prazoEntrega?: number +valorPreco?: number +valorPeso?: number +}[] +}[] +} +/** + * Insere um novo detalhe de frete vinculado a um contrato de frete + */ +"POST /fretes/:freteId/detalhes": { +body: { +/** + * Informe o cep inicial (optional) + */ +cepInicial?: number +/** + * Informe o cep final (optional) + */ +cepFinal?: number +/** + * Variações de detalhe do frete (optional) + */ +variacoesFreteDetalhe?: { +/** + * Informe o peso inicial + */ +pesoInicial?: number +/** + * Informe o peso final + */ +pesoFinal?: number +/** + * Informe o valor do frete + */ +valorFrete?: number +/** + * Informe o prazo de entrega + */ +prazoEntrega?: number +/** + * Informe o valor preço + */ +valorPreco?: number +/** + * Informe o valor peso + */ +valorPeso?: number +}[] +} +} +/** + * Exclui os detalhes de um contrato de frete + */ +"DELETE /fretes/:freteId/detalhes": { + +} +/** + * Pedido encontrado + */ +"GET /pedidos/:pedidoId": { +response: { +pedidoId?: number +situacaoPedidoId?: number +tipoRastreamentoPedido?: string +transacaoId?: number +data?: string +dataPagamento?: string +dataUltimaAtualizacao?: string +valorFrete?: number +valorTotalPedido?: number +valorDesconto?: number +valorDebitoCC?: number +cupomDesconto?: string +marketPlacePedidoId?: string +marketPlacePedidoSiteId?: string +canalId?: number +canalNome?: string +canalOrigem?: string +retiradaLojaId?: number +isPedidoEvento?: boolean +usuario?: { +usuarioId?: number +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +} +pedidoEndereco?: { +tipo?: string +nome?: string +endereco?: string +numero?: string +complemento?: string +referencia?: string +cep?: string +tipoLogradouro?: string +logradouro?: string +bairro?: string +cidade?: string +estado?: string +pais?: string +}[] +frete?: { +freteContratoId?: number +freteContrato?: string +referenciaConector?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +retiradaLojaId?: number +centrosDistribuicao?: { +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +servico?: { +servicoId?: number +nome?: string +transportadora?: string +prazo?: number +servicoNome?: string +preco?: number +servicoTransporte?: number +codigo?: number +servicoMeta?: string +custo?: number +token?: string +} +retiradaAgendada?: { +lojaId?: number +retiradaData?: string +retiradaPeriodo?: string +nome?: string +documento?: string +codigoRetirada?: string +} +agendamento?: { +de?: string +ate?: string +} +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +} +itens?: { +produtoVarianteId?: number +sku?: string +nome?: string +quantidade?: number +precoCusto?: number +precoVenda?: number +isBrinde?: boolean +valorAliquota?: number +isMarketPlace?: boolean +precoPor?: number +desconto?: number +totais?: { +precoCusto?: number +precoVenda?: number +precoPor?: number +desconto?: number +} +ajustes?: { +tipo?: string +valor?: number +observacao?: string +nome?: string +}[] +centroDistribuicao?: { +centroDistribuicaoId?: number +quantidade?: number +situacaoProdutoId?: number +valorFreteEmpresa?: number +valorFreteCliente?: number +}[] +valoresAdicionais?: { +tipo?: string +origem?: string +texto?: string +valor?: number +}[] +atributos?: { +produtoVarianteAtributoValor?: string +produtoVarianteAtributoNome?: string +}[] +embalagens?: { +tipoEmbalagemId?: number +nomeTipoEmbalagem?: string +mensagem?: string +valor?: number +descricao?: string +}[] +personalizacoes?: { +nomePersonalizacao?: string +valorPersonalizacao?: string +valor?: number +}[] +frete?: { +quantidade?: number +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +dadosProdutoEvento?: { +tipoPresenteRecebimento?: string +} +formulas?: { +chaveAjuste?: string +valor?: number +nome?: string +expressao?: string +expressaoInterpretada?: string +endPoint?: string +}[] +seller?: { +sellerId?: number +sellerNome?: string +sellerPedidoId?: number +} +}[] +assinatura?: { +assinaturaId?: number +grupoAssinaturaId?: number +tipoPeriodo?: string +tempoPeriodo?: number +percentualDesconto?: number +}[] +pagamento?: { +formaPagamentoId?: number +numeroParcelas?: number +valorParcela?: number +valorDesconto?: number +valorJuros?: number +valorTotal?: number +boleto?: { +urlBoleto?: string +codigoDeBarras?: string +} +cartaoCredito?: { +numeroCartao?: string +nomeTitular?: string +dataValidade?: string +codigoSeguranca?: string +documentoCartaoCredito?: string +token?: string +info?: string +bandeira?: string +}[] +pagamentoStatus?: { +numeroAutorizacao?: string +numeroComprovanteVenda?: string +dataAtualizacao?: string +dataUltimoStatus?: string +adquirente?: string +tid?: string +}[] +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +}[] +observacao?: { +observacao?: string +usuario?: string +data?: string +publica?: boolean +}[] +valorCreditoFidelidade?: number +valido?: boolean +valorSubTotalSemDescontos?: number +pedidoSplit?: number[] +} +} +/** + * Lista de identificadores de conteúdos vinculados ao hotsite + */ +"GET /hotsites/:hotsiteId/conteudos": { +response: { +conteudoId?: number +}[] +} +/** + * Vincula um ou mais conteúdos a um hotsite específico + */ +"POST /hotsites/:hotsiteId/conteudos": { +body: { +/** + * Lista de identificadores de conteúdos a serem vinculados + */ +RAW_BODY: { +/** + * Identificador do conteúdo + */ +conteudoId?: number +}[] +} +} +/** + * Desvincula um ou mais conteúdos de um hotsite específico + */ +"DELETE /hotsites/:hotsiteId/conteudos": { +body: { +/** + * Lista de identificadores de conteúdos a serem desvinculados + */ +conteudos?: { +/** + * Identificador do conteúdo + */ +conteudoId?: number +}[] +} +} +/** + * Atualiza um campo de cadastro personalizado pelo id + */ +"PUT /usuarios/camposcadastropersonalizado/:camposcadastropersonalizadoId": { +body: { +/** + * Nome do campo (optional) + */ +nome?: string +/** + * Se o campo será obrigatório (optional) + */ +obrigatorio?: boolean +/** + * Ordem (optional) + */ +ordem?: number +} +} +/** + * Remove um campo de cadastro personalizado + */ +"DELETE /usuarios/camposcadastropersonalizado/:camposcadastropersonalizadoId": { + +} +/** + * Dados do serviço de frete do pedido + */ +"GET /pedidos/:pedidoId/frete": { + +} +/** + * Tabela de preços específica + */ +"GET /tabelaPrecos/:tabelaPrecoId": { +response: { +tabelaPrecoId?: number +nome?: string +dataInicial?: string +dataFinal?: string +ativo?: boolean +isSite?: boolean +} +} +/** + * Atualiza uma tabela de preços + */ +"PUT /tabelaPrecos/:tabelaPrecoId": { +body: { +/** + * Nome da tabela de preço + */ +nome?: string +/** + * Data que inicia a tabela de preço + */ +dataInicial?: string +/** + * Data de término da tabela de preço + */ +dataFinal?: string +/** + * Status da tabela de preço + */ +ativo?: boolean +} +} +/** + * Exclui uma tabela de preços + */ +"DELETE /tabelaPrecos/:tabelaPrecoId": { + +} +/** + * Último status do pedido + */ +"GET /pedidos/:pedidoId/status": { +response: { +situacaoPedidoId?: number +dataAtualizacao?: string +notaFiscal?: string +cfop?: number +dataEnviado?: string +chaveAcessoNFE?: string +rastreamento?: string +urlRastreamento?: string +nomeTransportadora?: string +produtos?: { +produtoVarianteId?: number +situacaoProdutoId?: number +quantidade?: number +centroDistribuicaoId?: number +}[] +} +} +/** + * Atualiza a situação do status do pedido + */ +"PUT /pedidos/:pedidoId/status": { +body: { +/** + * Id da situação do pedido + */ +RAW_BODY: { +/** + * Id da situação do pedido + */ +id?: number +} +} +} +/** + * Lista de Tópicos + */ +"GET /webhook/Topicos": { +response: { +nome?: string +descricao?: string +payload?: string +}[] +} +/** + * Seta o pedido como integrado + */ +"POST /pedidos/complete": { +body: { +/** + * Pedido que se deseja inserir o "complete" + */ +RAW_BODY: { +/** + * Id do pedido + */ +pedidoId?: number +} +} +} +/** + * Portfolio encontrado + */ +"GET /portfolios/:portfolioId": { +response: { +portfolioId?: number +nome?: string +ativo?: boolean +} +} +/** + * Atualiza um portfolio + */ +"PUT /portfolios/:portfolioId": { +body: { +/** + * Nome do portfolio + */ +nome?: string +} +} +/** + * Deleta um portfolio + */ +"DELETE /portfolios/:portfolioId": { + +} +/** + * Retorna se o produto variante está disponível ou não + */ +"GET /produtos/:identificador/disponibilidade": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +} +/** + * Lista de formas de pagamento + */ +"GET /formasPagamento": { +response: { +formaPagamentoId?: number +nome?: string +nomeExibicao?: string +descricao?: string +}[] +} +/** + * Lista de pedidos + */ +"GET /pedidos/:pedidoId/rastreamento/produtos": { +response: { +produtoVarianteId?: number +rastreamentos?: { +pedidoRastreamentoProdutoId?: number +quantidade?: number +dataAtualizacao?: string +notaFiscal?: string +cfop?: number +dataEnviado?: string +chaveAcessoNFE?: string +rastreamento?: string +urlRastreamento?: string +transportadora?: string +centroDistribuicaoId?: number +dataEntrega?: string +}[] +}[] +} +/** + * Altera o status de um portfolio + */ +"PUT /portfolios/:portfolioId/status": { +body: { +/** + * Status do portfolio: true ou false + */ +RAW_BODY?: { +/** + * Novo status do portfolio + */ +ativo?: boolean +} +} +} +/** + * Limite de crédito que estão vinculados aos usuários + */ +"GET /usuarios/limiteCredito": { +response: { +usuarioId?: number +valor?: number +saldo?: number +}[] +} +/** + * Exclui uma imagem de um produto + */ +"DELETE /produtos/:identificador/imagens/:id": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +} +/** + * Extrato retornado com sucesso + */ +"GET /contascorrentes/:email/extrato": { +searchParams: { +/** + * Data Inicial para verificar extrato + */ +dataInicial?: string +/** + * Data Final para verificar extrato + */ +dataFinal?: string +} +response: { +data?: string +historico?: string +valor?: number +tipoLancamento?: string +observacao?: string +visivelParaCliente?: boolean +}[] +} +/** + * Lista de observações de um pedido + */ +"GET /pedidos/:pedidoId/observacao": { +response: { +observacao?: string +usuario?: string +publica?: boolean +data?: string +}[] +} +/** + * Insere uma observação a um pedido + */ +"POST /pedidos/:pedidoId/observacao": { +body: { +/** + * Objeto com os dados da observação (optional) + */ +RAW_BODY: { +/** + * Texto da observação + */ +observacao?: string +/** + * Nome do usuário que está inserindo a observação + */ +usuario?: string +/** + * Se a observação é publica ou privada + */ +publica?: boolean +} +} +} +/** + * Lista de centros de distribuição + */ +"GET /centrosdistribuicao": { +response: { +id?: number +nome?: string +cep?: number +padrao?: boolean +}[] +} +/** + * Lista de avaliações de produtos + */ +"GET /produtoavaliacao": { +searchParams: { +/** + * Referente ao status que libera a visualização da avaliação no site + */ +status?: ("Pendente" | "NaoAprovado" | "Aprovado") +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +} +response: { +produtoVarianteId?: number +sku?: string +produtoAvaliacaoId?: number +comentario?: string +avaliacao?: number +usuarioId?: number +dataAvaliacao?: string +nome?: string +email?: string +status?: string +}[] +} +/** + * Conteúdo encontrado + */ +"GET /conteudos/:conteudoId": { + +} +/** + * Atualiza um conteúdo + */ +"PUT /conteudos/:conteudoId": { +body: { +/** + * Titulo do conteúdo + */ +titulo?: string +/** + * Conteúdo ativo/inativo + */ +ativo?: boolean +/** + * Data de inicio de exibição do conteúdo (optional) + */ +dataInicio?: string +/** + * Data de final de exibição do conteúdo (optional) + */ +dataFim?: string +/** + * Posicionamento do conteúdo + */ +posicionamento?: ("Topo" | "Centro" | "Rodape" | "LateralDireita" | "LateralEsquerda" | "MobileTopo" | "MobileRodape") +/** + * Informações do conteúdo + */ +conteudo?: string +/** + * Insira em qual Termo de Busca o Conteúdo será exibido (optional) + */ +termoBusca?: string +/** + * Exibição do conteúdo nas buscas + */ +exibeTodasBuscas?: boolean +/** + * Não exibição do conteúdo nas buscas + */ +naoExibeBuscas?: boolean +/** + * Exibição do conteúdo nos hotsites + */ +exibeTodosHotsites?: boolean +/** + * Insira quais Hotsites que o Conteúdo será exibido (optional) + */ +hotsiteId?: number[] +} +} +/** + * Atualiza o status do tipo de evento, ativando-o ou inativando-o + */ +"PUT /tiposEvento/:tipoEventoId/AlterarStatus": { + +} +/** + * Lista de produtos variantes vinculados aos tipo de evento + */ +"GET /tiposEvento/:tipoEventoId/produtos": { +response: { +tipoEventoId?: number +produtoVariantePrincipalId?: number +}[] +} +/** + * Lista de resposta para cada produto vinculado + */ +"POST /tiposEvento/:tipoEventoId/produtos": { +body: { +/** + * Identificadores dos produtos variantes a serem vinculados ao tipo evento desejado + */ +produtos?: { +/** + * Identificador do produto variante + */ +produtoVarianteId?: number +}[] +} +response: { +sugestaoProdutosInseridos?: { +tipoEventoId?: number +produtoVarianteId?: number +detalhes?: string +}[] +produtosNaoInseridos?: { +tipoEventoId?: number +produtoVarianteId?: number +detalhes?: string +}[] +} +} +/** + * Atualiza os produtos sugeridos de um tipo de evento + */ +"PUT /tiposEvento/:tipoEventoId/produtos": { +body: { +/** + * Identificadores dos produtos variantes a serem vinculados ao tipo evento desejado + */ +produtos?: { +/** + * Identificador do produto variante + */ +produtoVarianteId?: number +}[] +} +} +/** + * Atualiza a ativação automática de produtos de um Seller + */ +"PUT /resellers/:resellerId/ativacaoAutomaticaProdutos": { +body: { +/** + * Status da ativação automática de produtos + */ +ativo?: boolean +} +} +/** + * Gráfico Forma de Pagamento + */ +"GET /dashboard/graficoformapagamento": { +searchParams: { +/** + * Data inicial dos pedidos com as formas de pagamento que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos pedidos com as formas de pagamento que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Id do parceiro + */ +parceiroId?: number +} +response: { +nome?: string +quantidade?: number +cor?: string +}[] +} +/** + * Lista de números de pedidos ainda não integrados + */ +"GET /pedidos/naoIntegrados": { +response: { +pedidoId?: number +}[] +} +/** + * Dados da lista de desejos de um usuário + */ +"GET /usuarios/:usuarioId/listaDesejos": { +response: { +produtoId?: number +produtoVarianteId?: number +quantidade?: number +dataAdicao?: string +}[] +} +/** + * Usuários encontrados + */ +"GET /parceiros/:nome/usuarios": { +response: { +usuarioId?: number +email?: string +ativo?: boolean +dataInicial?: string +dataFinal?: string +vinculoVitalicio?: boolean +}[] +} +/** + * Indicador dos Novos Compradores + */ +"GET /dashboard/novoscompradores": { +searchParams: { +/** + * Data inicial dos novos compradores que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos novos compradores que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +} +response: { +indicadorComprador?: string +} +} +/** + * Lista de produtos variantes vinculados aos tipo de evento + */ +"GET /eventos": { +searchParams: { +/** + * Data de inicio do evento + */ +dataInicial?: string +/** + * Data do termino do evento + */ +dataFinal?: string +/** + * Status do evento + */ +disponivel?: boolean +/** + * Titulo do evento + */ +titulo?: string +/** + * Email do Usuário + */ +usuarioEmail?: string +/** + * Identificador do Tipo de Evento + */ +tipoEventoId?: number +} +response: { +eventoId?: number +tipoEventoId?: number +userId?: number +enderecoEntregaId?: number +data?: string +dataCriacao?: string +titulo?: string +url?: string +disponivel?: boolean +diasDepoisEvento?: number +diasAntesEvento?: number +urlLogoEvento?: string +urlCapaEvento?: string +proprietarioEvento?: string +abaInfo01Habilitado?: boolean +textoInfo01?: string +conteudoInfo01?: string +abaInfo02Habilitado?: boolean +textoInfo02?: string +conteudoInfo02?: string +abaMensagemHabilitado?: boolean +fotos?: string +enumTipoListaPresenteId?: string +enumTipoEntregaId?: string +eventoProdutoSelecionado?: { +eventoId?: number +produtoVarianteId?: number +recebidoForaLista?: boolean +removido?: boolean +}[] +enderecoEvento?: { +enderecoEventoId?: number +eventoId?: number +nome?: string +cep?: string +endereco?: string +numero?: string +bairro?: string +cidade?: string +estado?: string +}[] +}[] +} +/** + * Cria um Novo Evento + */ +"POST /eventos": { +body: { +/** + * Identificador do tipo de evento + */ +tipoEventoId?: number +/** + * Identificador do endereço de entrega + */ +enderecoEntregaId?: number +/** + * Titulo do evento + */ +titulo?: string +/** + * URL do evento + */ +url?: string +/** + * Data do Evento + */ +data?: string +/** + * Email do usuário + */ +usuarioEmail?: string +/** + * Disponibilidade do evento (optional) + */ +disponivel?: boolean +/** + * Quantos dias antes do evento ele será exibido (optional) + */ +diasAntesEvento?: number +/** + * Até quantos dias depois do evento ele será exibido (optional) + */ +diasDepoisEvento?: number +/** + * Url do Logo. (Base64) + */ +urlLogo?: string +/** + * Url da Capa. (Base64) + */ +urlCapa?: string +/** + * Quem é o proprietário + */ +proprietario?: string +/** + * Se a aba de informação 01 será habilitada + */ +abaInfo01Habilitado?: boolean +/** + * Texto para o campo informação 01 (optional) + */ +textoInfo01?: string +/** + * Conteúdo para o campo informação 01 (optional) + */ +conteudoInfo01?: string +/** + * Se a aba de informação 02 será habilitada + */ +abaInfo02Habilitado?: boolean +/** + * Texto para o campo informação 02 (optional) + */ +textoInfo02?: string +/** + * Conteúdo para o campo informação 02 (optional) + */ +conteudoInfo02?: string +/** + * Se a aba de mensagem será habilitada (optional) + */ +abaMensagemHabilitado?: boolean +/** + * Tipo de lista de presente + */ +enumTipoListaPresenteId?: ("ListaPronta" | "ListaManual") +/** + * Tipo de entrega + */ +enumTipoEntregaId?: ("EntregaAgendada" | "EntregaConformeCompraRealizada" | "Todos" | "Nenhum") +/** + * Seleção de produto no evento + */ +eventoProdutoSelecionado?: { +/** + * Id do produto variante + */ +produtoVarianteId?: number +/** + * Se produto recebido fora da lista (optional) + */ +recebidoForaLista?: boolean +/** + * Se produto removido (optional) + */ +removido?: boolean +}[] +/** + * Endereço do Evento + */ +enderecoEvento?: { +/** + * Nome para identificação do endereço + */ +nome?: string +/** + * Endereço + */ +endereco?: string +/** + * Cep do endereço + */ +cep?: string +/** + * Numero do endereço + */ +numero?: string +/** + * Bairro do endereço + */ +bairro?: string +/** + * Cidade do endereço + */ +cidade?: string +/** + * Estado do endereço + */ +estado?: string +}[] +} +} +/** + * Retorna todas as informações de um produto específico + */ +"GET /produtos/:identificador/informacoes": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId" | "ProdutoId") +} +response: { +informacaoId?: number +titulo?: string +texto?: string +tipoInformacao?: string +}[] +} +/** + * Adiciona uma nova informação + */ +"POST /produtos/:identificador/informacoes": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +/** + * Define o tipo de retorno a ser recebido. Id retorna o InformacaoProdutoId da informação inserida, Booleano retorna true ou false, de acordo com o resultado da operação. Valor padrão Booleano + */ +tipoRetorno?: ("Id" | "Booleano") +} +body: { +/** + * Titulo da informação (optional) + */ +titulo?: string +/** + * Texto da informação (optional) + */ +texto?: string +/** + * Informação se o produto variante está visível no site. + */ +exibirSite?: boolean +/** + * Tipo de informação do produto (optional) + */ +tipoInformacao?: ("Informacoes" | "Beneficios" | "Especificacoes" | "DadosTecnicos" | "Composicao" | "ModoDeUsar" | "Cuidados" | "ItensInclusos" | "Dicas" | "Video" | "Descricao" | "ValorReferente" | "PopUpReferente" | "Prescricao" | "TabelaDeMedidas" | "Spot" | "Sinopse" | "Carrinho") +} +} +/** + * Indicador do Carrinho Abandonado + */ +"GET /dashboard/carrinhoabandonado": { +searchParams: { +/** + * Data inicial dos carrinhos abandonados que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos carrinhos abandonados que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +} +response: { +indicadorCarrinhoAbandonado?: string +} +} +/** + * Lista de Metatags do produto informado + */ +"GET /produtos/:identificador/seo/metaTag": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +response: { +metatagId?: number +content?: string +httpEquiv?: string +name?: string +scheme?: string +}[] +} +/** + * Insere um ou mais metatags para um produto + */ +"POST /produtos/:identificador/seo/metaTag": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno da fstore + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +body: { +/** + * Lista de metatags (optional) + */ +metas?: { +/** + * Dados da Meta Tag + */ +content?: string +/** + * Dados da Meta Tag + */ +httpEquiv?: string +/** + * Dados da Meta Tag + */ +name?: string +/** + * Dados da Meta Tag + */ +scheme?: string +}[] +} +response: { +metatagId?: number +content?: string +httpEquiv?: string +name?: string +scheme?: string +}[] +} +/** + * Deleta um ou mais Metatags de produto + */ +"DELETE /produtos/:identificador/seo/metaTag": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoId" | "ProdutoVarianteId") +} +body: { +/** + * Lista de identificadores de metatags (optional) + */ +metatags?: { +/** + * Identificador do MetaTag + */ +metatagId?: number +}[] +} +} +/** + * Frete encontrado + */ +"GET /fretes/:freteId": { +response: { +freteId?: number +nome?: string +ativo?: boolean +volumeMaximo?: number +pesoCubado?: number +entregaAgendadaConfiguracaoId?: number +linkRastreamento?: string +ehAssinatura?: boolean +larguraMaxima?: number +alturaMaxima?: number +comprimentoMaximo?: number +limiteMaximoDimensoes?: number +limitePesoCubado?: number +tempoMinimoDespacho?: number +centroDistribuicaoId?: number +valorMinimoProdutos?: number +} +} +/** + * Frete atualizado com sucesso + */ +"PUT /fretes/:freteId": { +body: { +/** + * Nome do contrato de frete (optional) + */ +nome?: string +/** + * Status do contrato de frete (optional) + */ +ativo?: boolean +/** + * Volume máximo permitido, em metro cúbico (m³). (optional) + */ +volumeMaximo?: number +/** + * Informe o peso cubado. Altura x largura x profundidade x fator de cubagem. (optional) + */ +pesoCubado?: number +/** + * Id da configuração entrega agendada (optional) + */ +entregaAgendadaConfiguracaoId?: number +/** + * URL rastreamento (optional) + */ +linkRastreamento?: string +/** + * Contrato é exclusivo assinatura (optional) + */ +ehAssinatura?: boolean +/** + * Informe a largura máxima, em centímetros (cm). (optional) + */ +larguraMaxima?: number +/** + * Informe a altura máxima, em centímetros (cm). (optional) + */ +alturaMaxima?: number +/** + * Informe o comprimento máximo, em centímetros (cm). (optional) + */ +comprimentoMaximo?: number +/** + * Informe a soma das três dimensões (Largura + Altura + Comprimento), em centímetros (cm). (optional) + */ +limiteMaximoDimensoes?: number +/** + * Informe o limite de peso cubado, em gramas (g). (optional) + */ +limitePesoCubado?: number +/** + * Informe quantos dias no mínimo esse contrato de frete leva para ser enviado ao cliente (optional) + */ +tempoMinimoDespacho?: number +/** + * Informe o Id do centro de distribuição (optional) + */ +centroDistribuicaoId?: number +/** + * Informe o valor mínimo em produtos necessário para disponibilidade da tabela de frete (optional) + */ +valorMinimoProdutos?: number +} +} +/** + * Relatório de transações de um determinado período + */ +"GET /dashboard/transacoes": { +searchParams: { +/** + * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos pedidos que deverão retornar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Tipo de agrupamento dos pedidos (hora, dia, semana, mês, ano) + */ +tipoAgrupamento?: ("Hora" | "Dia" | "Semana" | "Mes" | "Ano") +} +response: { +tipoAgrupamento?: string +dados?: { +data?: string +pedidosCaptados?: number +pedidosPagos?: number +pedidosEnviados?: number +pedidosCancelados?: number +}[] +} +} +/** + * Lista de produtos de uma tabela de preços + */ +"GET /tabelaPrecos/:tabelaPrecoId/produtos": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +} +response: { +tabelaPrecoProdutoVarianteId?: number +tabelaPrecoId?: number +sku?: string +produtoVarianteId?: number +precoDe?: number +precoPor?: number +}[] +} +/** + * Inseri uma lista de produto variantes em uma tabela de preços + */ +"POST /tabelaPrecos/:tabelaPrecoId/produtos": { +body: { +/** + * Lista de produtos variantes + */ +RAW_BODY: { +/** + * SKU do produto + */ +sku?: string +/** + * Preço De do produto + */ +precoDe?: number +/** + * Preço Por do produto + */ +precoPor?: number +}[] +} +response: { +sucesso?: { +sku?: string +resultado?: boolean +detalhes?: string +}[] +erro?: { +sku?: string +resultado?: boolean +detalhes?: string +}[] +} +} +/** + * Lista com o retorno do processamento dos produtos enviados + */ +"PUT /tabelaPrecos/:tabelaPrecoId/produtos": { +body: { +/** + * Lista de produtos variantes + */ +RAW_BODY: { +/** + * SKU do produto + */ +sku?: string +/** + * Preço De do produto + */ +precoDe?: number +/** + * Preço Por do produto + */ +precoPor?: number +}[] +} +response: { +sucesso?: { +sku?: string +resultado?: boolean +detalhes?: string +}[] +erro?: { +sku?: string +resultado?: boolean +detalhes?: string +}[] +} +} +/** + * Lista de scripts + */ +"GET /gestorscripts/scripts": { +response: { +scriptId?: number +nome?: string +posicao?: string +tipoPagina?: string +dataInicial?: string +datafinal?: string +ativo?: boolean +prioridade?: number +}[] +} +/** + * Insere um novo script + */ +"POST /gestorscripts/scripts": { +body: { +/** + * Nome do script + */ +nome?: string +/** + * Data inicial do script + */ +dataInicial?: string +/** + * Data final do script + */ +dataFinal?: string +/** + * Informe se o script está ativo ou não + */ +ativo?: boolean +/** + * Prioridade do script + */ +prioridade?: number +/** + * Posição do script + */ +posicao?: ("HeaderPrimeiraLinha" | "HeaderUltimaLinha" | "BodyPrimeiraLinha" | "BodyUltimaLinha" | "FooterPrimeiraLinha" | "FooterUltimeLinha") +/** + * Tipo da página do script + */ +tipoPagina?: ("Todas" | "Home" | "Busca" | "Categoria" | "Fabricante" | "Estaticas" | "Produto" | "Carrinho") +/** + * Identificador da página + */ +identificadorPagina?: string +/** + * Conteúdo do script + */ +conteudo?: string +/** + * Status do script + */ +publicado?: boolean +} +} +/** + * Assinaturas com erro na loja + */ +"GET /assinaturas/erros": { +searchParams: { +/** + * Data inicial para buscas por periodo de tempo (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final para buscas por periodo de tempo (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +/** + * Erros já resolvidos ou não + */ +resolvidos?: boolean +} +} +/** + * Método que realiza uma cotação de frete + */ +"POST /fretes/cotacoes": { +searchParams: { +/** + * Cep de entrega + */ +cep?: string +/** + * Define se o identificador informado é um sku ou um id interno da fstore + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +/** + * Define se deve retornar as opções de retirada em loja ("False" por padrão) (optional) + */ +retiradaLoja?: boolean +} +body: { +/** + * Valor total do pedido (optional) + */ +valorTotal?: number +/** + * Lista de produtos da cotação + */ +produtos?: { +/** + * Id do produto variante + */ +identificador?: string +/** + * Quantidade do produto + */ +quantidade?: number +}[] +} +response: { +id?: string +nome?: string +prazo?: number +tabelaFreteId?: string +tipo?: string +valor?: number +produtos?: { +produtoVarianteId?: number +valor?: number +}[] +}[] +} +/** + * Lista de Ranges de Ceps de uma Loja Física + */ +"GET /lojasFisicas/:lojaFisicaId/rangeCep": { +response: { +rangeCepId?: number +nome?: string +cepInicial?: string +cepFinal?: string +}[] +} +/** + * Insere um range de cep em uma Loja Física + */ +"POST /lojasFisicas/:lojaFisicaId/rangeCep": { +body: { +/** + * Nome do range de cep + */ +nome?: string +/** + * Cep inicial do range. Formato: 00.000-000 + */ +cepInicial?: string +/** + * Cep final do range. Formato: 00.000-000 + */ +cepFinal?: string +} +} +/** + * Remove uma lista de range de cep de uma Loja Física + */ +"DELETE /lojasFisicas/:lojaFisicaId/rangeCep": { +body: { +/** + * Lista de range de cep a serem excluídos da loja física + */ +RAW_BODY: { +/** + * Id da faixa de cep a ser deletado + */ +rangeCepId?: number +}[] +} +} +/** + * Retorna usuário encontrado + */ +"GET /usuarios/:usuarioId/enderecos": { +response: { +enderecoId?: number +nomeEndereco?: string +rua?: string +numero?: string +complemento?: string +referencia?: string +bairro?: string +cidade?: string +estado?: string +cep?: string +utilizadoUltimoPedido?: boolean +pais?: string +}[] +} +/** + * Insere um endereço para um usuário pelo id do usuário + */ +"POST /usuarios/:usuarioId/enderecos": { +body: { +/** + * Nome de identificação do endereço a ser cadastrado (Max Length: 100) + */ +nomeEndereco?: string +/** + * Nome da rua (Max Length: 500) + */ +rua?: string +/** + * Número do local (Max Length: 50) + */ +numero?: string +/** + * Complemento (Max Length: 250) (optional) + */ +complemento?: string +/** + * Referência para a localização do endereço (Max Length: 500) (optional) + */ +referencia?: string +/** + * Bairro do endereço (Max Length: 100) + */ +bairro?: string +/** + * Cidade em que se localiza o endereço (Max Length: 100) + */ +cidade?: string +/** + * O estado (Max Length: 100) + */ +estado?: string +/** + * Código do cep (Max Length: 50) + */ +cep?: string +} +} +/** + * Retorna uma lista de vínculos entre usuário e parceiro + */ +"GET /usuarios/:email/parceiros": { + +} +/** + * Atualiza o preço de vários produtos com base na lista enviada. Limite de 50 produtos por requisição + */ +"PUT /produtos/precos": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Lista com os dados da atualização do preço (optional) + */ +RAW_BODY: { +/** + * Identificador do produto (ProdutoVarianteId ou SKU) + */ +identificador?: string +/** + * Preço de custo do produto variante + */ +precoCusto?: number +/** + * "PrecoDe" do produto variante + */ +precoDe?: number +/** + * "PrecoPor" do produto variante + */ +precoPor?: number +/** + * Fator multiplicador que gera o preço de exibição do produto. Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) + */ +fatorMultiplicadorPreco?: number +}[] +} +response: { +produtosNaoAtualizados?: { +produtoVarianteId?: number +sku?: string +resultado?: boolean +detalhes?: string +}[] +produtosAtualizados?: { +produtoVarianteId?: number +sku?: string +resultado?: boolean +detalhes?: string +}[] +} +} +/** + * Usuário encontrado + */ +"GET /usuarios/email/:email": { +response: { +usuarioId?: number +bloqueado?: boolean +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +avatar?: string +ip?: string +aprovado?: boolean +} +} +/** + * Novo token gerado com sucesso + */ +"POST /autenticacao/trocarLoja/:novaLoja": { +response: { +lojas?: string[] +accessToken?: string +dataExpiracaoAccessTokenUTC?: string +} +} +/** + * Campos de cadastro personalizado encontrados + */ +"GET /usuarios/camposcadastropersonalizado": { +response: { +grupoInformacaoCadastralId?: number +nome?: string +tipo?: string +obrigatorio?: boolean +ordem?: number +valorPreDefinido?: { +valoresDefinidosCampoGrupoInformacaoId?: number +valor?: string +ordem?: number +}[] +}[] +} +/** + * Objeto do hotsite + */ +"GET /hotsites/:hotsiteId": { +response: { +hotsiteId?: number +nome?: string +ativo?: boolean +template?: string +dataCriacao?: string +dataInicio?: string +dataFinal?: string +url?: string +tamanhoPagina?: number +templateId?: number +ordenacao?: string +listaProdutos?: { +expressao?: string +produtos?: { +produtoId?: number +ordem?: number +}[] +} +seo?: { +seoHotsiteId?: number +hotsiteId?: number +titulo?: string +metas?: { +conteudo?: string +nome?: string +httpEquiv?: string +scheme?: string +}[] +} +banners?: { +bannerId?: number +}[] +conteudos?: { +conteudoId?: number +}[] +} +} +/** + * Atualiza os dados de um hotsite existente + */ +"PUT /hotsites/:hotsiteId": { +body: { +/** + * Nome do hotsite + */ +nome?: string +/** + * Data/hora em que o hotsite começará a ser exibido (optional) + */ +dataInicio?: string +/** + * Data/Hora (último dia) em que o hotsite não será mais exibido (optional) + */ +dataFinal?: string +/** + * Informe a url do hotsite. Por exemplo, se o site for 'busca.meusite.com.br', e o hotsite desejado for 'busca.meusite.com.br/hotsite/natal' informe neste campo somente a url 'hotsite/natal', sem a barra '/' no início + */ +url?: string +/** + * Informe o número de produtos que deve ser exibido por página + */ +tamanhoPagina?: number +/** + * Informe o identificador do template que será utilizado. Caso não saiba o identificador do template desejado, o mesmo pode ser buscado no endpoint GET/Templates + */ +templateId?: number +/** + * Informe qual será a ordenação dos Produtos no Hotsite (optional) + */ +ordenacao?: ("Nenhuma" | "NomeCrescente" | "NomeDecrescente" | "Lancamento" | "MenorPreco" | "MaiorPreco" | "MaisVendidos" | "MaioresDescontos" | "Aleatorio" | "MenorEstoque" | "MaiorEstoque") +/** + * Produtos que devem aparecer no hotsite + */ +listaProdutos?: { +/** + * você pode utilizar essa opção para gerar um hotsite utilizando uma expressão de busca. Ao utilizá-la, os produtos adicionados nos outros modos de criação de hotsite serão ignorados (optional) + */ +expressao?: string +/** + * Id dos produtos + */ +produtos?: { +/** + * Identificador do produto a ser mostrado no hotsite + */ +produtoId?: number +/** + * Ordem para apresentação do produto (optional) + */ +ordem?: number +}[] +} +/** + * Dados de seo + */ +seo?: { +/** + * Informe o Título que será exibido quando o Hotsite for acessado (optional) + */ +titulo?: string +/** + * Não se esqueça! Além do texto livre, você pode utilizar as tags [Nome.Hotsite] e [Fbits.NomeLoja] para o cadastro das MetaTags e Title! (optional) + */ +metas?: { +/** + * Informe os dados da Metatag + */ +conteudo?: string +/** + * Informe os dados da Metatag + */ +nome?: string +/** + * Informe os dados da Metatag + */ +httpEquiv?: string +/** + * Informe os dados da Metatag + */ +scheme?: string +}[] +} +/** + * Lista de identificadores de banners a serem vinculados ao hotsite + */ +banners?: { +/** + * Identificador do banner (optional) + */ +bannerId?: number +}[] +/** + * Lista de identificadores de conteúdos a serem vinculados ao hotsite + */ +conteudos?: { +/** + * Identificador do conteúdo + */ +conteudoId?: number +}[] +/** + * Status do hotsite (optional) + */ +ativo?: boolean +} +} +/** + * Deleta um hotsite que foi inserido manualmente, hotsites gerados automaticamente não podem ser deletados + */ +"DELETE /hotsites/:hotsiteId": { + +} +/** + * Lista com assinaturas + */ +"GET /assinaturas": { +searchParams: { +/** + * Situação da assinatura + */ +situacaoAssinatura?: ("Ativa" | "Pausada" | "Cancelada") +/** + * Período de recorrência + */ +periodoRecorrencia?: string +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Data inicial da próxima recorrência + */ +dataInicialProximaRecorrencia?: string +/** + * Data final da próxima recorrencia + */ +dataFinalProximaRecorrencia?: string +/** + * Data inicial de cancelamento + */ +dataInicialCancelamento?: string +/** + * Data final de cancelamento + */ +dataFinalCancelamento?: string +} +response: { +assinaturaId?: number +usuarioId?: number +dataProximoPedido?: string +periodoRecorrencia?: string +situacaoAssinatura?: string +dataAssinatura?: string +grupoAssinatura?: string +enderecoId?: number +usuarioCartaoCreditoId?: number +cupom?: string +}[] +} +/** + * Lista de categorias + */ +"GET /categorias": { +searchParams: { +/** + * Hierarquia da categoria + */ +hierarquia?: boolean +/** + * Se será apresentado apenas Reseller + */ +apenasReseller?: boolean +/** + * Se será apresentado apenas o último nível das categorias + */ +apenasUltimoNivel?: boolean +/** + * Se será apresentado somente categorias filhas + */ +somenteFilhos?: boolean +} +response: { +id?: number +nome?: string +categoriaPaiId?: number +categoriaERPId?: string +ativo?: boolean +isReseller?: boolean +exibirMatrizAtributos?: string +quantidadeMaximaCompraUnidade?: number +valorMinimoCompra?: number +exibeMenu?: boolean +urlHotSite?: string +}[] +} +/** + * Insere uma nova categoria + */ +"POST /categorias": { +body: { +/** + * Nome da categoria (optional) + */ +nome?: string +/** + * Id da categoria pai (optional) + */ +categoriaPaiId?: number +/** + * Id da categoria ERP (optional) + */ +categoriaERPId?: string +/** + * Categoria ativo/inativo (optional) + */ +ativo?: boolean +/** + * Categoria de reseller (optional) + */ +isReseller?: boolean +/** + * Exibir Matriz de Atributos (optional) + */ +exibirMatrizAtributos?: ("Sim" | "Nao" | "Neutro") +/** + * Informe a quantidade máxima permitida para compra por produtos desta categoria. Informe zero para assumir a configuração geral da loja (optional) + */ +quantidadeMaximaCompraUnidade?: number +/** + * Informe o valor mínimo para compra em produtos desta categoria (optional) + */ +valorMinimoCompra?: number +/** + * Informe se será exibida no menu (optional) + */ +exibeMenu?: boolean +} +} +/** + * Lista de fabricantes + */ +"GET /fabricantes": { +response: { +fabricanteId?: number +ativo?: boolean +nome?: string +urlLogoTipo?: string +urlLink?: string +urlCarrossel?: string +}[] +} +/** + * Insere um novo fabricante + */ +"POST /fabricantes": { +body: { +/** + * Nome do fabricante (optional) + */ +nome?: string +/** + * URL tipo logo (optional) + */ +urlLogoTipo?: string +/** + * Insira neste campo uma URL para redirecionamento. A URL deve ser inserida por completa (optional) + */ +urlLink?: string +/** + * Insira nesse campo a URL do Carrossel da Marca (optional) + */ +urlCarrossel?: string +} +} +/** + * Atualiza o campo Recebido de um produto vinculado a um evento + */ +"PUT /eventos/:eventoId/produtos/recebido": { +body: { +/** + * Id do produto variante (optional) + */ +produtoVarianteId?: number +/** + * Se o produto foi recebido fora da lista (optional) + */ +recebidoForaLista?: boolean +} +} +/** + * Tipo evento buscado + */ +"GET /tiposEvento/:tipoEventoId": { +response: { +tipoEventoId?: number +nome?: string +tipoEntrega?: string +tipoDisponibilizacao?: string +permitirRemocaoAutomaticaProdutos?: boolean +corHexTituloInformacoes?: string +corHexCorpoInformacoes?: string +numeroAbasInformacoes?: number +quantidadeDiasParaEventoExpirar?: number +numeroLocaisEvento?: number +ativo?: boolean +disponivel?: boolean +tipoBeneficiarioFrete?: string +caminhoLogoEvento?: string +caminhoSubTemplate?: string +sugestaoProdutos?: { +tipoEventoId?: number +produtoVarianteId?: number +}[] +} +} +/** + * Atualiza o tipo evento + */ +"PUT /tiposEvento/:tipoEventoId": { +body: { +/** + * Nome do Tipo de Evento + */ +nome?: string +/** + * Tipo de entrega + */ +tipoEntrega?: ("EntregaAgendada" | "EntregaConformeCompraRealizada" | "Todos" | "Nenhum") +/** + * Disponibilização do Tipo de Evento + */ +tipoDisponibilizacao?: ("DisponibilizacaoDeCreditos" | "DisponibilizacaoDeProdutos" | "Todos") +/** + * Permissão para remoção automática de produtos + */ +permitirRemocaoAutomaticaProdutos?: boolean +/** + * Cor em hexadecimal para o titulo de informações + */ +corHexTituloInformacoes?: string +/** + * Cor em hexadecimal para o corpo de informações + */ +corHexCorpoInformacoes?: string +/** + * Número de abas de informações, podendo ser de 1 a 2 + */ +numeroAbasInformacoes?: number +/** + * Quantidade de dias para que o evento expire + */ +quantidadeDiasParaEventoExpirar?: number +/** + * Quantidade de locais do evento + */ +numeroLocaisEvento?: number +/** + * Informa se o evento está ativo ou inativo + */ +ativo?: boolean +/** + * Informa a disponibilidade do evento + */ +disponivel?: boolean +/** + * O beneficiário do frete + */ +tipoBeneficiarioFrete?: ("DonodaLista" | "Convidado") +/** + * Imagem da logo do evento em base64 + */ +imagemLogoEvento?: string +/** + * Produtos Sugeridos para este evento (optional) + */ +sugestaoProdutos?: { +/** + * Id do tipo de evento + */ +tipoEventoId?: number +/** + * Identificador do produto variante + */ +produtoVarianteId?: number +}[] +} +} +/** + * Produtos de uma assinatura + */ +"GET /assinaturas/:email": { +response: { +assinaturaId?: number +usuarioId?: number +dataProximoPedido?: string +periodoRecorrencia?: string +situacaoAssinatura?: string +dataAssinatura?: string +grupoAssinatura?: string +enderecoId?: number +usuarioCartaoCreditoId?: number +cupom?: string +produtos?: { +assinaturaProdutoId?: number +assinaturaId?: number +produtoId?: number +produtoVarianteId?: number +quantidade?: number +valor?: number +removido?: boolean +}[] +}[] +} +/** + * Lista de produtos variantes vinculados aos tipo de evento + */ +"GET /eventos/:eventoId": { +response: { +eventoId?: number +tipoEventoId?: number +userId?: number +enderecoEntregaId?: number +data?: string +dataCriacao?: string +titulo?: string +url?: string +disponivel?: boolean +diasDepoisEvento?: number +diasAntesEvento?: number +urlLogoEvento?: string +urlCapaEvento?: string +proprietarioEvento?: string +abaInfo01Habilitado?: boolean +textoInfo01?: string +conteudoInfo01?: string +abaInfo02Habilitado?: boolean +textoInfo02?: string +conteudoInfo02?: string +abaMensagemHabilitado?: boolean +fotos?: string +enumTipoListaPresenteId?: string +enumTipoEntregaId?: string +eventoProdutoSelecionado?: { +eventoId?: number +produtoVarianteId?: number +recebidoForaLista?: boolean +removido?: boolean +}[] +enderecoEvento?: { +enderecoEventoId?: number +eventoId?: number +nome?: string +cep?: string +endereco?: string +numero?: string +bairro?: string +cidade?: string +estado?: string +}[] +}[] +} +/** + * Atualiza um evento + */ +"PUT /eventos/:eventoId": { +body: { +/** + * Identificador do tipo de evento + */ +tipoEventoId?: number +/** + * Identificador do endereço de entrega + */ +enderecoEntregaId?: number +/** + * Titulo do evento + */ +titulo?: string +/** + * Atributo obsoleto - (optional) + */ +url?: string +/** + * Data do Evento + */ +data?: string +/** + * Email do usuário + */ +usuarioEmail?: string +/** + * Disponibilidade do evento (optional) + */ +disponivel?: boolean +/** + * Quantos dias antes do evento ele será exibido (optional) + */ +diasAntesEvento?: number +/** + * Até quantos dias depois do evento ele será exibido (optional) + */ +diasDepoisEvento?: number +/** + * Url do Logo. (Base64) + */ +urlLogo?: string +/** + * Url da Capa. (Base64) + */ +urlCapa?: string +/** + * Quem é o proprietário + */ +proprietario?: string +/** + * Se a aba de informação 01 será habilitada + */ +abaInfo01Habilitado?: boolean +/** + * Texto para o campo informação 01 (optional) + */ +textoInfo01?: string +/** + * Conteúdo para o campo informação 01 (optional) + */ +conteudoInfo01?: string +/** + * Se a aba de informação 02 será habilitada + */ +abaInfo02Habilitado?: boolean +/** + * Texto para o campo informação 02 (optional) + */ +textoInfo02?: string +/** + * Conteúdo para o campo informação 02 (optional) + */ +conteudoInfo02?: string +/** + * Se a aba de mensagem será habilitada (optional) + */ +abaMensagemHabilitado?: boolean +/** + * Tipo de lista de presente + */ +enumTipoListaPresenteId?: ("ListaPronta" | "ListaManual") +/** + * Tipo de entrega + */ +enumTipoEntregaId?: ("EntregaAgendada" | "EntregaConformeCompraRealizada" | "Todos" | "Nenhum") +/** + * Seleção de produto no evento + */ +eventoProdutoSelecionado?: { +/** + * Id do produto variante + */ +produtoVarianteId?: number +/** + * Se produto recebido fora da lista (optional) + */ +recebidoForaLista?: boolean +/** + * Se produto removido (optional) + */ +removido?: boolean +}[] +/** + * Endereço do Evento + */ +enderecoEvento?: { +/** + * Nome para identificação do endereço + */ +nome?: string +/** + * Endereço + */ +endereco?: string +/** + * Cep do endereço + */ +cep?: string +/** + * Numero do endereço + */ +numero?: string +/** + * Bairro do endereço + */ +bairro?: string +/** + * Cidade do endereço + */ +cidade?: string +/** + * Estado do endereço + */ +estado?: string +}[] +} +} +/** + * Lista de identificadores de banners vinculados ao hotsite + */ +"GET /hotsites/:hotsiteId/banners": { +response: { +bannerId?: number +}[] +} +/** + * Vincula um ou mais banners a um hotsite específico + */ +"POST /hotsites/:hotsiteId/banners": { +body: { +/** + * Lista de identificadores de banners para vincular ao hotsite + */ +banners?: { +/** + * Identificador do banner (optional) + */ +bannerId?: number +}[] +} +} +/** + * Desvincula um ou mais banners de um hotsite específico + */ +"DELETE /hotsites/:hotsiteId/banners": { +body: { +/** + * Lista de identificadores de banners a serem desvinculados + */ +banners?: { +/** + * Identificador do banner (optional) + */ +bannerId?: number +}[] +} +} +/** + * Estorna um valor menor ou igual ao total do pedido "Pago" + */ +"POST /pedidos/estorno/:pedidoId": { +body: { +/** + * Valor a ser estornado do pedido. Total ou parcial. + */ +Valor?: number +} +} +/** + * Pedidos que terão vínculo com o grupo de assinatura informado. + */ +"POST /assinaturas/grupoassinatura/assinatura": { +body: { +/** + * Lista de pedidos a serem vinculados a assinatura + */ +pedidos?: { +/** + * Id do pedido + */ +pedidoId?: number +}[] +/** + * ID da recorrência vinculada ao grupo, disponível em GET /assinaturas/grupoassinatura + */ +recorrenciaId?: number +/** + * ID do grupo de assinatura, disponível em GET /assinaturas/grupoassinatura + */ +grupoAssinaturaId?: number +} +} +/** + * Lista de situações de pedido + */ +"GET /situacoesPedido": { +response: { +situacaoPedidoId?: number +nome?: string +descricao?: string +observacao?: string +}[] +} +/** + * Lista de Lojas Físicas + */ +"GET /lojasFisicas": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +} +response: { +lojaId?: number +nome?: string +ddd?: number +telefone?: string +email?: string +cep?: string +logradouro?: string +numero?: string +complemento?: string +bairro?: string +cidade?: string +estadoId?: number +prazoEntrega?: number +prazoMaximoRetirada?: number +ativo?: boolean +valido?: boolean +textoComplementar?: string +retirarNaLoja?: boolean +latitude?: number +longitude?: number +centroDistribuicaoId?: number +centroDistribuicao?: { +centroDistribuicaoId?: number +prazoEntrega?: number +}[] +}[] +} +/** + * Insere uma Loja Física + */ +"POST /lojasFisicas": { +body: { +/** + * Id da loja (optional) + */ +lojaId?: number +/** + * Nome da loja (optional) + */ +nome?: string +/** + * DDD da localidade de destino da loja (optional) + */ +ddd?: number +/** + * Telefone da loja (optional) + */ +telefone?: string +/** + * E-mail de contato da loja (optional) + */ +email?: string +/** + * CEP do endereço da loja (optional) + */ +cep?: string +/** + * Logradouro do endereço da loja (optional) + */ +logradouro?: string +/** + * Número de localização do endereço da loja (optional) + */ +numero?: string +/** + * Complemento para localização da loja (optional) + */ +complemento?: string +/** + * Bairro do endereço do loja (optional) + */ +bairro?: string +/** + * Cidade em que a loja se encontra (optional) + */ +cidade?: string +/** + * Id do estado em que a loja se encontra (optional) + */ +estadoId?: number +/** + * Prazo de entrega (optional) + */ +prazoEntrega?: number +/** + * Prazo máximo para retirada (optional) + */ +prazoMaximoRetirada?: number +/** + * Status da loja (optional) + */ +ativo?: boolean +/** + * Valido (optional) + */ +valido?: boolean +/** + * Informações complementares da loja (optional) + */ +textoComplementar?: string +/** + * Se a retirada na loja será ativada (optional) + */ +retirarNaLoja?: boolean +/** + * Latitude (optional) + */ +latitude?: number +/** + * Longitude (optional) + */ +longitude?: number +/** + * Lista com os Identificadores dos centros de distribuição que serão vinculados a loja física (optional) + */ +centroDistribuicao?: { +/** + * Id do centro de distribuição + */ +centroDistribuicaoId?: number +/** + * Prazo de entrega + */ +prazoEntrega?: number +}[] +} +} +/** + * Atualiza um usuário pelo email + */ +"PUT /usuarios/:email": { +body: { +/** + * Tipo de pessoa + */ +tipoPessoa?: ("Fisica" | "Juridica") +/** + * Origem do contato + */ +origemContato?: ("Google" | "Bing" | "Jornal" | "PatrocinioEsportivo" | "RecomendacaoAlguem" | "Revista" | "SiteInternet" | "Televisao" | "Outro" | "UsuarioImportadoViaAdmin" | "PayPalExpress") +/** + * Tipo Sexo (optional) + */ +tipoSexo?: ("Undefined" | "Masculino" | "Feminino") +/** + * Nome do usuário (Max Length: 100) + */ +nome?: string +/** + * CPF do usuário caso seja pessoa física (Max Length: 50) (optional) + */ +cpf?: string +/** + * E-mail do usuário (Max Length: 100) + */ +email?: string +/** + * RG do usuário caso seja pessoa física (Max Length: 50) (optional) + */ +rg?: string +/** + * Telefone residencial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) + */ +telefoneResidencial?: string +/** + * Telefone celular do usuário. Deve ser informado o DDD junto ao número (Max Length: 50) (optional) + */ +telefoneCelular?: string +/** + * Telefone comercial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) (optional) + */ +telefoneComercial?: string +/** + * Data de nascimento (optional) + */ +dataNascimento?: string +/** + * Razão social do usuário, caso seja uma pessoa jurídica(Max Length: 100) (optional) + */ +razaoSocial?: string +/** + * CNPJ do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) + */ +cnpj?: string +/** + * Inscrição estadual do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) + */ +inscricaoEstadual?: string +/** + * Responsável(Max Length: 100) (optional) + */ +responsavel?: string +/** + * Data de criação do cadastro (optional) + */ +dataCriacao?: string +/** + * Data de atualização do cadastro (optional) + */ +dataAtualizacao?: string +/** + * Se o usuário é revendedor (optional) + */ +revendedor?: boolean +/** + * Informação cadastral (optional) + */ +listaInformacaoCadastral?: { +/** + * Chave + */ +chave?: string +/** + * Valor + */ +valor?: string +}[] +/** + * Avatar (Max Length: 50) (optional) + */ +avatar?: string +/** + * IP do usuário (Max Length: 20) (optional) + */ +ip?: string +/** + * Seta ou retorna o valor de Aprovado (optional) + */ +aprovado?: boolean +} +} +/** + * Insere um novo campo de cadastro personalizado + */ +"POST /usuarios/CadastroPersonalizado": { +body: { +/** + * Nome do campo + */ +nome?: string +/** + * Tipo do campo + */ +tipo?: ("TextoLivre" | "ValoresPredefinidos" | "RadioButton") +/** + * Se o campo será obrigatório + */ +obrigatorio?: boolean +/** + * Ordem + */ +ordem?: number +/** + * Informação para os campos (optional) + */ +valorPreDefinido?: { +/** + * Valor + */ +valor?: string +/** + * Ordem + */ +ordem?: number +}[] +} +} +/** + * Seta identificador como variante principal + */ +"PUT /produtos/:identificador/principal": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +} +/** + * Lista de inscrições + */ +"GET /webhook/inscricao": { +response: { +inscricaoId?: number +nome?: string +appUrl?: string +ativo?: boolean +emailResponsavel?: string +topico?: string[] +usuario?: string +header?: { +headerId?: number +chave?: string +valor?: string +}[] +}[] +} +/** + * Insere uma inscrição + */ +"POST /webhook/inscricao": { +body: { +/** + * Nome da inscrição + */ +nome?: string +/** + * Url para qual deve ser enviada as notificações + */ +appUrl?: string +/** + * Tópicos em que deseja se inscrever + */ +topicos: string[] +/** + * Usuário que está realizando a inscrição + */ +usuario?: string +/** + * Status da inscrição, se ativada ou desativada + */ +ativo?: boolean +/** + * E-mail do responsável para notificá-lo quando não seja possível notificá-lo pelo AppUrl informado + */ +emailResponsavel?: string +/** + * Headers que devam ser adicionados ao realizar a requisição para o AppUrl. Headers de Conteúdo como 'ContentType' não são necessário. As requisições realizada sempre serão no formato 'application/json' (optional) + */ +headers?: { +/** + * Chave do header, por exemplo: 'Authorization' + */ +chave?: string +/** + * Valor / Conteúdo do header, por exemplo: 'Basic 0G3EQWD-W324F-234SD-2421OFSD' + */ +valor?: string +}[] +} +} +/** + * Lista de produtos de um Grupo de Personalização + */ +"GET /grupospersonalizacao/:grupoPersonalizacaoId/produtos": { +response: { +produtoId?: number +nome?: string +alias?: string +}[] +} +/** + * Vincula produtos a um Grupo de Personalização + */ +"POST /grupospersonalizacao/:grupoPersonalizacaoId/produtos": { +body: { +/** + * Lista de Id dos produtos + */ +RAW_BODY: { +/** + * Id do produto + */ +produtoId?: number +}[] +} +} +/** + * Remove o vinculo de produtos de um Grupo de Personalização + */ +"DELETE /grupospersonalizacao/:grupoPersonalizacaoId/produtos": { +body: { +/** + * Lista de Id dos produtos + */ +RAW_BODY: { +/** + * Id do produto + */ +produtoId?: number +}[] +} +} +/** + * Gráfico do Faturamento + */ +"GET /dashboard/graficofaturamento": { +searchParams: { +/** + * Data inicial do faturamento que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final do faturamento que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Se o faturamento é somente da loja + */ +isLoja?: number +/** + * Id do parceiro + */ +parceiroId?: number +} +response: { +parceiroId?: number +parceiro?: string +receitaPagos?: number +transacoesPagos?: number +valorMedioPagos?: number +usuarioEnderecoEstado?: string +}[] +} +/** + * Atualiza uma informação de um produto específico + */ +"PUT /produtos/:identificador/informacoes/:informacaoId": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Titulo da informação (optional) + */ +titulo?: string +/** + * Texto da informação (optional) + */ +texto?: string +/** + * Informação se o produto variante está visível no site. + */ +exibirSite?: boolean +/** + * Tipo de informação do produto (optional) + */ +tipoInformacao?: ("Informacoes" | "Beneficios" | "Especificacoes" | "DadosTecnicos" | "Composicao" | "ModoDeUsar" | "Cuidados" | "ItensInclusos" | "Dicas" | "Video" | "Descricao" | "ValorReferente" | "PopUpReferente" | "Prescricao" | "TabelaDeMedidas" | "Spot" | "Sinopse" | "Carrinho") +} +} +/** + * Exclui uma informação de um produto + */ +"DELETE /produtos/:identificador/informacoes/:informacaoId": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +response: { +informacaoId?: number +titulo?: string +texto?: string +tipoInformacao?: string +}[] +} +/** + * Assinatura de um determinado pedido + */ +"GET /assinaturas/pedido/:pedidoId": { +response: { +assinaturaPedidoId?: number +assinaturaId?: number +grupoAssinaturaId?: number +tipoPeriodo?: string +tempoPeriodo?: number +pedidoId?: number +valor?: number +data?: string +origemPedidoEnumId?: number +produtoVarianteId?: number +}[] +} +/** + * Atualiza rastreamento parcial (Rastreamento e UrlRastreamento) + */ +"PUT /pedidos/:pedidoId/rastreamento/:pedidoRastreamentoId/parcial": { +body: { +/** + * Objeto Pedido Rastreamento + */ +RAW_BODY: { +/** + * Rastreamento (optional) + */ +rastreamento?: string +/** + * URL de Rastreamento (optional) + */ +urlRastreamento?: string +} +} +} +/** + * Access token atualizado com sucesso + */ +"POST /autenticacao/refresh": { +response: { +lojas?: string[] +accessToken?: string +dataExpiracaoAccessTokenUTC?: string +} +} +/** + * Ativa ou inativa uma inscrição + */ +"PUT /webhook/inscricao/:inscricaoId/Ativar": { +body: { +/** + * Status que deseja atualizar a inscrição. True (Ativada) ou False (desativada) + */ +ativo?: boolean +/** + * Usuário que está realizando a atualização + */ +usuario?: string +/** + * Observação que deseje fazer com relação a ativação/desativação da inscrição (optional) + */ +observacao?: string +} +} +/** + * Assinatura com erro na loja + */ +"GET /assinaturas/erros/:assinaturaId": { +response: { +assinaturaErroId?: number +assinaturaId?: number +usuarioId?: string +visualizado?: boolean +dataErro?: string +resolvido?: boolean +codigoAssinaturaErro?: number +assinaturaErroNome?: string +assinaturaErroDescricao?: string +}[] +} +/** + * Limite de crédito de um usuário específico + */ +"GET /usuarios/limiteCreditoPorEmail/:email": { +response: { +usuarioId?: number +valor?: number +saldo?: number +} +} +/** + * Retorna o histórico de situações de um pedido + */ +"GET /pedidos/:pedidoId/historicoSituacao": { +response: { +situacoes?: { +situacaoPedidoId?: number +nome?: string +dataAtualizacao?: string +}[] +} +} +/** + * Atualiza o limite de crédito para um usuário + */ +"PUT /usuarios/limiteCredito/:usuarioId": { +searchParams: { +/** + * CPF ou CNPJ do usuário + */ +cpf_cnpj?: string +/** + * Valor do limite de crédito + */ +valor?: number +} +} +/** + * Retorna a lista de produtos de um portfolio + */ +"GET /portfolios/:portfolioId/produtos": { +response: { +produtoId?: number +}[] +} +/** + * Vinculo de produtos ao portfolio + */ +"PUT /portfolios/:portfolioId/produtos": { +body: { +/** + * Lista dos Id's dos produtos + */ +RAW_BODY: { +/** + * Id do produto + */ +produtoId?: number +}[] +} +} +/** + * Insere um rastreamento e status a um produto variante + */ +"POST /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento": { +body: { +/** + * Id da situação do pedido + */ +situacaoPedidoId?: number +/** + * Quantidade (optional) + */ +quantidade?: number +/** + * Id do centro de distribuição + */ +centroDistribuicaoId?: number +/** + * Rastreamento (optional) + */ +rastreamento?: string +/** + * Data (optional) + */ +dataEvento?: string +/** + * Número da nota fiscal (optional) + */ +numeroNotaFiscal?: string +/** + * Chave de acesso NFE (optional) + */ +chaveAcessoNFE?: string +/** + * URL NFE (optional) + */ +urlNFE?: string +/** + * Serie NFE (optional) + */ +serieNFE?: string +/** + * CFOP (optional) + */ +cfop?: number +/** + * URL de rastreamento (optional) + */ +urlRastreamento?: string +} +} +/** + * Usuários encontrados + */ +"GET /parceiros/:parceiroId/usuarios": { +response: { +usuarioId?: number +email?: string +ativo?: boolean +dataInicial?: string +dataFinal?: string +vinculoVitalicio?: boolean +}[] +} +/** + * Dados de transação do pedido + */ +"GET /pedidos/transacoes/:transacaoId": { + +} +/** + * Operação realizada com ou sem sucesso para os usuários + */ +"PUT /usuarios/autorizar": { +searchParams: { +/** + * Tipo de Identificador + */ +tipoIdentificador?: ("UsuarioId" | "Email") +} +body: { +/** + * Usuários + */ +RAW_BODY?: { +/** + * Identificador + */ +identificador?: string +/** + * Status de aprovação + */ +aprovado?: boolean +}[] +} +response: { +usuariosAtualizados?: string[] +usuariosNaoAtualizados?: string[] +} +} +/** + * Atualiza a data de cadastro um produto com base nos dados enviados + */ +"PUT /produtos/:identificador/DataCadastro": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Data de cadastro de um produto - Formato: aaaa-mm-dd hh:mm:ss + */ +dataCadastro?: string +} +response: { +produtoVarianteId?: number +produtoId?: number +idPaiExterno?: string +idVinculoExterno?: string +sku?: string +nome?: string +nomeProdutoPai?: string +urlProduto?: string +exibirMatrizAtributos?: string +contraProposta?: boolean +fabricante?: string +autor?: string +editora?: string +colecao?: string +genero?: string +precoCusto?: number +precoDe?: number +precoPor?: number +fatorMultiplicadorPreco?: number +prazoEntrega?: number +valido?: boolean +exibirSite?: boolean +freteGratis?: string +trocaGratis?: boolean +peso?: number +altura?: number +comprimento?: number +largura?: number +garantia?: number +isTelevendas?: boolean +ean?: string +localizacaoEstoque?: string +listaAtacado?: { +precoPor?: number +quantidade?: number +}[] +estoque?: { +estoqueFisico?: number +estoqueReservado?: number +centroDistribuicaoId?: number +alertaEstoque?: number +}[] +atributos?: { +tipoAtributo?: string +isFiltro?: boolean +nome?: string +valor?: string +exibir?: boolean +}[] +quantidadeMaximaCompraUnidade?: number +quantidadeMinimaCompraUnidade?: number +condicao?: string +informacoes?: { +informacaoId?: number +titulo?: string +texto?: string +tipoInformacao?: string +}[] +tabelasPreco?: { +tabelaPrecoId?: number +nome?: string +precoDe?: number +precoPor?: number +}[] +dataCriacao?: string +dataAtualizacao?: string +urlVideo?: string +spot?: boolean +paginaProduto?: boolean +marketplace?: boolean +somenteParceiros?: boolean +reseller?: { +resellerId?: number +razaoSocial?: string +centroDistribuicaoId?: number +ativo?: boolean +ativacaoAutomaticaProdutos?: boolean +autonomia?: boolean +buyBox?: boolean +nomeMarketPlace?: string +} +buyBox?: boolean +} +} +/** + * Atualiza a situação do status de um produto do pedido + */ +"PUT /pedidos/:pedidoId/:produtoVarianteId/status": { +body: { +/** + * Dados da situação do produto (optional) + */ +RAW_BODY: { +/** + * Id do centro de distribuição do produto + */ +centroDistribuicaoId?: number +/** + * Quantidade de produtos do centro de distribuição + */ +quantidade?: number +/** + * Novo status da situação do produto (são os mesmo status do pedido) + */ +situacaoPedidoProdutoId?: number +} +} +} +/** + * Indicadores dos Produtos no Estoque + */ +"GET /dashboard/produtoestoque": { +searchParams: { +/** + * Data inicial dos produtos no estoque que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos produtos no estoque que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +} +response: { +indicadorProdutoComEstoque?: string +indicadorProdutoSemEstoque?: string +} +} +/** + * Atualiza um endereço de um usuário pelo e-mail do usuário + */ +"PUT /usuarios/:email/enderecos/:enderecoId": { +body: { +/** + * Nome de identificação do endereço a ser cadastrado (Max Length: 100) + */ +nomeEndereco?: string +/** + * Nome da rua (Max Length: 500) + */ +rua?: string +/** + * Número do local (Max Length: 50) + */ +numero?: string +/** + * Complemento (Max Length: 250) (optional) + */ +complemento?: string +/** + * Referência para a localização do endereço (Max Length: 500) (optional) + */ +referencia?: string +/** + * Bairro do endereço (Max Length: 100) + */ +bairro?: string +/** + * Cidade em que se localiza o endereço (Max Length: 100) + */ +cidade?: string +/** + * O estado (Max Length: 100) + */ +estado?: string +/** + * Código do cep (Max Length: 50) + */ +cep?: string +} +} +/** + * Atualiza o status de uma avaliação de um produto variante + */ +"PUT /produtoavaliacao/:produtoAvaliacaoId/status": { +body: { +/** + * Status para a avaliação + */ +status?: ("Pendente" | "NaoAprovado" | "Aprovado") +} +} +/** + * Fabricante encontrado + */ +"GET /fabricantes/:nome": { +response: { +fabricanteId?: number +ativo?: boolean +nome?: string +urlLogoTipo?: string +urlLink?: string +urlCarrossel?: string +} +} +/** + * Lista de parceiros vinculados ao banner + */ +"GET /banners/:bannerId/parceiros": { + +} +/** + * Vincula parceiros com um banner específico + */ +"POST /banners/:bannerId/parceiros": { +body: { +/** + * Lista de Id dos parceiros + */ +RAW_BODY: { +/** + * Id do parceiro (optional) + */ +parceiroId?: number +}[] +} +} +/** + * Deleta o vinculo de um ou mais parceiros com um banner específico + */ +"DELETE /banners/:bannerId/parceiros": { +body: { +/** + * Lista de identificadores de parceiros para desvincular do banner + */ +listaParceiros?: { +/** + * Id do parceiro (optional) + */ +parceiroId?: number +}[] +} +} +/** + * Lista de tabelas de preços + */ +"GET /tabelaPrecos": { +response: { +tabelaPrecoId?: number +nome?: string +dataInicial?: string +dataFinal?: string +ativo?: boolean +isSite?: boolean +}[] +} +/** + * Insere uma nova tabela de preços + */ +"POST /tabelaPrecos": { +body: { +/** + * Nome da tabela de preço + */ +nome?: string +/** + * Data que inicia a tabela de preço + */ +dataInicial?: string +/** + * Data de término da tabela de preço + */ +dataFinal?: string +/** + * Status da tabela de preço + */ +ativo?: boolean +} +} +/** + * Atualiza a imagem do banner + */ +"PUT /banners/:bannerId/Imagem": { +body: { +/** + * URL da Imagem (optional) + */ +urlImagem?: string +/** + * Informações para atualizar a imagem (optional) + */ +Imagem?: { +/** + * string da imagem em base 64 + */ +base64?: string +/** + * formato da imagem + */ +formato?: ("PNG" | "JPG" | "JPEG") +/** + * nome da imagem + */ +nome?: string +} +} +} +/** + * Exclui o vínculo entre uma categoria e um produto + */ +"DELETE /produtos/:identificador/categorias/:id": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +} +/** + * Xml com os dados de uma mídia específicas entre duas datas + */ +"GET /midias/:identificador": { +searchParams: { +/** + * Data inicial (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final (aaaa-mm-dd) + */ +dataFinal?: string +} +response: { +dias?: { +diaMidiaApiModel?: { +dia?: string +investimento?: { +meta?: number +realizado?: number +} +pedidos?: { +meta?: number +realizado?: number +} +roi?: { +meta?: number +realizado?: number +} +receita?: { +meta?: number +realizado?: number +} +visitas?: { +meta?: number +realizado?: number +} +}[] +} +id?: number +nome?: string +tipo?: string +} +} +/** + * Lista de hotsites + */ +"GET /hotsites": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadePorPagina?: number +} +response: { +hotsiteId?: number +nome?: string +ativo?: boolean +template?: string +dataCriacao?: string +dataInicio?: string +dataFinal?: string +url?: string +tamanhoPagina?: number +templateId?: number +ordenacao?: string +listaProdutos?: { +expressao?: string +produtos?: { +produtoId?: number +ordem?: number +}[] +} +seo?: { +seoHotsiteId?: number +hotsiteId?: number +titulo?: string +metas?: { +conteudo?: string +nome?: string +httpEquiv?: string +scheme?: string +}[] +} +banners?: { +bannerId?: number +}[] +conteudos?: { +conteudoId?: number +}[] +}[] +} +/** + * A lista de produtos para serem exibidos no hotsite está limitada a 1024 itens, tanto por expressão como por produtos. + */ +"POST /hotsites": { +body: { +/** + * Nome do hotsite + */ +nome?: string +/** + * Data/hora em que o hotsite começará a ser exibido (optional) + */ +dataInicio?: string +/** + * Data/Hora (último dia) em que o hotsite não será mais exibido (optional) + */ +dataFinal?: string +/** + * Informe a url do hotsite. Por exemplo, se o site for 'busca.meusite.com.br', e o hotsite desejado for 'busca.meusite.com.br/hotsite/natal' informe neste campo somente a url 'hotsite/natal', sem a barra '/' no início + */ +url?: string +/** + * Informe o número de produtos que deve ser exibido por página + */ +tamanhoPagina?: number +/** + * Informe o identificador do template que será utilizado. Caso não saiba o identificador do template desejado, o mesmo pode ser buscado no endpoint GET/Templates + */ +templateId?: number +/** + * Informe qual será a ordenação dos Produtos no Hotsite (optional) + */ +ordenacao?: ("Nenhuma" | "NomeCrescente" | "NomeDecrescente" | "Lancamento" | "MenorPreco" | "MaiorPreco" | "MaisVendidos" | "MaioresDescontos" | "Aleatorio" | "MenorEstoque" | "MaiorEstoque") +/** + * Produtos que devem aparecer no hotsite + */ +listaProdutos?: { +/** + * você pode utilizar essa opção para gerar um hotsite utilizando uma expressão de busca. Ao utilizá-la, os produtos adicionados nos outros modos de criação de hotsite serão ignorados (optional) + */ +expressao?: string +/** + * Id dos produtos + */ +produtos?: { +/** + * Identificador do produto a ser mostrado no hotsite + */ +produtoId?: number +/** + * Ordem para apresentação do produto (optional) + */ +ordem?: number +}[] +} +/** + * Dados de seo (optional) + */ +seo?: { +/** + * Informe o Título que será exibido quando o Hotsite for acessado (optional) + */ +titulo?: string +/** + * Não se esqueça! Além do texto livre, você pode utilizar as tags [Nome.Hotsite] e [Fbits.NomeLoja] para o cadastro das MetaTags e Title! (optional) + */ +metas?: { +/** + * Informe os dados da Metatag + */ +conteudo?: string +/** + * Informe os dados da Metatag + */ +nome?: string +/** + * Informe os dados da Metatag + */ +httpEquiv?: string +/** + * Informe os dados da Metatag + */ +scheme?: string +}[] +} +/** + * Lista de identificadores de banners a serem vinculados ao hotsite (optional) + */ +banners?: { +/** + * Identificador do banner (optional) + */ +bannerId?: number +}[] +/** + * Lista de identificadores de conteúdos a serem vinculados ao hotsite + */ +conteudos?: { +/** + * Identificador do conteúdo + */ +conteudoId?: number +}[] +/** + * Status do hotsite (optional) + */ +ativo?: boolean +} +} +/** + * Lista de pedidos + */ +"GET /pedidos/situacaoPedido/:situacoesPedido": { +searchParams: { +/** + * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final dos pedidos que deverão retonar (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +/** + * Tipo de filtro da data (Ordenação "desc" - padrão: DataPedido) + */ +enumTipoFiltroData?: ("DataPedido" | "DataAprovacao" | "DataModificacaoStatus" | "DataAlteracao" | "DataCriacao") +/** + * Lista de formas de pagamento que deverão retornar (lista separada por "," ex.: 1,2,3), caso vazio retornará todas as formas de pagamento + */ +formasPagamento?: string +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +/** + * Quando passado o valor true, deverá retornar apenas pedidos de assinatura. Quando falso, deverá retornar todos os pedidos. + */ +apenasAssinaturas?: boolean +} +response: { +pedidoId?: number +situacaoPedidoId?: number +tipoRastreamentoPedido?: string +transacaoId?: number +data?: string +dataPagamento?: string +dataUltimaAtualizacao?: string +valorFrete?: number +valorTotalPedido?: number +valorDesconto?: number +valorDebitoCC?: number +cupomDesconto?: string +marketPlacePedidoId?: string +marketPlacePedidoSiteId?: string +canalId?: number +canalNome?: string +canalOrigem?: string +retiradaLojaId?: number +isPedidoEvento?: boolean +usuario?: { +usuarioId?: number +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +} +pedidoEndereco?: { +tipo?: string +nome?: string +endereco?: string +numero?: string +complemento?: string +referencia?: string +cep?: string +tipoLogradouro?: string +logradouro?: string +bairro?: string +cidade?: string +estado?: string +pais?: string +}[] +frete?: { +freteContratoId?: number +freteContrato?: string +referenciaConector?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +retiradaLojaId?: number +centrosDistribuicao?: { +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +servico?: { +servicoId?: number +nome?: string +transportadora?: string +prazo?: number +servicoNome?: string +preco?: number +servicoTransporte?: number +codigo?: number +servicoMeta?: string +custo?: number +token?: string +} +retiradaAgendada?: { +lojaId?: number +retiradaData?: string +retiradaPeriodo?: string +nome?: string +documento?: string +codigoRetirada?: string +} +agendamento?: { +de?: string +ate?: string +} +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +} +itens?: { +produtoVarianteId?: number +sku?: string +nome?: string +quantidade?: number +precoCusto?: number +precoVenda?: number +isBrinde?: boolean +valorAliquota?: number +isMarketPlace?: boolean +precoPor?: number +desconto?: number +totais?: { +precoCusto?: number +precoVenda?: number +precoPor?: number +desconto?: number +} +ajustes?: { +tipo?: string +valor?: number +observacao?: string +nome?: string +}[] +centroDistribuicao?: { +centroDistribuicaoId?: number +quantidade?: number +situacaoProdutoId?: number +valorFreteEmpresa?: number +valorFreteCliente?: number +}[] +valoresAdicionais?: { +tipo?: string +origem?: string +texto?: string +valor?: number +}[] +atributos?: { +produtoVarianteAtributoValor?: string +produtoVarianteAtributoNome?: string +}[] +embalagens?: { +tipoEmbalagemId?: number +nomeTipoEmbalagem?: string +mensagem?: string +valor?: number +descricao?: string +}[] +personalizacoes?: { +nomePersonalizacao?: string +valorPersonalizacao?: string +valor?: number +}[] +frete?: { +quantidade?: number +freteContratoId?: number +freteContrato?: string +valorFreteEmpresa?: number +valorFreteCliente?: number +peso?: number +pesoCobrado?: number +volume?: number +volumeCobrado?: number +prazoEnvio?: number +prazoEnvioTexto?: string +centroDistribuicaoId?: number +}[] +dadosProdutoEvento?: { +tipoPresenteRecebimento?: string +} +formulas?: { +chaveAjuste?: string +valor?: number +nome?: string +expressao?: string +expressaoInterpretada?: string +endPoint?: string +}[] +seller?: { +sellerId?: number +sellerNome?: string +sellerPedidoId?: number +} +}[] +assinatura?: { +assinaturaId?: number +grupoAssinaturaId?: number +tipoPeriodo?: string +tempoPeriodo?: number +percentualDesconto?: number +}[] +pagamento?: { +formaPagamentoId?: number +numeroParcelas?: number +valorParcela?: number +valorDesconto?: number +valorJuros?: number +valorTotal?: number +boleto?: { +urlBoleto?: string +codigoDeBarras?: string +} +cartaoCredito?: { +numeroCartao?: string +nomeTitular?: string +dataValidade?: string +codigoSeguranca?: string +documentoCartaoCredito?: string +token?: string +info?: string +bandeira?: string +}[] +pagamentoStatus?: { +numeroAutorizacao?: string +numeroComprovanteVenda?: string +dataAtualizacao?: string +dataUltimoStatus?: string +adquirente?: string +tid?: string +}[] +informacoesAdicionais?: { +chave?: string +valor?: string +}[] +}[] +observacao?: { +observacao?: string +usuario?: string +data?: string +publica?: boolean +}[] +valorCreditoFidelidade?: number +valido?: boolean +valorSubTotalSemDescontos?: number +pedidoSplit?: number[] +}[] +} +/** + * Portfolio encontrado + */ +"GET /portfolios/:nome": { +response: { +portfolioId?: number +nome?: string +ativo?: boolean +} +} +/** + * Lista de categorias de um produto + */ +"GET /produtos/:identificador/categorias": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId" | "ProdutoId") +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadRegistros?: number +} +response: { +id?: number +nome?: string +categoriaPaiId?: number +categoriaERPId?: string +ativo?: boolean +isReseller?: boolean +exibirMatrizAtributos?: string +quantidadeMaximaCompraUnidade?: number +valorMinimoCompra?: number +exibeMenu?: boolean +urlHotSite?: string +caminhoHierarquia?: string +categoriaPrincipal?: boolean +}[] +} +/** + * Adiciona o vínculo entre um produto e uma categoria com base na lista enviada + */ +"POST /produtos/:identificador/categorias": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Id da Categoria Principal (optional) + */ +categoriaPrincipalId?: number +/** + * Id da categoria a qual o produto deverá ser vinculado (optional) + */ +listaCategoriaId?: number[] +} +} +/** + * Lista de Atacarejos + */ +"GET /produtos/:identificador/atacarejo": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +response: { +produtoVarianteAtacadoId?: number +precoAtacado?: number +quantidade?: number +}[] +} +/** + * Adiciona novos Atacarejos + */ +"POST /produtos/:identificador/atacarejo": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Lista de Atacarejos (optional) + */ +RAW_BODY: { +/** + * Preço atacado + */ +precoAtacado?: number +/** + * Quantidade do produto + */ +quantidade?: number +}[] +} +response: { +produtoVarianteAtacadoId?: number +precoAtacado?: number +quantidade?: number +}[] +} +/** + * Recorrências cadastradas na loja + */ +"GET /assinaturas/recorrencias": { +response: { +recorrencias?: string[] +} +} +/** + * Atualiza rastreamento completo (com os dados da N.F.) + */ +"PUT /pedidos/:pedidoId/rastreamento/:pedidoRastreamentoId": { +body: { +/** + * Objeto Pedido Rastreamento + */ +RAW_BODY: { +/** + * Número da nota fiscal + */ +notaFiscal?: string +/** + * Código Fiscal de Operações e Prestações + */ +cfop?: number +/** + * Data Envio + */ +dataEnviado?: string +/** + * Chave de Acesso NFE + */ +chaveAcessoNFE?: string +/** + * Rastreamento (optional) + */ +rastreamento?: string +/** + * URL de rastreamento (optional) + */ +urlRastreamento?: string +/** + * Transportadora (optional) + */ +transportadora?: string +/** + * Data da entrega (optional) + */ +dataEntrega?: string +} +} +} +/** + * Atualiza a prioridade de um centro de distribuição + */ +"PUT /centrosdistribuicao/:centroDistribuicaoId/prioridade": { +body: { +/** + * (optional) + */ +incrementoOrdem?: number +/** + * (optional) + */ +desativarPriorizacao?: boolean +} +response: { + +} +} +/** + * Conteúdos encontrados + */ +"GET /conteudos": { +searchParams: { +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadePorPagina?: number +} +response: { +conteudoId?: number +titulo?: string +ativo?: boolean +dataInicio?: string +dataFim?: string +posicionamento?: string +codigoFonte?: string +termoBusca?: string +exibeTodasBuscas?: boolean +naoExibeBuscas?: boolean +exibeTodosHotsites?: boolean +hotsitesId?: number[] +}[] +} +/** + * Insere um novo conteúdo na loja + */ +"POST /conteudos": { +body: { +/** + * Titulo do conteúdo + */ +titulo?: string +/** + * Conteúdo ativo/inativo + */ +ativo?: boolean +/** + * Data de inicio de exibição do conteúdo (optional) + */ +dataInicio?: string +/** + * Data final de exibição do conteúdo (optional) + */ +dataFim?: string +/** + * Posicionamento do conteúdo + */ +posicionamento?: ("Topo" | "Centro" | "Rodape" | "LateralDireita" | "LateralEsquerda" | "MobileTopo" | "MobileRodape") +/** + * Informações do conteúdo + */ +conteudo?: string +/** + * Insira em qual Termo de Busca o Conteúdo será exibido (optional) + */ +termoBusca?: string +/** + * Exibição do conteúdo nas buscas + */ +exibeTodasBuscas?: boolean +/** + * Não exibição do conteúdo nas buscas + */ +naoExibeBuscas?: boolean +/** + * Exibição do conteúdo nos hotsites + */ +exibeTodosHotsites?: boolean +/** + * Insira quais Hotsites que o Conteúdo será exibido (optional) + */ +hotsitesId?: number[] +} +} +/** + * Atualiza a imagem de estampa do produto + */ +"PUT /produtos/:identificador/imagens/estampa": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Id da imagem que será marcada como estampa + */ +idImagem?: number +} +} +/** + * Retorna lista de usuários cadastrados/descadastrados na newsletter (50 por página) + */ +"GET /usuarios/newsletter": { +searchParams: { +/** + * Tipo de ordenação + */ +ordenarPor?: ("DataCadastro" | "DataAtualizacao") +/** + * Data inicial dos cadastros que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final dos cadastros que deverão retornar (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Status do usuário + */ +status?: boolean +/** + * DoubleOptIn aceito (verificar estado da configuração) + */ +doubleOptIn?: boolean +} +response: { +nome?: string +email?: string +sexo?: string +status?: boolean +grupoInformacao?: { +nome?: string +valor?: string +}[] +}[] +} +/** + * Ativa ou desativa um endereço de um usuário com base no e-mail do usuário + */ +"PUT /usuarios/:email/enderecos/:enderecoId/ativar": { +body: { +/** + * Status do endereço + */ +status?: boolean +} +} +/** + * Insere uma avaliação para um produto variante + */ +"POST /produtoavaliacao/:identificador": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno da fstore + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Texto referente a avaliação do produto + */ +comentario?: string +/** + * Escala de 1 a 5 para avaliar o produto + */ +avaliacao?: number +/** + * Identificado do usuário + */ +usuarioId?: number +/** + * Referente a data que a avaliação foi criada + */ +dataAvaliacao?: string +/** + * Nome do usuário que avaliou + */ +nome?: string +/** + * Email do usuário que avaliou + */ +email?: string +/** + * Referente ao status que libera a visualização da avaliação no site + */ +status?: ("Pendente" | "NaoAprovado" | "Aprovado") +} +} +/** + * Relatório de receitas de um determinado período + */ +"GET /dashboard/receita": { +searchParams: { +/** + * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos pedidos que deverão retornar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Tipo de agrupamento dos pedidos (hora, dia, semana, mês, ano) + */ +tipoAgrupamento?: ("Hora" | "Dia" | "Semana" | "Mes" | "Ano") +} +response: { +tipoAgrupamento?: string +dados?: { +data?: string +pedidosCaptados?: number +pedidosPagos?: number +pedidosEnviados?: number +pedidosCancelados?: number +}[] +} +} +/** + * Lista de fretes + */ +"GET /fretes": { +response: { +freteId?: number +nome?: string +ativo?: boolean +volumeMaximo?: number +pesoCubado?: number +entregaAgendadaConfiguracaoId?: number +linkRastreamento?: string +ehAssinatura?: boolean +larguraMaxima?: number +alturaMaxima?: number +comprimentoMaximo?: number +limiteMaximoDimensoes?: number +limitePesoCubado?: number +tempoMinimoDespacho?: number +centroDistribuicaoId?: number +valorMinimoProdutos?: number +}[] +} +/** + * Insere um novo contrato de frete + */ +"POST /fretes": { +body: { +/** + * Nome do contrato de frete (optional) + */ +nome?: string +/** + * Status do contrato de frete (optional) + */ +ativo?: boolean +/** + * Volume máximo permitido , em metro cúbico (m³). (optional) + */ +volumeMaximo?: number +/** + * Informe o peso cubado. Altura x largura x profundidade x fator de cubagem. (optional) + */ +pesoCubado?: number +/** + * Id da configuração entrega agendada (optional) + */ +entregaAgendadaConfiguracaoId?: number +/** + * URL rastreamento (optional) + */ +linkRastreamento?: string +/** + * Contrato é exclusivo assinatura (optional) + */ +ehAssinatura?: boolean +/** + * Informe a largura máxima, em centímetros (cm). (optional) + */ +larguraMaxima?: number +/** + * Informe a altura máxima, em centímetros (cm). (optional) + */ +alturaMaxima?: number +/** + * Informe o comprimento máximo, em centímetros (cm). (optional) + */ +comprimentoMaximo?: number +/** + * Informe a soma das três dimensões (Largura + Altura + Comprimento), em centímetros (cm). (optional) + */ +limiteMaximoDimensoes?: number +/** + * Informe o limite de peso cubado, em gramas (g). (optional) + */ +limitePesoCubado?: number +/** + * Informe quantos dias no mínimo esse contrato de frete leva para ser enviado ao cliente (optional) + */ +tempoMinimoDespacho?: number +/** + * Informe o Id do centro de distribuição (optional) + */ +centroDistribuicaoId?: number +/** + * Informe o valor mínimo em produtos necessário para disponibilidade da tabela de frete (optional) + */ +valorMinimoProdutos?: number +} +} +/** + * Detalhes de uma assinatura + */ +"GET /assinaturas/:assinaturaId": { +response: { +assinaturaId?: number +usuarioId?: number +dataProximoPedido?: string +periodoRecorrencia?: string +situacaoAssinatura?: string +dataAssinatura?: string +grupoAssinatura?: string +enderecoId?: number +usuarioCartaoCreditoId?: number +cupom?: string +produtos?: { +assinaturaProdutoId?: number +assinaturaId?: number +produtoId?: number +produtoVarianteId?: number +quantidade?: number +valor?: number +removido?: boolean +}[] +} +} +/** + * Atualiza a situação de uma assinatura específica + */ +"PUT /assinaturas/:assinaturaId": { +body: { +/** + * Id do endereço (optional) + */ +enderecoId?: number +/** + * Id do cartão de crédito do usuário (optional) + */ +usuarioCartaoCreditoId?: number +/** + * Período Recorrência (optional) + */ +periodoRecorrencia?: string +/** + * Situação da Assinatura (optional) + */ +situacaoAssinatura?: ("Ativa" | "Pausada" | "Cancelada") +/** + * Cupom (optional) + */ +cupom?: string +} +} +/** + * Buscar autor pelo nome + */ +"GET /autores/:nomeAutor": { + +} +/** + * Lista o conteúdo de uma versão + */ +"GET /gestorscripts/scripts/:scriptId/versao/:versaoId/conteudo": { +response: { +scriptId?: number +versaoId?: number +conteudo?: string +}[] +} +/** + * Altera a data de recorrência de uma assinatura + */ +"PUT /assinaturas/:assinaturaId/proximaRecorrencia": { +body: { +/** + * Data da próxima recorrência (Será considerado apenas o dia, mês e ano. Hora e minutos não serão considerados) + */ +proximaRecorrencia?: string +} +} +/** + * Lista de parceiros com pedidos + */ +"GET /parceiros/comPedidos": { +searchParams: { +/** + * Data inicial dos pedidos (aaaa-mm-dd hh:mm:ss) + */ +dataInicial?: string +/** + * Data final dos pedidos (aaaa-mm-dd hh:mm:ss) + */ +dataFinal?: string +} +response: { +parceiroId?: number +marketPlaceId?: number +nome?: string +tabelaPrecoId?: number +portfolioId?: number +tipoEscopo?: string +ativo?: boolean +isMarketPlace?: boolean +origem?: string +}[] +} +/** + * Usuário encontrado + */ +"GET /usuarios/cnpj/:cnpj": { +response: { +usuarioId?: number +bloqueado?: boolean +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +avatar?: string +ip?: string +aprovado?: boolean +} +} +/** + * Deleta um produto da lista de sugestões de produtos de um tipo de evento + */ +"DELETE /tiposEvento/:tipoEventoId/produto/:produtoVarianteId": { + +} +/** + * Deleta o vinculo de um produto a um evento + */ +"DELETE /eventos/:eventoId/produto/:produtoVarianteId": { +response: string +} +/** + * Define uma categoria de um produto como principal + */ +"PUT /produtos/:identificador/categoriaPrincipal": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Id da categoria + */ +categoriaId?: number +} +} +/** + * Atualiza o estoque de vários produtos com base na lista enviada. Limite de 50 produtos por requisição + */ +"PUT /produtos/estoques": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +body: { +/** + * Lista com os dados da atualização do estoque (optional) + */ +RAW_BODY: { +/** + * Valor único utilizado para identificar o produto + */ +identificador?: string +/** + * Prazo de entrega do produto + */ +prazoEntrega?: number +/** + * Lista com os dados da atualização do estoque + */ +listaEstoque?: { +/** + * Estoque físico do produto + */ +estoqueFisico?: number +/** + * Estoque reservado do produto + */ +estoqueReservado?: number +/** + * Id do centro de distribuição do estoque do produto + */ +centroDistribuicaoId?: number +/** + * Id do produto variante + */ +produtoVarianteId?: number +/** + * Quantidade para ativar o alerta de estoque + */ +alertaEstoque?: number +}[] +}[] +} +response: { +produtosNaoAtualizados?: { +produtoVarianteId?: number +sku?: string +centroDistribuicaoId?: number +resultado?: boolean +detalhes?: string +}[] +produtosAtualizados?: { +produtoVarianteId?: number +sku?: string +centroDistribuicaoId?: number +resultado?: boolean +detalhes?: string +}[] +} +} +/** + * Objeto com o estoque total e o estoque por centro de distribuição de um produto variante + */ +"GET /produtos/:identificador/estoque": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +response: { +estoqueFisico?: number +estoqueReservado?: number +listProdutoVarianteCentroDistribuicaoEstoque?: { +centroDistribuicaoId?: number +nome?: string +estoqueFisico?: number +estoqueReservado?: number +}[] +} +} +/** + * Usuário encontrado + */ +"GET /usuarios/usuarioId/:usuarioId": { +response: { +usuarioId?: number +bloqueado?: boolean +grupoInformacaoCadastral?: { +chave?: string +valor?: string +}[] +tipoPessoa?: string +origemContato?: string +tipoSexo?: string +nome?: string +cpf?: string +email?: string +rg?: string +telefoneResidencial?: string +telefoneCelular?: string +telefoneComercial?: string +dataNascimento?: string +razaoSocial?: string +cnpj?: string +inscricaoEstadual?: string +responsavel?: string +dataCriacao?: string +dataAtualizacao?: string +revendedor?: boolean +listaInformacaoCadastral?: { +chave?: string +valor?: string +}[] +avatar?: string +ip?: string +aprovado?: boolean +} +} +/** + * Produtos Mais Vendidos + */ +"GET /dashboard/produtos": { +searchParams: { +/** + * Data inicial dos produtos mais vendidos que deverão retonar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos produtos mais vendidos que deverão retonar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Id do parceiro + */ +parceiroId?: number +} +response: { +produtoVarianteId?: number +nomeProduto?: string +sku?: string +quantidade?: number +receita?: string +}[] +} +/** + * Atualiza rastreamento parcial (Rastreamento e UrlRastreamento) + */ +"PUT /pedidos/:pedidoId/produtos/:produtoVarianteId/rastreamento/:pedidoRastreamentoProdutoId/parcial": { +body: { +/** + * Objeto Pedido Rastreamento Produto + */ +RAW_BODY: { +/** + * Rastreamento (optional) + */ +rastreamento?: string +/** + * URL de Rastreamento (optional) + */ +urlRastreamento?: string +} +} +} +/** + * Atualiza o status do banner pelo id + */ +"PUT /banners/:bannerId/status": { +body: { +/** + * Status para qual deve ir o baner: Ativo (true) ou Inativo (false) + */ +status?: boolean +} +} +/** + * Atualiza um endereço de um usuário pelo id do usuário + */ +"PUT /usuarios/:usuarioId/enderecos/:enderecoId": { +body: { +/** + * Nome de identificação do endereço a ser cadastrado (Max Length: 100) + */ +nomeEndereco?: string +/** + * Nome da rua (Max Length: 500) + */ +rua?: string +/** + * Número do local (Max Length: 50) + */ +numero?: string +/** + * Complemento (Max Length: 250) (optional) + */ +complemento?: string +/** + * Referência para a localização do endereço (Max Length: 500) (optional) + */ +referencia?: string +/** + * Bairro do endereço (Max Length: 100) + */ +bairro?: string +/** + * Cidade em que se localiza o endereço (Max Length: 100) + */ +cidade?: string +/** + * O estado (Max Length: 100) + */ +estado?: string +/** + * Código do cep (Max Length: 50) + */ +cep?: string +} +} +/** + * Lista de avaliações de produtos + */ +"GET /produtos/:identificador/avaliacoes": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +/** + * Referente ao status que libera a visualização da avaliação no site = ['Pendente', 'NaoAprovado', 'Aprovado'] + */ +status?: ("Pendente" | "NaoAprovado" | "Aprovado") +/** + * Página da lista (padrão: 1) + */ +pagina?: number +/** + * Quantidade de registros que deverão retornar (max: 50) + */ +quantidadeRegistros?: number +} +response: { +produtoVarianteId?: number +sku?: string +produtoAvaliacaoId?: number +comentario?: string +avaliacao?: number +usuarioId?: number +dataAvaliacao?: string +nome?: string +email?: string +status?: string +}[] +} +/** + * Atualiza um usuário pelo id + */ +"PUT /usuarios/:usuarioId": { +body: { +/** + * Tipo de pessoa + */ +tipoPessoa?: ("Fisica" | "Juridica") +/** + * Origem do contato + */ +origemContato?: ("Google" | "Bing" | "Jornal" | "PatrocinioEsportivo" | "RecomendacaoAlguem" | "Revista" | "SiteInternet" | "Televisao" | "Outro" | "UsuarioImportadoViaAdmin" | "PayPalExpress") +/** + * Tipo Sexo (optional) + */ +tipoSexo?: ("Undefined" | "Masculino" | "Feminino") +/** + * Nome do usuário (Max Length: 100) + */ +nome?: string +/** + * CPF do usuário caso seja pessoa física (Max Length: 50) (optional) + */ +cpf?: string +/** + * E-mail do usuário (Max Length: 100) + */ +email?: string +/** + * RG do usuário caso seja pessoa física (Max Length: 50) (optional) + */ +rg?: string +/** + * Telefone residencial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) + */ +telefoneResidencial?: string +/** + * Telefone celular do usuário. Deve ser informado o DDD junto ao número (Max Length: 50) (optional) + */ +telefoneCelular?: string +/** + * Telefone comercial do usuário. Deve ser informado o DDD junto ao número(Max Length: 50) (optional) + */ +telefoneComercial?: string +/** + * Data de nascimento (optional) + */ +dataNascimento?: string +/** + * Razão social do usuário, caso seja uma pessoa jurídica(Max Length: 100) (optional) + */ +razaoSocial?: string +/** + * CNPJ do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) + */ +cnpj?: string +/** + * Inscrição estadual do usuário, caso seja uma pessoa jurídica(Max Length: 50) (optional) + */ +inscricaoEstadual?: string +/** + * Responsável(Max Length: 100) (optional) + */ +responsavel?: string +/** + * Data de criação do cadastro (optional) + */ +dataCriacao?: string +/** + * Data de atualização do cadastro (optional) + */ +dataAtualizacao?: string +/** + * Se o usuário é revendedor (optional) + */ +revendedor?: boolean +/** + * Informação cadastral (optional) + */ +listaInformacaoCadastral?: { +/** + * Chave + */ +chave?: string +/** + * Valor + */ +valor?: string +}[] +/** + * Avatar (Max Length: 50) (optional) + */ +avatar?: string +/** + * IP do usuário (Max Length: 20) (optional) + */ +ip?: string +/** + * Seta ou retorna o valor de Aprovado (optional) + */ +aprovado?: boolean +} +} +/** + * Liberar reservas de pedidos + */ +"POST /pedidos/liberarReservas": { +body: { +/** + * Números dos pedidos que se deseja buscar + */ +RAW_BODY: number[] +} +} +/** + * Atualiza para o mesmo preço, todos os variantes de um produto encontrado com o SKU informado. Limite de 50 produtos por requisição + */ +"PUT /produtos/precos/lote": { +body: { +/** + * Lista com os dados da atualização do preço por lote + */ +RAW_BODY: { +/** + * Identificador do produto (SKU) + */ +sku?: string +/** + * Preço de custo do produto variante. Se passado 0 irá setar os valores para zero, se for NULO, não irá atualizar o preço de custo (optional) + */ +precoCusto?: number +/** + * "PrecoDe" do produto variante + */ +precoDe?: number +/** + * "PrecoPor" do produto variante + */ +precoPor?: number +/** + * Fator multiplicador que gera o preço de exibição do produto. Ex.: produtos que exibem o preço em m² e cadastram o preço da caixa no "PrecoPor". (1 por padrão) (optional) + */ +fatorMultiplicadorPreco?: number +}[] +} +response: { +produtosNaoAtualizados?: { +produtoVarianteId?: number +sku?: string +resultado?: boolean +detalhes?: string +}[] +produtosAtualizados?: { +produtoVarianteId?: number +sku?: string +resultado?: boolean +detalhes?: string +}[] +} +} +/** + * Atualiza a exibição do banner em parceiros, se deve ser em todos ou não + */ +"PUT /banners/:bannerId/Parceiros": { +body: { +/** + * Exibição do banner em parceiros + */ +exibirEmTodosParceiros?: boolean +} +} +/** + * Retorna lista contendo os Id's dos pedidos do usuário + */ +"GET /usuarios/documento/:documento/pedidos": { +searchParams: { +/** + * Define se o documento informado é um CPF ou um CNPJ + */ +tipoDocumento?: ("Cpf" | "Cnpj") +} +response: { +pedidoId?: number +links?: { +href?: string +rel?: string +method?: string +}[] +}[] +} +/** + * Objeto com o precoDe e precoPor de um produto variante + */ +"GET /produtos/:identificador/preco": { +searchParams: { +/** + * Define se o identificador informado é um sku ou um id interno. + */ +tipoIdentificador?: ("Sku" | "ProdutoVarianteId") +} +response: { +precoDe?: number +precoPor?: number +fatorMultiplicadorPreco?: number +} +} +/** + * Campo atualizado com sucesso + */ +"PUT /usuarios/bloquear": { +body: { +/** + * Usuários (optional) + */ +RAW_BODY?: { +/** + * E-mail do usuário + */ +email?: string +/** + * Status do usuário + */ +bloqueado?: boolean +}[] +} +response: { +usuariosAtualizados?: string[] +usuariosNaoAtualizados?: string[] +} +} +/** + * Frete atualizado com sucesso + */ +"PUT /fretes/:freteId/Ativo": { +body: { +/** + * Status para atualização do contrato de frete + */ +ativo?: boolean +} +} +/** + * Gera um novo pedido para a assinatura + */ +"POST /assinaturas/:assinaturaId/pedido": { + +} +/** + * Xml com os dados das mídias entre duas datas + */ +"GET /midias": { +searchParams: { +/** + * Data inicial (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final (aaaa-mm-dd) + */ +dataFinal?: string +} +} +/** + * Relatório de ticket médio de um determinado período + */ +"GET /dashboard/ticketMedio": { +searchParams: { +/** + * Data inicial dos pedidos que deverão retornar (aaaa-mm-dd) + */ +dataInicial?: string +/** + * Data final dos pedidos que deverão retornar (aaaa-mm-dd) + */ +dataFinal?: string +/** + * Tipo de agrupamento dos pedidos (hora, dia, semana, mês, ano) + */ +tipoAgrupamento?: ("Hora" | "Dia" | "Semana" | "Mes" | "Ano") +} +response: { +tipoAgrupamento?: string +dados?: { +data?: string +pedidosCaptados?: number +pedidosPagos?: number +pedidosEnviados?: number +pedidosCancelados?: number +}[] +} +} +/** + * Objeto com as cotações de frete + */ +"GET /fretes/pedidos/:pedidoId/cotacoes": { +searchParams: { +/** + * Força cotação de todos os CD's. + */ +forcarCotacaoTodosCDs?: boolean +} +response: { +id?: string +nome?: string +prazo?: number +tabelaFreteId?: string +tipo?: string +valor?: number +centroDistribuicao?: number +produtos?: { +produtoVarianteId?: number +valor?: number +centroDistribuicaoId?: number +}[] +}[] +} } diff --git a/wake/utils/parseHeaders.ts b/wake/utils/parseHeaders.ts new file mode 100644 index 000000000..7734ccb51 --- /dev/null +++ b/wake/utils/parseHeaders.ts @@ -0,0 +1,18 @@ +export const getClientIP = (headers: Headers) => { + const cfConnectingIp = headers.get("cf-connecting-ip"); + const xForwardedFor = headers.get("x-forwarded-for"); + + if (cfConnectingIp) return cfConnectingIp; + + return xForwardedFor; +}; + +export const parseHeaders = (headers: Headers) => { + const clientIP = getClientIP(headers); + + const newHeaders = new Headers(); + + if (clientIP) newHeaders.set("X-Forwarded-For", clientIP); + + return newHeaders; +}; diff --git a/wake/utils/partner.ts b/wake/utils/partner.ts new file mode 100644 index 000000000..bb538e4e1 --- /dev/null +++ b/wake/utils/partner.ts @@ -0,0 +1,22 @@ +import { deleteCookie, getCookies, setCookie } from "std/http/cookie.ts"; + +const PARTNER_COOKIE = "partner-token"; + +const TEN_DAYS_MS = 10 * 24 * 3600 * 1_000; + +export const getPartnerCookie = (headers: Headers): string | undefined => { + const cookies = getCookies(headers); + + return cookies[PARTNER_COOKIE]; +}; + +export const setPartnerCookie = (headers: Headers, PartnerToken: string) => + setCookie(headers, { + name: PARTNER_COOKIE, + value: PartnerToken, + path: "/", + expires: new Date(Date.now() + TEN_DAYS_MS), + }); + +export const deletePartnerCookie = (headers: Headers) => + deleteCookie(headers, PARTNER_COOKIE); diff --git a/wake/utils/transform.ts b/wake/utils/transform.ts index 8548ed644..7ec3401bc 100644 --- a/wake/utils/transform.ts +++ b/wake/utils/transform.ts @@ -1,6 +1,8 @@ import { BreadcrumbList, + FilterRange, ListItem, + OfferItemCondition, Product, ProductListingPage, PropertyValue, @@ -8,6 +10,7 @@ import { } from "../../commerce/types.ts"; import { DEFAULT_IMAGE } from "../../commerce/utils/constants.ts"; import { + BuyList, ProductFragment, SearchQuery, SingleProductFragment, @@ -15,6 +18,13 @@ import { export const FILTER_PARAM = "filtro"; +export const CONDITIONS: Record = { + Novo: "https://schema.org/NewCondition", + Usado: "https://schema.org/UsedCondition", + Renovado: "https://schema.org/RefurbishedCondition", + Danificado: "https://schema.org/DamagedCondition", +}; + export const camposAdicionais = [ "Atacado", "Estoque", @@ -43,79 +53,172 @@ export const getProductUrl = ( ) => new URL(`/produto/${alias}`, base); export const getVariantUrl = ( - variant: ProductFragment | SingleProductFragment, + variant: ProductFragment | SingleProductFragment | BuyList, base: URL | string, + variantId?: string, ) => { const url = getProductUrl(variant, base); - url.searchParams.set("skuId", variant.productVariantId); + url.searchParams.set("skuId", variantId ?? variant.productVariantId); return url; }; +type WakeFilterItem = NonNullable< + NonNullable["aggregations"]>["filters"] +>[0]; + +export const toFilterItem = (filter: WakeFilterItem, base: URL) => ({ + "@type": "FilterToggle" as const, + key: filter?.origin ?? "", + label: filter?.field ?? "", + quantity: filter?.values?.length ?? 0, + values: filter?.values?.map((filterValue) => { + const url = new URL(base); + const { name, quantity } = filterValue!; + + const filterParams = url.searchParams.getAll(FILTER_PARAM); + + const index = filterParams.findIndex( + (f) => (f.split("__")[1] || f.split(":")[1]) === name, + ); + + const selected = index > -1; + + if (selected) { + const params = new URLSearchParams(); + url.searchParams.forEach((value, key) => { + if (key !== FILTER_PARAM || !value.endsWith(name!)) { + params.append(key, value); + } + }); + url.search = `${params}`; + } else { + url.searchParams.append(FILTER_PARAM, `${filter.field}__${name}`); + } + + return { + value: name!, + label: name!, + quantity: quantity!, + selected, + url: url.href, + }; + }) ?? [], +}); + +export const toPriceFilter = ( + filter: NonNullable< + NonNullable< + NonNullable["aggregations"] + >["priceRanges"] + >, + base: URL, +) => ({ + "@type": "FilterToggle" as const, + key: "precoPor", + label: "Preço", + quantity: filter.length ?? 0, + values: filter.map((filterValue) => { + const url = new URL(base); + const { range, quantity } = filterValue!; + const [min, max] = range?.split("-") ?? []; + const name = `${min};${max}`; + + const isDirectParam = url.searchParams.getAll("precoPor"); + + const filterParams = isDirectParam + ? isDirectParam + : url.searchParams.getAll(FILTER_PARAM); + + const index = isDirectParam + ? filterParams.findIndex((f) => f === name) + : filterParams.findIndex( + (f) => (f.split("__")[1] || f.split(":")[1]) === name, + ); + + const selected = index > -1; + + if (selected) { + const params = new URLSearchParams(); + url.searchParams.forEach((value, key) => { + if ( + (key !== FILTER_PARAM && key !== "precoPor") || + !value.endsWith(name) + ) { + params.append(key, value); + } + }); + url.search = `${params}`; + } else { + url.searchParams.append("precoPor", `${name}`); + } + + return { + value: range!, + label: range!, + quantity: quantity!, + selected, + url: url.href, + }; + }) ?? [], +}); + export const toFilters = ( - aggregations: NonNullable["aggregations"], + aggregations: NonNullable["aggregations"], { base }: { base: URL }, -): ProductListingPage["filters"] => - aggregations?.filters?.map((filter) => ({ - "@type": "FilterToggle", - key: filter?.origin ?? "", - label: filter?.field ?? "", - quantity: 0, - values: filter?.values?.map((filterValue) => { - const url = new URL(base); - const { name, quantity } = filterValue!; - const index = url.searchParams - .getAll(FILTER_PARAM) - .findIndex((f) => f === name); - const selected = index > -1; - - if (selected) { - const params = new URLSearchParams(); - url.searchParams.forEach((value, key) => { - if (key !== FILTER_PARAM || !value.endsWith(name!)) { - params.append(key, value); - } - }); - url.search = `${params}`; - } else { - url.searchParams.append(FILTER_PARAM, `${filter.field}:${name}`); - } +): ProductListingPage["filters"] => { + base.searchParams.delete("page"); + const filters: ProductListingPage["filters"] = + aggregations?.filters?.map((filter) => toFilterItem(filter, base)) ?? []; - return { - value: name!, - label: name!, - quantity: quantity!, - selected, - url: url.href, - }; - }) ?? [], - })) ?? []; + if (aggregations?.priceRanges) { + const pricefilter = toPriceFilter(aggregations?.priceRanges, base); + + filters.push(pricefilter); + } + + if (aggregations?.maximumPrice && aggregations?.minimumPrice) { + const priceRange: FilterRange = { + "@type": "FilterRange" as const, + key: "precoPor", + label: "Preço", + values: { + max: aggregations.maximumPrice, + min: aggregations.minimumPrice, + }, + }; + + filters.push(priceRange); + } + + return filters; +}; export const toBreadcrumbList = ( - product: Product, - categories: ProductFragment["productCategories"], - { base }: { base: URL }, + breadcrumbs: SingleProductFragment["breadcrumbs"] = [], + { base: base }: { base: URL }, + product?: Product, ): BreadcrumbList => { - const category = categories?.find((c) => c?.main); - const segments = category?.url?.split("/") ?? []; - const names = category?.hierarchy?.split(" > ") ?? []; - const itemListElement = segments.length === names.length - ? [ - ...segments.map((_, i): ListItem => ({ + const itemListElement = [ + ...(breadcrumbs ?? []).map( + (item, i): ListItem => ({ "@type": "ListItem", - name: names[i], + name: item!.text!, position: i + 1, - item: new URL(`/${segments.slice(0, i + 1).join("/")}`, base).href, - })), - { - "@type": "ListItem", - name: product.isVariantOf?.name, - url: product.isVariantOf?.url, - position: segments.length + 1, - } as ListItem, - ] - : []; + item: new URL(item!.link!, base).href, + }), + ), + ]; + + if (product) { + itemListElement.push({ + "@type": "ListItem", + name: product.isVariantOf?.name, + item: product.isVariantOf?.url!, + position: (breadcrumbs ?? []).length + 1, + }); + } return { "@type": "BreadcrumbList", @@ -127,31 +230,124 @@ export const toBreadcrumbList = ( export const toProduct = ( variant: ProductFragment | SingleProductFragment, { base }: { base: URL | string }, + variants: Product[] = [], + variantId?: number | null, ): Product => { const images = variant.images?.map((image) => ({ "@type": "ImageObject" as const, + encodingFormat: "image", url: image?.url ?? "", alternateName: image?.fileName ?? "", })); const additionalProperty: PropertyValue[] = []; + + if ((variant as SingleProductFragment)?.attributeSelections) { + ( + variant as SingleProductFragment + )?.attributeSelections?.selections?.forEach((selection) => { + if (selection?.name == "Outras Opções") { + selection.values?.forEach((value) => { + additionalProperty.push({ + "@type": "PropertyValue", + url: value?.alias ?? undefined, + value: value?.selected ? "true" : "false", + name: value?.value ?? undefined, + valueReference: "SELECTIONS", + }); + }); + } + }); + } + + variant.productCategories?.forEach((category) => + additionalProperty.push({ + "@type": "PropertyValue" as const, + name: "category", + propertyID: String(category?.id) ?? "", + value: category?.name ?? "", + }) + ); + variant.informations?.forEach((info) => additionalProperty.push({ "@type": "PropertyValue", - name: info?.title ?? undefined, + name: info?.type ?? undefined, + alternateName: info?.title ?? undefined, value: info?.value ?? undefined, valueReference: "INFORMATION", }) ); + variant.attributes?.forEach((attr) => additionalProperty.push({ "@type": "PropertyValue", + additionalType: attr?.type ?? undefined, name: attr?.name ?? undefined, value: attr?.value ?? undefined, + propertyID: String(attr?.id) ?? undefined, valueReference: "SPECIFICATION", }) ); + if (variant.urlVideo) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "urlVideo", + value: variant.urlVideo, + valueReference: "PROPERTY", + }); + } + + if (variant.promotions) { + variant.promotions.map((promotion) => { + additionalProperty.push({ + "@type": "PropertyValue", + name: promotion!.title ?? undefined, + value: promotion!.content ?? undefined, + identifier: promotion!.id, + image: promotion!.fullStampUrl + ? [ + { + "@type": "ImageObject", + encodingFormat: "image", + url: promotion!.fullStampUrl, + }, + ] + : undefined, + valueReference: "PROMOTION", + }); + }); + } + + if ((variant as BuyList).kit) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "kit", + value: String((variant as BuyList).kit), + valueReference: "PROPERTY", + }); + } + + if ((variant as BuyList).buyListId) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "buyListId", + value: String((variant as BuyList).buyListId), + valueReference: "PROPERTY", + }); + } + + if (variant.collection) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "collection", + value: variant.collection ?? undefined, + valueReference: "COLLECTION", + }); + } + const priceSpecification: UnitPriceSpecification[] = []; + if (variant.prices?.listPrice) { priceSpecification.push({ "@type": "UnitPriceSpecification", @@ -167,6 +363,64 @@ export const toProduct = ( }); } + if (variant.prices?.installmentPlans) { + variant.prices.installmentPlans.forEach((installmentPlan) => { + if (installmentPlan) { + installmentPlan.installments?.forEach((installment) => { + priceSpecification.push({ + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/SalePrice", + priceComponentType: "https://schema.org/Installment", + name: installmentPlan.displayName ?? undefined, + description: installmentPlan.name ?? undefined, + billingDuration: installment?.number, + billingIncrement: installment?.value, + price: installment?.value, + }); + }); + } + }); + } + const review = (variant as SingleProductFragment).reviews?.map((review) => ({ + "@type": "Review" as const, + author: [ + { + "@type": "Author" as const, + name: review?.customer ?? undefined, + identifier: review?.email ?? undefined, + }, + ], + datePublished: review?.reviewDate ?? undefined, + reviewBody: review?.review ?? undefined, + reviewRating: { + "@type": "AggregateRating" as const, + bestRating: 5, + worstRating: 1, + ratingValue: review?.rating ?? undefined, + ratingCount: 1, + }, + })) ?? []; + + const isSimilarTo = variant.similarProducts?.map((p) => + toProduct(p!, { base }) + ); + + const variantSelected = variants.find((v) => { + return Number(v.productID) === Number(variantId); + }) ?? {}; + + const aggregateRating = + variant.numberOfVotes || (variant as SingleProductFragment).reviews?.length + ? { + "@type": "AggregateRating" as const, + bestRating: 5, + ratingCount: variant.numberOfVotes || undefined, + ratingValue: variant.averageRating ?? undefined, + reviewCount: (variant as SingleProductFragment).reviews?.length, + worstRating: 1, + } + : undefined; + return { "@type": "Product", url: getVariantUrl(variant, base).href, @@ -181,35 +435,44 @@ export const toProduct = ( image: !images?.length ? [DEFAULT_IMAGE] : images, brand: { "@type": "Brand", - name: variant.productBrand?.name ?? "", - url: variant.productBrand?.logoUrl ?? variant.productBrand?.fullUrlLogo ?? - "", + name: variant.productBrand?.name ?? undefined, + url: variant.productBrand?.alias + ? new URL(`/${variant.productBrand.alias}`, base).href + : undefined, + logo: variant.productBrand?.fullUrlLogo ?? undefined, }, - isSimilarTo: [], + offers: { + "@type": "AggregateOffer", + highPrice: variant.prices?.price, + lowPrice: variant.prices?.price, + priceCurrency: "BRL", + offerCount: 1, + offers: [ + { + "@type": "Offer", + seller: variant.seller?.name ?? undefined, + price: variant.prices?.price, + priceSpecification, + itemCondition: CONDITIONS[variant.condition!], + availability: variant.available + ? "https://schema.org/InStock" + : "https://schema.org/OutOfStock", + inventoryLevel: { value: variant.stock }, + }, + ], + }, + additionalProperty, + ...variantSelected, + isSimilarTo, + review, + aggregateRating, isVariantOf: { "@type": "ProductGroup", url: getProductUrl(variant, base).href, name: variant.productName ?? undefined, productGroupID: variant.productId, - hasVariant: [], + hasVariant: variants, additionalProperty: [], }, - additionalProperty, - offers: { - "@type": "AggregateOffer", - highPrice: variant.prices?.price, - lowPrice: variant.prices?.price, - offerCount: 1, - offers: [{ - "@type": "Offer", - seller: variant.seller?.name ?? undefined, - price: variant.prices?.price, - priceSpecification, - availability: variant.available - ? "https://schema.org/InStock" - : "https://schema.org/OutOfStock", - inventoryLevel: { value: variant.stock }, - }], - }, }; }; diff --git a/wake/utils/user.ts b/wake/utils/user.ts new file mode 100644 index 000000000..d42420974 --- /dev/null +++ b/wake/utils/user.ts @@ -0,0 +1,9 @@ +import { getCookies } from "std/http/cookie.ts"; + +const LOGIN_COOKIE = "fbits-login"; + +export const getUserCookie = (headers: Headers): string | undefined => { + const cookies = getCookies(headers); + + return cookies[LOGIN_COOKIE]; +}; diff --git a/wap/actions/cart/addItems.ts b/wap/actions/cart/addItems.ts new file mode 100644 index 000000000..670a39b38 --- /dev/null +++ b/wap/actions/cart/addItems.ts @@ -0,0 +1,38 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../../utils/cookie.ts"; +import { Cart } from "../../utils/type.ts"; + +export interface Props { + tipo: "produto" | "lista"; + itens: Array<{ + idProduto: number; + idAtributoSimples: number; + idUnidadeVenda: number; + idArmazem: number; + quantidade: number; + adicional?: string; + parametros?: string; + }>; +} + +/** + * @title Wap Integration + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api["POST /api/v2/front/checkout/cart"]({}, { + body: props, + headers: req.headers, + }); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/cart/removeItem.ts b/wap/actions/cart/removeItem.ts new file mode 100644 index 000000000..55ee6b7f9 --- /dev/null +++ b/wap/actions/cart/removeItem.ts @@ -0,0 +1,35 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../../utils/cookie.ts"; +import { Cart } from "../../utils/type.ts"; + +export interface Props { + tipo: "produto" | "lista"; + idProduto: number; + idAtributoSimples: number; + idUnidadeVenda: number; + idArmazem: number; + adicional?: string; +} + +/** + * @title Wap Integration + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["DELETE /api/v2/front/checkout/cart"]({}, { + body: props, + headers: req.headers, + }); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/cart/updateCoupon.ts b/wap/actions/cart/updateCoupon.ts new file mode 100644 index 000000000..7afc035f5 --- /dev/null +++ b/wap/actions/cart/updateCoupon.ts @@ -0,0 +1,29 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + hashCupom: string; +} + +/** + * @title Wap Integration + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { hashCupom } = props; + + const response = await api + ["PUT /api/v2/front/promotional/coupon/:hashCupom"]({ + hashCupom, + }, { + headers: req.headers, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/cart/updateItem.ts b/wap/actions/cart/updateItem.ts new file mode 100644 index 000000000..344848eaa --- /dev/null +++ b/wap/actions/cart/updateItem.ts @@ -0,0 +1,37 @@ +import { AppContext } from "../../mod.ts"; +import { proxySetCookie } from "../../../utils/cookie.ts"; +import { Cart } from "../../utils/type.ts"; + +export interface Props { + tipo: "produto" | "lista"; + idProduto: number; + idAtributoSimples: number; + idUnidadeVenda: number; + idArmazem: number; + quantidade: number; + adicional?: string; +} + +/** + * @title Wap Integration + * @description Upadte Cart Items Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["PUT /api/v2/front/checkout/cart"]({}, { + body: props, + headers: req.headers, + }); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/evaluations/product.ts b/wap/actions/evaluations/product.ts new file mode 100644 index 000000000..6fec9dd87 --- /dev/null +++ b/wap/actions/evaluations/product.ts @@ -0,0 +1,33 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + idProduto: number; + nome: string; + email: string; + nota: 1 | 2 | 3 | 4 | 5; + comentario: string; + recomenda: boolean; + anexos?: string[]; +} + +/** + * @title Wap Integration + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/evaluations/product"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/forms/contact.ts b/wap/actions/forms/contact.ts new file mode 100644 index 000000000..fe213c876 --- /dev/null +++ b/wap/actions/forms/contact.ts @@ -0,0 +1,33 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + hashEmail: string; + nome: string; + email: string; + contato: string; + assunto?: string; + mensagem?: string; +} + +/** + * @title Wap Integration + * @description Form Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/form/contact"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/newsletter/associates.ts b/wap/actions/newsletter/associates.ts new file mode 100644 index 000000000..28452d0d4 --- /dev/null +++ b/wap/actions/newsletter/associates.ts @@ -0,0 +1,42 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface NewsletterStatus extends Status { + mensagem: string; +} + +export interface Associated { + nome: string; + sexo: "m" | "h" | "i"; + dataNascimento: string; + informacoesAdicionais?: unknown[]; +} + +export interface Props { + email: string; + associados: Associated[]; +} + +// ! This Action has been added but not tested because we dont have a use case + +/** + * @title Wap Integration + * @description Newslleter Associates Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/newsletter/associates"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/newsletter/register.ts b/wap/actions/newsletter/register.ts new file mode 100644 index 000000000..5118536e0 --- /dev/null +++ b/wap/actions/newsletter/register.ts @@ -0,0 +1,33 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + idEvento?: number; + nome?: string; + email: string; + segmento?: "m" | "h" | "i"; + cupom?: boolean; + informacoesAdicionais?: unknown[]; +} + +/** + * @title Wap Integration + * @description Newsletter Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/newsletter"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/product/solicitation.ts b/wap/actions/product/solicitation.ts new file mode 100644 index 000000000..1eff5154d --- /dev/null +++ b/wap/actions/product/solicitation.ts @@ -0,0 +1,34 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + idProduto: number; + idAtributoValor: number; + nome: string; + email: string; + contato?: string; + mensagem?: string; + mailing: boolean; +} + +/** + * @title Wap Integration + * @description Product Solicitation Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/product/solicitation"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/question/answer.ts b/wap/actions/question/answer.ts new file mode 100644 index 000000000..3f839f750 --- /dev/null +++ b/wap/actions/question/answer.ts @@ -0,0 +1,32 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + idPergunta: number; + nome: string; + email: string; + contato?: string; + resposta: string; +} + +/** + * @title Wap Integration + * @description Answer Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/question"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/question/question.ts b/wap/actions/question/question.ts new file mode 100644 index 000000000..74bf4d1b7 --- /dev/null +++ b/wap/actions/question/question.ts @@ -0,0 +1,33 @@ +import { AppContext } from "../../mod.ts"; +import { Status } from "../../utils/type.ts"; + +export interface Props { + nivel: "produto" | "categoria" | "marca" | "landingPage"; + idNivel: number; + nome: string; + email: string; + contato?: string; + pergunta: string; +} + +/** + * @title Wap Integration + * @description Question Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/question"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/shipment/product.ts b/wap/actions/shipment/product.ts new file mode 100644 index 000000000..fe15a6e5f --- /dev/null +++ b/wap/actions/shipment/product.ts @@ -0,0 +1,45 @@ +import { AppContext } from "../../mod.ts"; + +export interface Fretes { + fretes: Array<{ + id: string; + tipo: string; + label: string; + valor: number; + prazo: string; + entregaAgendada: boolean; + }>; + restricaoEntrega: string; + mensagem: string; +} + +export interface Props { + cep: string; + idProduto: number; + idAtributoValor: number; + quantidade: number; + marketplace?: boolean; + idMarketplaceSeller?: number; +} + +/** + * @title Wap Integration + * @description Shipment Simulation Action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["POST /api/v2/front/shipment/product"]({}, { + headers: req.headers, + body: props, + }); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/actions/wishlist/addItem.ts b/wap/actions/wishlist/addItem.ts new file mode 100644 index 000000000..9eb7e53d7 --- /dev/null +++ b/wap/actions/wishlist/addItem.ts @@ -0,0 +1,32 @@ +import { AppContext } from "../../mod.ts"; +import wishlistLoader from "../../loaders/wishlist.ts"; + +export interface Props { + idProduto: number; + idAtributoSimples: number; + idUnidadeVenda: number; + quantidade?: number; + parametroAdicional: string; +} + +/** + * @title Wap Integration + * @description Wishlist add item action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + await api + ["POST /api/v2/front/wishlist/add"]({}, { + headers: req.headers, + body: props, + }); + + return wishlistLoader(undefined, req, ctx); +}; + +export default loader; diff --git a/wap/actions/wishlist/removeItem.ts b/wap/actions/wishlist/removeItem.ts new file mode 100644 index 000000000..8b59e21a0 --- /dev/null +++ b/wap/actions/wishlist/removeItem.ts @@ -0,0 +1,32 @@ +import { AppContext } from "../../mod.ts"; +import wishlistLoader from "../../loaders/wishlist.ts"; + +export interface Props { + idProduto: number; + idAtributoSimples: number; + idUnidadeVenda: number; + quantidade?: number; + parametroAdicional?: string; +} + +/** + * @title Wap Integration + * @description Wishlist remove item action + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const _response = await api + ["POST /api/v2/front/wishlist/remove"]({}, { + headers: req.headers, + body: props, + }); + + return wishlistLoader(undefined, req, ctx); +}; + +export default loader; diff --git a/wap/hooks/context.ts b/wap/hooks/context.ts new file mode 100644 index 000000000..238e90f92 --- /dev/null +++ b/wap/hooks/context.ts @@ -0,0 +1,80 @@ +import { IS_BROWSER } from "$fresh/runtime.ts"; +import { signal } from "@preact/signals"; +import { Person } from "../../commerce/types.ts"; +import { invoke } from "../runtime.ts"; +import { Cart } from "../utils/type.ts"; + +export interface Context { + cart: Cart | null; + user: Person | null; + wishlist: number[] | null; +} + +const loading = signal(true); +const context = { + cart: signal(null), + user: signal(null), + wishlist: signal(null), +}; + +let queue = Promise.resolve(); +let abort = () => {}; +const enqueue = ( + cb: (signal: AbortSignal) => Promise> | Partial, +) => { + abort(); + + loading.value = true; + const controller = new AbortController(); + + queue = queue.then(async () => { + try { + const { + cart, + user, + wishlist, + } = await cb(controller.signal); + + if (controller.signal.aborted) { + throw { name: "AbortError" }; + } + + context.cart.value = cart || context.cart.value; + context.user.value = user || context.user.value; + context.wishlist.value = wishlist || context.wishlist.value; + + loading.value = false; + } catch (error) { + if (error.name === "AbortError") return; + + console.error(error); + loading.value = false; + } + }); + + abort = () => controller.abort(); + + return queue; +}; + +const load = (signal: AbortSignal) => + invoke({ + cart: invoke.wap.loaders.cart(), + user: invoke.wap.loaders.user(), + wishlist: invoke.wap.loaders.wishlist(), + }, { signal }); + +if (IS_BROWSER) { + enqueue(load); + + document.addEventListener( + "visibilitychange", + () => document.visibilityState === "visible" && enqueue(load), + ); +} + +export const state = { + ...context, + loading, + enqueue, +}; diff --git a/wap/hooks/useCart.ts b/wap/hooks/useCart.ts new file mode 100644 index 000000000..dd0054df0 --- /dev/null +++ b/wap/hooks/useCart.ts @@ -0,0 +1,46 @@ +// deno-lint-ignore-file no-explicit-any +import type { AnalyticsItem } from "../../commerce/types.ts"; +import type { Manifest } from "../manifest.gen.ts"; +import { invoke } from "../runtime.ts"; +import { Context, state as storeState } from "./context.ts"; + +const { cart, loading } = storeState; + +export const itemToAnalyticsItem = ( + item: any, + index: number, +): AnalyticsItem => { + return { + item_id: item.hash.idProduto, + quantity: item.quantidade, + price: item.price, + index, + discount: item.precos.precoDe - item.precos.precoPor, + item_name: item.nome!, + item_variant: item.hash.idProduto, + }; +}; + +type EnqueuableActions< + K extends keyof Manifest["actions"], +> = Manifest["actions"][K]["default"] extends + (...args: any[]) => Promise ? K : never; + +const enqueue = < + K extends keyof Manifest["actions"], +>(key: EnqueuableActions) => +(props: Parameters[0]) => + storeState.enqueue((signal) => + invoke({ cart: { key, props } } as any, { signal }) as any + ); + +const state = { + cart, + loading, + addItems: enqueue("wap/actions/cart/addItems.ts"), + updateItem: enqueue("wap/actions/cart/updateItem.ts"), + removeItem: enqueue("wap/actions/cart/removeItem.ts"), + updateCoupon: invoke.wap.actions.cart.updateCoupon, +}; + +export const useCart = () => state; diff --git a/wap/hooks/useUser.ts b/wap/hooks/useUser.ts new file mode 100644 index 000000000..ef405c564 --- /dev/null +++ b/wap/hooks/useUser.ts @@ -0,0 +1,7 @@ +import { state as storeState } from "./context.ts"; + +const { user, loading } = storeState; + +const state = { user, loading }; + +export const useUser = () => state; diff --git a/wap/hooks/useWishlist.ts b/wap/hooks/useWishlist.ts new file mode 100644 index 000000000..b73cb172e --- /dev/null +++ b/wap/hooks/useWishlist.ts @@ -0,0 +1,31 @@ +// deno-lint-ignore-file no-explicit-any +import { Manifest } from "../manifest.gen.ts"; +import { invoke } from "../runtime.ts"; +import { state as storeState } from "./context.ts"; + +const { wishlist, loading } = storeState; + +type EnqueuableActions< + K extends keyof Manifest["actions"], +> = Manifest["actions"][K]["default"] extends + (...args: any[]) => Promise ? K : never; + +const enqueue = < + K extends keyof Manifest["actions"], +>(key: EnqueuableActions) => +(props: Parameters[0]) => + storeState.enqueue((signal) => + invoke({ wishlist: { key, props } } as any, { signal }) as any + ); + +const getItem = (item: number) => wishlist.value?.find((id) => id == item); + +const state = { + wishlist, + loading, + getItem, + addItem: enqueue("wap/actions/wishlist/addItem.ts"), + removeItem: enqueue("wap/actions/wishlist/removeItem.ts"), +}; + +export const useWishlist = () => state; diff --git a/wap/loaders/cart.ts b/wap/loaders/cart.ts new file mode 100644 index 000000000..bce85b0df --- /dev/null +++ b/wap/loaders/cart.ts @@ -0,0 +1,26 @@ +import { AppContext } from "../mod.ts"; +import { proxySetCookie } from "../../utils/cookie.ts"; +import { Cart } from "../utils/type.ts"; + +/** + * @title Wap Integration + * @description Product Cart loader + */ +const loader = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const response = await api + ["GET /api/v2/front/checkout/cart"]({}, { + headers: req.headers, + }); + + proxySetCookie(response.headers, ctx.response.headers, req.url); + + return response.json() as Promise; +}; + +export default loader; diff --git a/wap/loaders/productDetailsPage.ts b/wap/loaders/productDetailsPage.ts new file mode 100644 index 000000000..f27beb603 --- /dev/null +++ b/wap/loaders/productDetailsPage.ts @@ -0,0 +1,55 @@ +import { ProductDetailsPage } from "../../commerce/types.ts"; +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { AppContext } from "../mod.ts"; +import { getUrl, toBreadcrumbList, toProduct } from "../utils/transform.ts"; +import { WapProductDatailsPage } from "../utils/type.ts"; + +export interface Props { + slug: RequestURLParam; +} + +/** + * @title Wap Integration + * @description Product Details loader + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { url: baseUrl } = req; + const url = new URL(baseUrl); + + const { + slug, + } = props; + + const data = await api + ["GET /api/v2/front/url/product/detail"]({ + url: `/${slug}.html`, + }).then((response) => response.json()) as WapProductDatailsPage; + + const itemListElement = toBreadcrumbList(data.estrutura.breadcrumb, baseUrl); + + const product = toProduct(data.conteudo, baseUrl); + + return { + "@type": "ProductDetailsPage", + breadcrumbList: { + "@type": "BreadcrumbList", + itemListElement, + numberOfItems: itemListElement.length, + }, + product, + seo: { + title: data.estrutura.seo.title, + description: data.estrutura.seo.description, + canonical: + getUrl(new URL(data.estrutura.seo.canonical).pathname, url.origin).href, + noIndexing: !data.estrutura.seo.indexar, + }, + }; +}; + +export default loader; diff --git a/wap/loaders/productList.ts b/wap/loaders/productList.ts new file mode 100644 index 000000000..47cb6a5e5 --- /dev/null +++ b/wap/loaders/productList.ts @@ -0,0 +1,59 @@ +import { Product } from "../../commerce/types.ts"; +import { AppContext } from "../mod.ts"; +import { toProduct } from "../utils/transform.ts"; +import { WapProductsListPage, WapProductsShowcasePage } from "../utils/type.ts"; + +export interface ShowcaseProps { + hash: string; +} + +export interface QueryProps { + busca: string; + /** + * @max 100 + * @default 12 + */ + limit: number; +} + +export type Props = { props: ShowcaseProps | QueryProps }; + +// deno-lint-ignore no-explicit-any +const isShowcaseList = (p: any): p is ShowcaseProps => + typeof p.hash === "string"; + +/** + * @title Wap Integration + * @description Product List loader + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { url: baseUrl } = req; + + const data = isShowcaseList(props.props) + ? await api["GET /api/v2/front/showcase/products/:hash"]({ + ...props.props, + }).then((response) => response.json()) + : await api + ["GET /api/v2/front/url/product/listing/search"]({ + ...props.props, + limit: String(props.props.limit), + offset: "0", + }).then((response) => response.json()); + + if (!data) return null; + + const rawProducts = isShowcaseList(props.props) + ? (data as WapProductsShowcasePage).produtos + : (data as WapProductsListPage).conteudo.produtos; + + const products = rawProducts.map((produto) => toProduct(produto, baseUrl)); + + return products; +}; + +export default loader; diff --git a/wap/loaders/productListIndicated.ts b/wap/loaders/productListIndicated.ts new file mode 100644 index 000000000..b41b80592 --- /dev/null +++ b/wap/loaders/productListIndicated.ts @@ -0,0 +1,62 @@ +import { Product } from "../../commerce/types.ts"; +import { RequestURLParam } from "../../website/functions/requestToParam.ts"; +import { AppContext } from "../mod.ts"; +import { toProduct } from "../utils/transform.ts"; +import { + WapProductDatailsPage, + WapProductsShowcasePage, +} from "../utils/type.ts"; + +export interface Dynamic { + slug: RequestURLParam; +} + +export interface Static { + productId: number; +} + +export type Props = { props: Static | Dynamic }; + +// deno-lint-ignore no-explicit-any +const isDynamic = (p: any): p is Dynamic => typeof p.slug === "string"; + +/** + * @title Wap Integration - Indicated Products + * @description Indicated Products loader + */ +const loader = async ( + { props }: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { url: baseUrl } = req; + + let productId = (props as Static)?.productId; + + if (isDynamic(props)) { + const wapProduct = await api + ["GET /api/v2/front/url/product/detail"]({ + url: `/${props.slug}.html`, + }).then((response) => response.json()) as WapProductDatailsPage; + + if (!wapProduct) return null; + + productId = wapProduct.conteudo.id; + } + + const data = await api + ["GET /api/v2/front/showcase/products/produto-detalhe-indicados"]({ + productId: String(productId), + }).then((response) => response.json()) as WapProductsShowcasePage; + + if (!data) return null; + + const rawProducts = data.produtos; + + const products = rawProducts.map((produto) => toProduct(produto, baseUrl)); + + return products; +}; + +export default loader; diff --git a/wap/loaders/productListLastSeen.ts b/wap/loaders/productListLastSeen.ts new file mode 100644 index 000000000..72086331f --- /dev/null +++ b/wap/loaders/productListLastSeen.ts @@ -0,0 +1,39 @@ +import { Product } from "../../commerce/types.ts"; +import { AppContext } from "../mod.ts"; +import { toProduct } from "../utils/transform.ts"; +import { WapProductsShowcasePage } from "../utils/type.ts"; + +export type Props = { + productId: number; + seenProducts: number[]; + limit: number; +}; + +/** + * @title Wap Integration - Last Seen + * @description Last Seen Products list loader + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { url: baseUrl } = req; + + const data = await api["GET /api/v2/front/showcase/products/ultimos-vistos"]({ + productId: String(props.productId), + seenProducts: props.seenProducts.join(";"), + limit: String(props.limit), + }).then((response) => response.json()) as WapProductsShowcasePage; + + if (!data) return null; + + const rawProducts = data.produtos; + + const products = rawProducts.map((produto) => toProduct(produto, baseUrl)); + + return products; +}; + +export default loader; diff --git a/wap/loaders/productListingPage.ts b/wap/loaders/productListingPage.ts new file mode 100644 index 000000000..3bdbf3b9b --- /dev/null +++ b/wap/loaders/productListingPage.ts @@ -0,0 +1,185 @@ +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, + toBreadcrumbList, + toFilters, + toProduct, +} from "../utils/transform.ts"; +import { WapProductsListPage } from "../utils/type.ts"; + +type ORDER_OPTS = "Favoritos" | "Maior Preço" | "Menor Preço" | "Popularidade"; + +export interface FilterItem { + /** + * @title Filter type + */ + key: string; + /** + * @title Filter value + */ + value: string; +} + +export type Props = { + busca?: string; + /** + * @max 100 + * @default 12 + */ + limit?: number; + /** + * @description page number + */ + page?: number; + /** + * @description order of products + */ + order?: ORDER_OPTS; + /** + * @title filters + */ + filterParams?: FilterItem[]; +}; + +const endPoint = { + "product/listing/category": + "GET /api/v2/front/url/product/listing/category" as const, + "product/listing/brand": + "GET /api/v2/front/url/product/listing/brand" as const, + "product/listing/landing-page": + "GET /api/v2/front/url/product/listing/landing-page" as const, +}; + +/** + * @title Wap Integration + * @description Product List loader + */ +const loader = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { url: baseUrl } = req; + const url = new URL(baseUrl); + + const rawSearch = url.searchParams.get("busca") ?? props.busca; + const busca = rawSearch && encodeURIComponent(rawSearch); + + const page = Number(url.searchParams.get("pg") ?? props.page ?? 1); + + const limit = Number(url.searchParams.get("ipp") ?? props.limit ?? 12); + + const order = url.searchParams.get("order") ?? props.order; + + const offset = page <= 1 ? 0 : (page - 1) * limit; + + const filterParams = props.filterParams?.reduce((acc, { key, value }) => { + if (acc[key]) { + acc[key] = [...acc[key], value]; + } else { + acc[key] = value; + } + + return acc; + }, {} as Record) ?? {}; + + if (!busca && url.pathname.startsWith("%2F_fresh")) return null; + + const { nivel } = await api + ["GET /api/v2/front/url/verify"]({ + url: url.pathname, + }).then((response) => response.json()).catch(() => {}) ?? {}; + + if (!busca && !nivel) return null; + + const searchParams: Record = {}; + + url.searchParams.delete("busca"); + url.searchParams.delete("pg"); + url.searchParams.delete("order"); + + url.searchParams.forEach((v, k) => { + if (searchParams[k]) { + searchParams[k] = [...searchParams[k], v]; + } + searchParams[k] = v; + }); + + const params = { ...filterParams, ...searchParams }; + + const endpoint = nivel && endPoint[nivel as keyof typeof endPoint]; + + const data = endpoint + ? await api[endpoint]({ + url: url.pathname, + limit: String(limit), + offset: String(offset), + order, + ...params, + }).then((response: TypedResponse) => + response.json() + ) as WapProductsListPage + : await api + ["GET /api/v2/front/url/product/listing/search"]({ + busca, + limit: String(limit), + offset: String(offset), + order, + ...params, + }).then((response) => response.json()) as WapProductsListPage; + + const sortOptions = data.conteudo.detalhes.ordenacao.map((order) => ( + { + label: order.label, + value: order.rota.query.order!, + } + )); + + const itemListElement = toBreadcrumbList(data.estrutura.breadcrumb, baseUrl); + + const filters = toFilters(data.conteudo.detalhes, baseUrl); + + const products = data.conteudo.produtos.map((produto) => + toProduct(produto, baseUrl) + ); + + const previousPage = new URL(url); + + previousPage.searchParams.append("pg", String(page - 1)); + + const nextPage = new URL(url); + + nextPage.searchParams.append("pg", String(page + 1)); + + return { + "@type": "ProductListingPage", + breadcrumb: { + "@type": "BreadcrumbList", + itemListElement, + numberOfItems: itemListElement.length, + }, + sortOptions, + filters, + products, + pageInfo: { + currentPage: page, + previousPage: data.info.prev ? previousPage.href : undefined, + nextPage: data.info.next ? nextPage.href : undefined, + records: data.info.total, + recordPerPage: limit, + }, + 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, + }), + }; +}; + +export default loader; diff --git a/wap/loaders/proxy.ts b/wap/loaders/proxy.ts new file mode 100644 index 000000000..db1ce221f --- /dev/null +++ b/wap/loaders/proxy.ts @@ -0,0 +1,45 @@ +import { Route } from "../../website/flags/audience.ts"; +import { AppContext } from "../mod.ts"; + +const DEFAULT_PROXY_PATHS = [ + "/minha-conta", + "/minha-conta/*", + "/checkout", + "/checkout/*", +]; + +export interface Props { + /** @description ex: /p/fale-conosco */ + pagesToProxy?: string[]; +} + +/** + * @title Wap Proxy Routes + */ +function loader( + { pagesToProxy = [] }: Props, + _req: Request, + ctx: AppContext, +): Route[] { + const { baseUrl } = ctx; + + const checkout = [ + ...DEFAULT_PROXY_PATHS, + ...pagesToProxy, + ].map((pathTemplate) => ({ + pathTemplate, + handler: { + value: { + __resolveType: "website/handlers/proxy.ts", + url: baseUrl, + customHeaders: [{ + Host: baseUrl, + }], + }, + }, + })); + + return checkout; +} + +export default loader; diff --git a/wap/loaders/suggestions.ts b/wap/loaders/suggestions.ts new file mode 100644 index 000000000..b58eea3f7 --- /dev/null +++ b/wap/loaders/suggestions.ts @@ -0,0 +1,44 @@ +import { AppContext } from "../mod.ts"; +import { toProduct } from "../utils/transform.ts"; +import { WapProductsListPage } from "../utils/type.ts"; +import { Suggestion } from "../../commerce/types.ts"; + +export interface Props { + query?: string; + /** + * @description limit the number of searches + * @default 4 + */ + count?: number; +} + +/** + * @title Wap Integration + * @description Product Suggestion loader + */ +const loaders = async ( + props: Props, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + const { url: baseUrl } = req; + const { query, count = 4 } = props; + + const data = await api + ["GET /api/v2/front/url/product/listing/search"]({ + busca: query, + limit: String(count), + offset: String(0), + }).then((response) => response.json()) as WapProductsListPage; + + const products = data.conteudo.produtos.map((produto) => + toProduct(produto, baseUrl) + ); + + return { + products, + }; +}; + +export default loaders; diff --git a/wap/loaders/user.ts b/wap/loaders/user.ts new file mode 100644 index 000000000..a6f762337 --- /dev/null +++ b/wap/loaders/user.ts @@ -0,0 +1,36 @@ +import { Person } from "../../commerce/types.ts"; +import { AppContext } from "../mod.ts"; +import { User } from "../utils/type.ts"; + +const genderMap = { + f: "https://schema.org/Female" as const, + m: "https://schema.org/Male" as const, + i: undefined, + o: undefined, +}; + +async function loader( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise { + const { api } = ctx; + + try { + const user = await api + ["GET /api/v2/front/checkout/user"]({}, { + headers: req.headers, + }).then((response) => response.json()) as User; + + return { + "@id": String(user.id), + email: user.email, + givenName: user.nomeRazao, + gender: genderMap[user.sexo], + }; + } catch (_) { + return null; + } +} + +export default loader; diff --git a/wap/loaders/wishlist.ts b/wap/loaders/wishlist.ts new file mode 100644 index 000000000..e2fc4935a --- /dev/null +++ b/wap/loaders/wishlist.ts @@ -0,0 +1,22 @@ +import { AppContext } from "../mod.ts"; + +/** + * @title Wap Integration + * @description Product Wishlist loader + */ +const loader = async ( + _props: unknown, + req: Request, + ctx: AppContext, +): Promise => { + const { api } = ctx; + + const data = await api + ["GET /api/v2/front/wishlist"]({}, { + headers: req.headers, + }).then((response) => response.json()) as { favoritos: number[] }; + + return data?.favoritos; +}; + +export default loader; diff --git a/wap/manifest.gen.ts b/wap/manifest.gen.ts new file mode 100644 index 000000000..9a4ebb84f --- /dev/null +++ b/wap/manifest.gen.ts @@ -0,0 +1,65 @@ +// DO NOT EDIT. This file is generated by deco. +// 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/cart/addItems.ts"; +import * as $$$$$$$$$1 from "./actions/cart/removeItem.ts"; +import * as $$$$$$$$$2 from "./actions/cart/updateCoupon.ts"; +import * as $$$$$$$$$3 from "./actions/cart/updateItem.ts"; +import * as $$$$$$$$$4 from "./actions/evaluations/product.ts"; +import * as $$$$$$$$$5 from "./actions/forms/contact.ts"; +import * as $$$$$$$$$6 from "./actions/newsletter/associates.ts"; +import * as $$$$$$$$$7 from "./actions/newsletter/register.ts"; +import * as $$$$$$$$$8 from "./actions/product/solicitation.ts"; +import * as $$$$$$$$$9 from "./actions/question/answer.ts"; +import * as $$$$$$$$$10 from "./actions/question/question.ts"; +import * as $$$$$$$$$11 from "./actions/shipment/product.ts"; +import * as $$$$$$$$$12 from "./actions/wishlist/addItem.ts"; +import * as $$$$$$$$$13 from "./actions/wishlist/removeItem.ts"; +import * as $$$0 from "./loaders/cart.ts"; +import * as $$$1 from "./loaders/productDetailsPage.ts"; +import * as $$$2 from "./loaders/productList.ts"; +import * as $$$3 from "./loaders/productListIndicated.ts"; +import * as $$$5 from "./loaders/productListingPage.ts"; +import * as $$$4 from "./loaders/productListLastSeen.ts"; +import * as $$$6 from "./loaders/proxy.ts"; +import * as $$$7 from "./loaders/suggestions.ts"; +import * as $$$8 from "./loaders/user.ts"; +import * as $$$9 from "./loaders/wishlist.ts"; + +const manifest = { + "loaders": { + "wap/loaders/cart.ts": $$$0, + "wap/loaders/productDetailsPage.ts": $$$1, + "wap/loaders/productList.ts": $$$2, + "wap/loaders/productListIndicated.ts": $$$3, + "wap/loaders/productListingPage.ts": $$$5, + "wap/loaders/productListLastSeen.ts": $$$4, + "wap/loaders/proxy.ts": $$$6, + "wap/loaders/suggestions.ts": $$$7, + "wap/loaders/user.ts": $$$8, + "wap/loaders/wishlist.ts": $$$9, + }, + "actions": { + "wap/actions/cart/addItems.ts": $$$$$$$$$0, + "wap/actions/cart/removeItem.ts": $$$$$$$$$1, + "wap/actions/cart/updateCoupon.ts": $$$$$$$$$2, + "wap/actions/cart/updateItem.ts": $$$$$$$$$3, + "wap/actions/evaluations/product.ts": $$$$$$$$$4, + "wap/actions/forms/contact.ts": $$$$$$$$$5, + "wap/actions/newsletter/associates.ts": $$$$$$$$$6, + "wap/actions/newsletter/register.ts": $$$$$$$$$7, + "wap/actions/product/solicitation.ts": $$$$$$$$$8, + "wap/actions/question/answer.ts": $$$$$$$$$9, + "wap/actions/question/question.ts": $$$$$$$$$10, + "wap/actions/shipment/product.ts": $$$$$$$$$11, + "wap/actions/wishlist/addItem.ts": $$$$$$$$$12, + "wap/actions/wishlist/removeItem.ts": $$$$$$$$$13, + }, + "name": "wap", + "baseUrl": import.meta.url, +}; + +export type Manifest = typeof manifest; + +export default manifest; diff --git a/wap/mod.ts b/wap/mod.ts new file mode 100644 index 000000000..a71d0ad25 --- /dev/null +++ b/wap/mod.ts @@ -0,0 +1,62 @@ +import manifest, { Manifest } from "./manifest.gen.ts"; +import { createHttpClient } from "../utils/http.ts"; +import { OpenAPI } from "./utils/openapi/api.openapi.gen.ts"; +import { fetchSafe } from "../utils/fetch.ts"; +import { PreviewContainer } from "../utils/preview.tsx"; +import { type App, type FnContext } from "@deco/deco"; +export const color = 0xfe5000; +export interface State extends Props { + api: ReturnType>; +} +export type AppContext = FnContext; +/** @title Wap */ +export interface Props { + /** + * @description Use Wap as backend platform + * @hide true + */ + platform: "wap"; + /** + * @description URL of wap native environment + */ + baseUrl: string; +} +/** + * @title Wap + * @description Loaders, actions and workflows for adding Wap Commerce Platform to your website. + * @category Ecommmerce + */ +export default function App(props: Props): App { + const headers = new Headers(); + headers.set("accept", "application/json"); + headers.set("content-type", "application/json"); + headers.set("Cache-Control", "no-cache"); + headers.set("App-Token", "wapstore"); + const api = createHttpClient({ + base: props.baseUrl, + fetcher: fetchSafe, + headers: headers, + }); + const state = { + ...props, + api, + }; + return { manifest, state }; +} +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Wap", + owner: "deco.cx", + description: + "Loaders, actions and workflows for adding Wap Commerce Platform to your website.", + logo: + "https://auth.deco.cx/storage/v1/object/public/assets/1/user_content/uappi.png", + images: [ + "https://deco-sites-assets.s3.sa-east-1.amazonaws.com/starting/235b17e1-6f7a-4077-98cf-dad53ef075e5/2.Home-Galeria-de-topicos-principais-575x455px.jpg", + ], + tabs: [], + }, + }; +}; diff --git a/wap/runtime.ts b/wap/runtime.ts new file mode 100644 index 000000000..da42a2435 --- /dev/null +++ b/wap/runtime.ts @@ -0,0 +1,3 @@ +import { Manifest } from "./manifest.gen.ts"; +import { proxy } from "@deco/deco/web"; +export const invoke = proxy(); diff --git a/wap/utils/cart.ts b/wap/utils/cart.ts new file mode 100644 index 000000000..ea6f804ce --- /dev/null +++ b/wap/utils/cart.ts @@ -0,0 +1,9 @@ +import { getCookies } from "std/http/cookie.ts"; + +const CART_COOKIE = "PHPSESSID"; + +export const getCartCookie = (headers: Headers): string | undefined => { + const cookies = getCookies(headers); + + return cookies[CART_COOKIE]; +}; diff --git a/wap/utils/openapi/api.openapi.gen.ts b/wap/utils/openapi/api.openapi.gen.ts new file mode 100644 index 000000000..e4532887a --- /dev/null +++ b/wap/utils/openapi/api.openapi.gen.ts @@ -0,0 +1,639 @@ + +// deno-fmt-ignore-file +// deno-lint-ignore-file no-explicit-any ban-types ban-unused-ignore +// +// DO NOT EDIT. This file is generated by deco. +// This file SHOULD be checked into source version control. +// To generate this file: deno task start +// + + +export interface OpenAPI { +/** + * PUT coupon on session + */ +"PUT /api/v2/front/promotional/coupon/:hashCupom": { + +} +/** + * GET Brands + */ +"GET /api/v2/front/brands": { +searchParams: { +ativo?: string +} +} +/** + * GET Checkout cart + */ +"GET /api/v2/front/checkout/cart": { + +} +/** + * POST Checkout cart + */ +"POST /api/v2/front/checkout/cart": { +body: { +itens?: { +adicional?: string +idArmazem?: number +idAtributoSimples?: number +idProduto?: number +idUnidadeVenda?: number +parametros?: string +quantidade?: number +}[] +tipo?: string +} +} +/** + * PUT Checkout cart + */ +"PUT /api/v2/front/checkout/cart": { +body: { +adicional?: string +idArmazem?: number +idAtributoSimples?: number +idProduto?: number +idUnidadeVenda?: number +quantidade?: number +tipo?: string +} +} +/** + * DELETE Checkout cart + */ +"DELETE /api/v2/front/checkout/cart": { +body: { +adicional?: string +idArmazem?: number +idAtributoSimples?: number +idProduto?: number +idUnidadeVenda?: number +tipo?: string +} +} +/** + * POST Checkout login + */ +"POST /api/v2/front/checkout/login": { +body: { +revendedor?: boolean +senha?: string +usuario?: string +} +} +/** + * POST Checkout password-recovery + */ +"POST /api/v2/front/checkout/password-recovery": { +body: { +usuario?: string +} +} +/** + * GET Checkout user + */ +"GET /api/v2/front/checkout/user": { + +} +/** + * POST Checkout zipcode + */ +"POST /api/v2/front/checkout/zipcode": { +body: { +cep?: string +} +} +/** + * POST Client reseller + */ +"POST /api/v2/front/client/reseller": { +body: { +newsletter?: boolean +sms?: boolean +} +} +/** + * POST Evaluations list + */ +"POST /api/v2/front/evaluations/list": { +body: { +comentario?: string +email?: string +idListaCompra?: number +nome?: string +nota?: number +recomenda?: boolean +} +} +/** + * GET Evaluations product + */ +"GET /api/v2/front/evaluations/product": { +searchParams: { +offset?: string +limit?: string +order?: string +idCategoria?: string +nota?: string +} +} +/** + * POST Evaluations product + */ +"POST /api/v2/front/evaluations/product": { +searchParams: { +offset?: string +limit?: string +order?: string +idCategoria?: string +nota?: string +} +body: { +anexos?: string[] +comentario?: string +email?: string +idProduto?: number +nome?: string +nota?: number +recomenda?: boolean +} +} +/** + * GET Evaluations store add + */ +"GET /api/v2/front/evaluations/store/add/:key": { + +} +/** + * POST Evaluations store add + */ +"POST /api/v2/front/evaluations/store/add/:key": { +body: { +atendimento?: number +autorizacao?: boolean +experiencia?: number +mensagem?: string +satisfacao?: boolean +} +} +/** + * GET Evaluations store + */ +"GET /api/v2/front/evaluations/store": { +searchParams: { +offset?: string +limit?: string +} +} +/** + * POST Form contact + */ +"POST /api/v2/front/form/contact": { +body: { +assunto?: string +contato?: string +email?: string +hashEmail?: string +mensagem?: string +nome?: string +} +} +/** + * POST List shop + */ +"POST /api/v2/front/list/shop": { +body: { +carrinho?: boolean +idListaCompra?: number +produtos?: { +id?: number +idAtributoValor?: number +preco?: number +quantidade?: number +}[] +} +} +/** + * GET Product + */ +"GET /api/v2/front/marketplace/product/:idProduto": { +searchParams: { +offset?: string +limit?: string +productAttributeValueId?: string +sellerId?: string +cep?: string +} +} +/** + * POST Browsing-history + */ +"POST /api/v2/front/browsing-history/:hash": { +body: { +url?: string +} +} +/** + * POST Newsletter associates + */ +"POST /api/v2/front/newsletter/associates": { +body: { +associados?: { +dataNascimento?: string +informacoesAdicionais?: any[] +nome?: string +sexo?: string +}[] +email?: string +} +} +/** + * POST Newsletter + */ +"POST /api/v2/front/newsletter": { +body: { +cupom?: boolean +email?: string +idEvento?: number +informacoesAdicionais?: any[] +nome?: string +segmento?: string +} +} +/** + * GET Ping + */ +"GET /api/v2/front/ping": { + +} +/** + * POST Product budget + */ +"POST /api/v2/front/product/budget": { +body: { +contato?: string +email?: string +enviarEmail?: boolean +idProduto?: number +mailing?: boolean +mensagem?: string +nome?: string +} +} +/** + * POST Product combination + */ +"POST /api/v2/front/product/combination": { +body: { +produtoIndicado?: { +id?: number +idAtributoValor?: number +preco?: number +} +produtoPrincipal?: { +id?: number +idAtributoValor?: number +preco?: number +} +} +} +/** + * GET Product component + */ +"GET /api/v2/front/product/component/:id": { + +} +/** + * GET Product predefination + */ +"GET /api/v2/front/product/predefination": { + +} +/** + * POST Product shop + */ +"POST /api/v2/front/product/shop": { +body: { +carrinho?: boolean +produtos?: { +assinatura?: { +recorrencia?: number +} +conjunto?: { +componentes?: { +idConjuntoComponente?: number +produto?: { +adicional?: string +id?: number +idAtributoValor?: number +preco?: number +quantidade?: number +} +}[] +id?: number +} +editarPreco?: boolean +id?: number +idAtributoValor?: number +personalizacao?: { +id?: number +multiplicarPreco?: string +preco?: number +tipo?: string +valorSelect?: { +id?: number +preco?: number +precoDefault?: string +valor?: string +} +valorText?: string +valorUpload?: string +valoresCheckbox?: { +id?: number +preco?: number +precoDefault?: string +quantidade?: number +valor?: string +}[] +}[] +preco?: number +quantidade?: number +}[] +} +} +/** + * POST Product solicitation + */ +"POST /api/v2/front/product/solicitation": { +body: { +contato?: string +email?: string +idAtributoValor?: number +idProduto?: number +mailing?: boolean +mensagem?: string +nome?: string +} +} +/** + * POST Question answer + */ +"POST /api/v2/front/question/answer": { +body: { +contato?: string +email?: string +idPergunta?: number +nome?: string +resposta?: string +} +} +/** + * POST Question + */ +"POST /api/v2/front/question": { +body: { +contato?: string +email?: string +idNivel?: number +nivel?: string +nome?: string +pergunta?: string +} +} +/** + * POST Sale cancel + */ +"POST /api/v2/front/sale/cancel": { + +} +/** + * GET Sales-channel actual + */ +"GET /api/v2/front/sales-channel/actual": { + +} +/** + * PUT Sales-channel actual + */ +"PUT /api/v2/front/sales-channel/actual": { +body: { +id?: number +} +} +/** + * GET Settings + */ +"GET /api/v2/front/settings": { + +} +/** + * POST Shipment list + */ +"POST /api/v2/front/shipment/list": { +body: { +cep?: string +idLista?: number +quantidade?: number +} +} +/** + * POST Shipment product + */ +"POST /api/v2/front/shipment/product": { +body: { +cep?: string +idAtributoValor?: number +idMarketplaceSeller?: number +idProduto?: number +marketplace?: boolean +quantidade?: number +} +} +/** + * GET Showcase banners + */ +"GET /api/v2/front/showcase/banners/:hash": { + +} +/** + * GET Showcase instagram + */ +"GET /api/v2/front/showcase/instagram": { + +} +/** + * GET Showcase products ultimos-vistos + */ +"GET /api/v2/front/showcase/products/ultimos-vistos": { +searchParams: { +productId?: string +seenProducts?: string +limit?: string +} +} +/** + * GET Showcase products + */ +"GET /api/v2/front/showcase/products/:hash": { + +} +/** + * GET Indicated Showcase products + */ +"GET /api/v2/front/showcase/products/produto-detalhe-indicados": { +searchParams: { +productId?: string +} +} +/** + * GET Struct menus + */ +"GET /api/v2/front/struct/menus/:hash": { + +} +/** + * GET Struct popup + */ +"GET /api/v2/front/struct/popup/:nivel": { + +} +/** + * GET Url home + */ +"GET /api/v2/front/url/home": { + +} +/** + * GET Url list detail + */ +"GET /api/v2/front/url/list/detail": { +searchParams: { +url?: string +} +} +/** + * GET Url list listing + */ +"GET /api/v2/front/url/list/listing": { +searchParams: { +url?: string +offset?: string +order?: string +limit?: string +} +} +/** + * GET Url page + */ +"GET /api/v2/front/url/page": { + +} +/** + * GET Url product detail + */ +"GET /api/v2/front/url/product/detail": { + +} +/** + * GET Url product listing category + */ +"GET /api/v2/front/url/product/listing/category": { +searchParams: { +url?: string +offset?: string +order?: string +limit?: string +} +} +/** + * GET Url product listing brand + */ +"GET /api/v2/front/url/product/listing/brand": { +searchParams: { +url?: string +offset?: string +order?: string +limit?: string +} +} +/** + * GET Url product listing landing-page + */ +"GET /api/v2/front/url/product/listing/landing-page": { +searchParams: { +url?: string +offset?: string +order?: string +limit?: string +} +} +/** + * GET Url product listing search + */ +"GET /api/v2/front/url/product/listing/search": { +searchParams: { +busca?: string +offset?: string +order?: string +limit?: string +} +} +/** + * GET Url verify + */ +"GET /api/v2/front/url/verify": { +searchParams: { +url?: string +} +response: { +/** + * Nível da URL + */ +nivel?: string +} +} +/** + * POST Wishlist add + */ +"POST /api/v2/front/wishlist/add": { +body: { +idAtributoSimples?: number +idProduto?: number +idUnidadeVenda?: number +parametroAdicional?: string +quantidade?: number +} +} +/** + * POST Wishlist remove + */ +"POST /api/v2/front/wishlist/remove": { +body: { +idAtributoSimples?: number +idProduto?: number +idUnidadeVenda?: number +parametroAdicional?: string +quantidade?: number +} +} +/** + * POST Wishlist verify + */ +"POST /api/v2/front/wishlist/verify": { +body: { +idAtributoSimples?: number +idProduto?: number +idUnidadeVenda?: number +parametroAdicional?: string +quantidade?: number +} +} +/** + * GET Wishlist + */ +"GET /api/v2/front/wishlist": { + +} +} diff --git a/wap/utils/openapi/api.openapi.json b/wap/utils/openapi/api.openapi.json new file mode 100644 index 000000000..a8bc1463c --- /dev/null +++ b/wap/utils/openapi/api.openapi.json @@ -0,0 +1,3785 @@ +{ + "openapi": "3.0.3", + "info": { + "title": "API Front-end wap.store", + "version": "1.0.0", + "contact": {} + }, + "servers": [ + { + "url": "{{api.wapstore}}" + }, + { + "url": "https://botuxil.wapstore.dev.br" + } + ], + "paths": { + "/api/v2/front/promotional/coupon/{hashCupom}": { + "put": { + "tags": [], + "summary": "PUT coupon on session", + "description": "PUT coupon on session", + "operationId": "putCoupon", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "hashCupom", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/brands": { + "get": { + "tags": [ + "Brands" + ], + "summary": "GET Brands", + "description": "GET Brands", + "operationId": "getBrands", + "parameters": [ + { + "name": "ativo", + "in": "query", + "schema": { + "type": "string", + "example": "true" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/checkout/cart": { + "get": { + "tags": [ + "Checkout", + "Cart" + ], + "summary": "GET Checkout cart", + "description": "GET Checkout cart", + "operationId": "getCheckoutCart", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "put": { + "tags": [ + "Checkout", + "Cart" + ], + "summary": "PUT Checkout cart", + "description": "PUT Checkout cart", + "operationId": "putCheckoutCart", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "adicional": { + "type": "string", + "example": "Dados adicionais do item (opcional)" + }, + "idArmazem": { + "type": "number", + "example": 41 + }, + "idAtributoSimples": { + "type": "number", + "example": 44 + }, + "idProduto": { + "type": "number", + "example": 52 + }, + "idUnidadeVenda": { + "type": "number", + "example": 34 + }, + "quantidade": { + "type": "number", + "example": 29 + }, + "tipo": { + "type": "string", + "example": "Tipo do item a ser adicionado[produto, lista]" + } + } + }, + "examples": { + "PUT Checkout cart": { + "value": { + "adicional": "Dados adicionais do item (opcional)", + "idArmazem": 41, + "idAtributoSimples": 44, + "idProduto": 52, + "idUnidadeVenda": 34, + "quantidade": 29, + "tipo": "Tipo do item a ser adicionado[produto, lista]" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + }, + "post": { + "tags": [ + "Checkout", + "Cart" + ], + "summary": "POST Checkout cart", + "description": "POST Checkout cart", + "operationId": "postCheckoutCart", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "itens": { + "type": "array", + "items": { + "type": "object", + "properties": { + "adicional": { + "type": "string", + "example": "Dados adicionais do item (opcional)" + }, + "idArmazem": { + "type": "number", + "example": 66 + }, + "idAtributoSimples": { + "type": "number", + "example": 91 + }, + "idProduto": { + "type": "number", + "example": 77 + }, + "idUnidadeVenda": { + "type": "number", + "example": 45 + }, + "parametros": { + "type": "string", + "example": "Parâmetros adicionais (opcional)" + }, + "quantidade": { + "type": "number", + "example": 43 + } + } + }, + "example": [ + { + "adicional": "Dados adicionais do item (opcional)", + "idArmazem": 66, + "idAtributoSimples": 91, + "idProduto": 77, + "idUnidadeVenda": 45, + "parametros": "Parâmetros adicionais (opcional)", + "quantidade": 43 + } + ] + }, + "tipo": { + "type": "string", + "example": "Tipo do item a ser adicionado[produto, lista]" + } + } + }, + "examples": { + "POST Checkout cart": { + "value": { + "itens": [ + { + "adicional": "Dados adicionais do item (opcional)", + "idArmazem": 66, + "idAtributoSimples": 91, + "idProduto": 77, + "idUnidadeVenda": 45, + "parametros": "Parâmetros adicionais (opcional)", + "quantidade": 43 + } + ], + "tipo": "Tipo do item a ser adicionado[produto, lista]" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + }, + "delete": { + "tags": [ + "Checkout", + "Cart" + ], + "summary": "DELETE Checkout cart", + "description": "DELETE Checkout cart", + "operationId": "deleteCheckoutCart", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "adicional": { + "type": "string", + "example": "Dados adicionais do item (opcional)" + }, + "idArmazem": { + "type": "number", + "example": 63 + }, + "idAtributoSimples": { + "type": "number", + "example": 6 + }, + "idProduto": { + "type": "number", + "example": 97 + }, + "idUnidadeVenda": { + "type": "number", + "example": 93 + }, + "tipo": { + "type": "string", + "example": "Tipo do item a ser adicionado[produto, lista]" + } + } + }, + "examples": { + "DELETE Checkout cart": { + "value": { + "adicional": "Dados adicionais do item (opcional)", + "idArmazem": 63, + "idAtributoSimples": 6, + "idProduto": 97, + "idUnidadeVenda": 93, + "tipo": "Tipo do item a ser adicionado[produto, lista]" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/checkout/login": { + "post": { + "tags": [ + "Checkout", + "Login" + ], + "summary": "POST Checkout login", + "description": "POST Checkout login", + "operationId": "postCheckoutLogin", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "revendedor": { + "type": "boolean", + "example": true + }, + "senha": { + "type": "string", + "example": "Senha do cliente" + }, + "usuario": { + "type": "string", + "example": "E-mail, CPF ou CNPJ do cliente" + } + } + }, + "examples": { + "POST Checkout login": { + "value": { + "revendedor": true, + "senha": "Senha do cliente", + "usuario": "E-mail, CPF ou CNPJ do cliente" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/checkout/password-recovery": { + "post": { + "tags": [ + "Checkout", + "Password-recovery" + ], + "summary": "POST Checkout password-recovery", + "description": "POST Checkout password-recovery", + "operationId": "postCheckoutPasswordRecovery", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "usuario": { + "type": "string", + "example": "E-mail, CPF ou CNPJ do usuário que deseja recuperar a senha" + } + } + }, + "examples": { + "POST Checkout password-recovery": { + "value": { + "usuario": "E-mail, CPF ou CNPJ do usuário que deseja recuperar a senha" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/checkout/user": { + "get": { + "tags": [ + "Checkout", + "User" + ], + "summary": "GET Checkout user", + "description": "GET Checkout user", + "operationId": "getCheckoutUser", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/checkout/zipcode": { + "post": { + "tags": [ + "Checkout", + "Zipcode" + ], + "summary": "POST Checkout zipcode", + "description": "POST Checkout zipcode", + "operationId": "postCheckoutZipcode", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "cep": { + "type": "string", + "example": "CEP de entrega" + } + } + }, + "examples": { + "POST Checkout zipcode": { + "value": { + "cep": "CEP de entrega" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/client/reseller": { + "post": { + "tags": [ + "Client", + "Reseller" + ], + "summary": "POST Client reseller", + "description": "POST Client reseller", + "operationId": "postClientReseller", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "newsletter": { + "type": "boolean", + "example": false + }, + "sms": { + "type": "boolean", + "example": false + } + } + }, + "examples": { + "POST Client reseller": { + "value": { + "newsletter": false, + "sms": false + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/evaluations/list": { + "post": { + "tags": [ + "Evaluations", + "List" + ], + "summary": "POST Evaluations list", + "description": "POST Evaluations list", + "operationId": "postEvaluationsList", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "comentario": { + "type": "string", + "example": "Comentário da avaliação" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "idListaCompra": { + "type": "number", + "example": 14 + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + }, + "nota": { + "type": "number", + "example": 36 + }, + "recomenda": { + "type": "boolean", + "example": false + } + } + }, + "examples": { + "POST Evaluations list": { + "value": { + "comentario": "Comentário da avaliação", + "email": "E-mail do cliente", + "idListaCompra": 14, + "nome": "Nome do cliente", + "nota": 36, + "recomenda": false + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/evaluations/product": { + "get": { + "tags": [ + "Evaluations", + "Product" + ], + "summary": "GET Evaluations product", + "description": "GET Evaluations product", + "operationId": "getEvaluationsProduct", + "parameters": [ + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "ASC" + } + }, + { + "name": "idCategoria", + "in": "query", + "schema": { + "type": "string", + "example": "6" + } + }, + { + "name": "nota", + "in": "query", + "schema": { + "type": "string", + "example": "1" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "post": { + "tags": [ + "Evaluations", + "Product" + ], + "summary": "POST Evaluations product", + "description": "POST Evaluations product", + "operationId": "postEvaluationsProduct", + "parameters": [ + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "ASC" + } + }, + { + "name": "idCategoria", + "in": "query", + "schema": { + "type": "string", + "example": "6" + } + }, + { + "name": "nota", + "in": "query", + "schema": { + "type": "string", + "example": "1" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "anexos": { + "type": "array", + "items": { + "type": "string" + }, + "example": [ + "Objeto com os arquivos de uma avaliação (opcional)" + ] + }, + "comentario": { + "type": "string", + "example": "Comentário da avaliação" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "idProduto": { + "type": "number", + "example": 100 + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + }, + "nota": { + "type": "number", + "example": 92 + }, + "recomenda": { + "type": "boolean", + "example": true + } + } + }, + "examples": { + "POST Evaluations product": { + "value": { + "anexos": [ + "Objeto com os arquivos de uma avaliação (opcional)" + ], + "comentario": "Comentário da avaliação", + "email": "E-mail do cliente", + "idProduto": 100, + "nome": "Nome do cliente", + "nota": 92, + "recomenda": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/evaluations/store/add/{key}": { + "get": { + "tags": [ + "Evaluations", + "Store" + ], + "summary": "GET Evaluations store add", + "description": "GET Evaluations store add", + "operationId": "getEvaluationsStoreAdd", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "post": { + "tags": [ + "Evaluations", + "Store" + ], + "summary": "POST Evaluations store add", + "description": "POST Evaluations store add", + "operationId": "postEvaluationsStoreAdd", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "atendimento": { + "type": "number", + "example": 53 + }, + "autorizacao": { + "type": "boolean", + "example": true + }, + "experiencia": { + "type": "number", + "example": 6 + }, + "mensagem": { + "type": "string", + "example": "Mensagem enviada pelo cliente (opcional)" + }, + "satisfacao": { + "type": "boolean", + "example": true + } + } + }, + "examples": { + "POST Evaluations store add": { + "value": { + "atendimento": 53, + "autorizacao": true, + "experiencia": 6, + "mensagem": "Mensagem enviada pelo cliente (opcional)", + "satisfacao": true + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "key", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/evaluations/store": { + "get": { + "tags": [ + "Evaluations", + "Store" + ], + "summary": "GET Evaluations store", + "description": "GET Evaluations store", + "operationId": "getEvaluationsStore", + "parameters": [ + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/form/contact": { + "post": { + "tags": [ + "Form", + "Contact" + ], + "summary": "POST Form contact", + "description": "POST Form contact", + "operationId": "postFormContact", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "assunto": { + "type": "string", + "example": "Assunto da mensagem (opcional)" + }, + "contato": { + "type": "string", + "example": "Número de contato do cliente" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "hashEmail": { + "type": "string", + "example": "Hash do layout de e-mail que será enviado" + }, + "mensagem": { + "type": "string", + "example": "Mensagem enviada pelo cliente (opcional)" + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + } + } + }, + "examples": { + "POST Form contact": { + "value": { + "assunto": "Assunto da mensagem (opcional)", + "contato": "Número de contato do cliente", + "email": "E-mail do cliente", + "hashEmail": "Hash do layout de e-mail que será enviado", + "mensagem": "Mensagem enviada pelo cliente (opcional)", + "nome": "Nome do cliente" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/list/shop": { + "post": { + "tags": [ + "List1", + "Shop" + ], + "summary": "POST List shop", + "description": "POST List shop", + "operationId": "postListShop", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "carrinho": { + "type": "boolean", + "example": true + }, + "idListaCompra": { + "type": "number", + "example": 7 + }, + "produtos": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 20 + }, + "idAtributoValor": { + "type": "number", + "example": 32 + }, + "preco": { + "type": "number", + "example": 54 + }, + "quantidade": { + "type": "number", + "example": 83 + } + } + }, + "example": [ + { + "id": 20, + "idAtributoValor": 32, + "preco": 54, + "quantidade": 83 + } + ] + } + } + }, + "examples": { + "POST List shop": { + "value": { + "carrinho": true, + "idListaCompra": 7, + "produtos": [ + { + "id": 20, + "idAtributoValor": 32, + "preco": 54, + "quantidade": 83 + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/marketplace/product/{idProduto}": { + "get": { + "tags": [ + "Marketplace", + "Product1" + ], + "summary": "GET Product", + "description": "GET Product", + "operationId": "getProduct", + "parameters": [ + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "productAttributeValueId", + "in": "query", + "schema": { + "type": "string", + "example": "2" + } + }, + { + "name": "sellerId", + "in": "query", + "schema": { + "type": "string", + "example": "1" + } + }, + { + "name": "cep", + "in": "query", + "schema": { + "type": "string", + "example": "16202017" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "idProduto", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/browsing-history/{hash}": { + "post": { + "tags": [ + "Browsing-history" + ], + "summary": "POST Browsing-history", + "description": "POST Browsing-history", + "operationId": "postBrowsingHistory", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "url": { + "type": "string", + "example": "Url a ser registrada no histórico" + } + } + }, + "examples": { + "POST Browsing-history": { + "value": { + "url": "Url a ser registrada no histórico" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/newsletter/associates": { + "post": { + "tags": [ + "Newsletter", + "Associates" + ], + "summary": "POST Newsletter associates", + "description": "POST Newsletter associates", + "operationId": "postNewsletterAssociates", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "associados": { + "type": "array", + "items": { + "type": "object", + "properties": { + "dataNascimento": { + "type": "string", + "example": "Data de nascimento do associado" + }, + "informacoesAdicionais": { + "type": "array", + "items": {}, + "example": [] + }, + "nome": { + "type": "string", + "example": "Nome do associado" + }, + "sexo": { + "type": "string", + "example": "Sexo do associado[m, f, i]" + } + } + }, + "example": [ + { + "dataNascimento": "Data de nascimento do associado", + "informacoesAdicionais": [], + "nome": "Nome do associado", + "sexo": "Sexo do associado[m, f, i]" + } + ] + }, + "email": { + "type": "string", + "example": "E-mail da newsletter" + } + } + }, + "examples": { + "POST Newsletter associates": { + "value": { + "associados": [ + { + "dataNascimento": "Data de nascimento do associado", + "informacoesAdicionais": [], + "nome": "Nome do associado", + "sexo": "Sexo do associado[m, f, i]" + } + ], + "email": "E-mail da newsletter" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/newsletter": { + "post": { + "tags": [ + "Newsletter" + ], + "summary": "POST Newsletter", + "description": "POST Newsletter", + "operationId": "postNewsletter", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "cupom": { + "type": "boolean", + "example": false + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "idEvento": { + "type": "number", + "example": 70 + }, + "informacoesAdicionais": { + "type": "array", + "items": {}, + "example": [] + }, + "nome": { + "type": "string", + "example": "Nome da cliente (opcional)" + }, + "segmento": { + "type": "string", + "example": "Define o segmento da campanha[m, h, i] (opcional)" + } + } + }, + "examples": { + "POST Newsletter": { + "value": { + "cupom": false, + "email": "E-mail do cliente", + "idEvento": 70, + "informacoesAdicionais": [], + "nome": "Nome da cliente (opcional)", + "segmento": "Define o segmento da campanha[m, h, i] (opcional)" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/ping": { + "get": { + "tags": [ + "Ping" + ], + "summary": "GET Ping", + "description": "GET Ping", + "operationId": "getPing", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/product/budget": { + "post": { + "tags": [ + "Product12", + "Budget" + ], + "summary": "POST Product budget", + "description": "POST Product budget", + "operationId": "postProductBudget", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contato": { + "type": "string", + "example": "Número de contato do cliente" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "enviarEmail": { + "type": "boolean", + "example": false + }, + "idProduto": { + "type": "number", + "example": 53 + }, + "mailing": { + "type": "boolean", + "example": true + }, + "mensagem": { + "type": "string", + "example": "Mensagem enviada pelo cliente (opcional)" + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + } + } + }, + "examples": { + "POST Product budget": { + "value": { + "contato": "Número de contato do cliente", + "email": "E-mail do cliente", + "enviarEmail": false, + "idProduto": 53, + "mailing": true, + "mensagem": "Mensagem enviada pelo cliente (opcional)", + "nome": "Nome do cliente" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/product/combination": { + "post": { + "tags": [ + "Product12", + "Combination" + ], + "summary": "POST Product combination", + "description": "POST Product combination", + "operationId": "postProductCombination", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "produtoIndicado": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 19 + }, + "idAtributoValor": { + "type": "number", + "example": 17 + }, + "preco": { + "type": "number", + "example": 75 + } + } + }, + "produtoPrincipal": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 44 + }, + "idAtributoValor": { + "type": "number", + "example": 94 + }, + "preco": { + "type": "number", + "example": 18 + } + } + } + } + }, + "examples": { + "POST Product combination": { + "value": { + "produtoIndicado": { + "id": 19, + "idAtributoValor": 17, + "preco": 75 + }, + "produtoPrincipal": { + "id": 44, + "idAtributoValor": 94, + "preco": 18 + } + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/product/component/{id}": { + "get": { + "tags": [ + "Product12", + "Component" + ], + "summary": "GET Product component", + "description": "GET Product component", + "operationId": "getProductComponent", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "id", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/product/predefination": { + "get": { + "tags": [ + "Product12", + "Predefination" + ], + "summary": "GET Product predefination", + "description": "GET Product predefination", + "operationId": "getProductPredefination", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/product/shop": { + "post": { + "tags": [ + "Product12", + "Shop1" + ], + "summary": "POST Product shop", + "description": "POST Product shop", + "operationId": "postProductShop", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "carrinho": { + "type": "boolean", + "example": false + }, + "produtos": { + "type": "array", + "items": { + "type": "object", + "properties": { + "assinatura": { + "type": "object", + "properties": { + "recorrencia": { + "type": "number", + "example": 100 + } + } + }, + "conjunto": { + "type": "object", + "properties": { + "componentes": { + "type": "array", + "items": { + "type": "object", + "properties": { + "idConjuntoComponente": { + "type": "number", + "example": 94 + }, + "produto": { + "type": "object", + "properties": { + "adicional": { + "type": "string", + "example": "Hash com as informações adicionais do produto (opcional)" + }, + "id": { + "type": "number", + "example": 29 + }, + "idAtributoValor": { + "type": "number", + "example": 68 + }, + "preco": { + "type": "number", + "example": 47 + }, + "quantidade": { + "type": "number", + "example": 62 + } + } + } + } + }, + "example": [ + { + "idConjuntoComponente": 94, + "produto": { + "adicional": "Hash com as informações adicionais do produto (opcional)", + "id": 29, + "idAtributoValor": 68, + "preco": 47, + "quantidade": 62 + } + } + ] + }, + "id": { + "type": "number", + "example": 38 + } + } + }, + "editarPreco": { + "type": "boolean", + "example": false + }, + "id": { + "type": "number", + "example": 94 + }, + "idAtributoValor": { + "type": "number", + "example": 7 + }, + "personalizacao": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 73 + }, + "multiplicarPreco": { + "type": "string", + "example": "Multiplicar preço da personalização[s, n]" + }, + "preco": { + "type": "number", + "example": 26 + }, + "tipo": { + "type": "string", + "example": "Tipo da personalização" + }, + "valorSelect": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 74 + }, + "preco": { + "type": "number", + "example": 81 + }, + "precoDefault": { + "type": "string", + "example": "Utilizar preço default da personalização[s, n]" + }, + "valor": { + "type": "string", + "example": "Valor da personalização (opcional)" + } + } + }, + "valorText": { + "type": "string", + "example": "Valor da personalização tipo text (opcional)" + }, + "valorUpload": { + "type": "string", + "example": "Valor do arquivo de upload em base64 (opcional)" + }, + "valoresCheckbox": { + "type": "array", + "items": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 60 + }, + "preco": { + "type": "number", + "example": 11 + }, + "precoDefault": { + "type": "string", + "example": "Utilizar preço default da personalização[s, n]" + }, + "quantidade": { + "type": "number", + "example": 36 + }, + "valor": { + "type": "string", + "example": "Valor da personalização (opcional)" + } + } + }, + "example": [ + { + "id": 60, + "preco": 11, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "quantidade": 36, + "valor": "Valor da personalização (opcional)" + } + ] + } + } + }, + "example": [ + { + "id": 73, + "multiplicarPreco": "Multiplicar preço da personalização[s, n]", + "preco": 26, + "tipo": "Tipo da personalização", + "valorSelect": { + "id": 74, + "preco": 81, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "valor": "Valor da personalização (opcional)" + }, + "valorText": "Valor da personalização tipo text (opcional)", + "valorUpload": "Valor do arquivo de upload em base64 (opcional)", + "valoresCheckbox": [ + { + "id": 60, + "preco": 11, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "quantidade": 36, + "valor": "Valor da personalização (opcional)" + } + ] + } + ] + }, + "preco": { + "type": "number", + "example": 19 + }, + "quantidade": { + "type": "number", + "example": 28 + } + } + }, + "example": [ + { + "assinatura": { + "recorrencia": 100 + }, + "conjunto": { + "componentes": [ + { + "idConjuntoComponente": 94, + "produto": { + "adicional": "Hash com as informações adicionais do produto (opcional)", + "id": 29, + "idAtributoValor": 68, + "preco": 47, + "quantidade": 62 + } + } + ], + "id": 38 + }, + "editarPreco": false, + "id": 94, + "idAtributoValor": 7, + "personalizacao": [ + { + "id": 73, + "multiplicarPreco": "Multiplicar preço da personalização[s, n]", + "preco": 26, + "tipo": "Tipo da personalização", + "valorSelect": { + "id": 74, + "preco": 81, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "valor": "Valor da personalização (opcional)" + }, + "valorText": "Valor da personalização tipo text (opcional)", + "valorUpload": "Valor do arquivo de upload em base64 (opcional)", + "valoresCheckbox": [ + { + "id": 60, + "preco": 11, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "quantidade": 36, + "valor": "Valor da personalização (opcional)" + } + ] + } + ], + "preco": 19, + "quantidade": 28 + } + ] + } + } + }, + "examples": { + "POST Product shop": { + "value": { + "carrinho": false, + "produtos": [ + { + "assinatura": { + "recorrencia": 100 + }, + "conjunto": { + "componentes": [ + { + "idConjuntoComponente": 94, + "produto": { + "adicional": "Hash com as informações adicionais do produto (opcional)", + "id": 29, + "idAtributoValor": 68, + "preco": 47, + "quantidade": 62 + } + } + ], + "id": 38 + }, + "editarPreco": false, + "id": 94, + "idAtributoValor": 7, + "personalizacao": [ + { + "id": 73, + "multiplicarPreco": "Multiplicar preço da personalização[s, n]", + "preco": 26, + "tipo": "Tipo da personalização", + "valorSelect": { + "id": 74, + "preco": 81, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "valor": "Valor da personalização (opcional)" + }, + "valorText": "Valor da personalização tipo text (opcional)", + "valorUpload": "Valor do arquivo de upload em base64 (opcional)", + "valoresCheckbox": [ + { + "id": 60, + "preco": 11, + "precoDefault": "Utilizar preço default da personalização[s, n]", + "quantidade": 36, + "valor": "Valor da personalização (opcional)" + } + ] + } + ], + "preco": 19, + "quantidade": 28 + } + ] + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/product/solicitation": { + "post": { + "tags": [ + "Product12", + "Solicitation" + ], + "summary": "POST Product solicitation", + "description": "POST Product solicitation", + "operationId": "postProductSolicitation", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contato": { + "type": "string", + "example": "Número de contato do cliente (opcional)" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "idAtributoValor": { + "type": "number", + "example": 92 + }, + "idProduto": { + "type": "number", + "example": 55 + }, + "mailing": { + "type": "boolean", + "example": true + }, + "mensagem": { + "type": "string", + "example": "Mensagem enviada pelo cliente (opcional)" + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + } + } + }, + "examples": { + "POST Product solicitation": { + "value": { + "contato": "Número de contato do cliente (opcional)", + "email": "E-mail do cliente", + "idAtributoValor": 92, + "idProduto": 55, + "mailing": true, + "mensagem": "Mensagem enviada pelo cliente (opcional)", + "nome": "Nome do cliente" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/question/answer": { + "post": { + "tags": [ + "Question", + "Answer" + ], + "summary": "POST Question answer", + "description": "POST Question answer", + "operationId": "postQuestionAnswer", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contato": { + "type": "string", + "example": "Número de contato do cliente (opcional)" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "idPergunta": { + "type": "number", + "example": 39 + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + }, + "resposta": { + "type": "string", + "example": "Resposta enviada pelo cliente" + } + } + }, + "examples": { + "POST Question answer": { + "value": { + "contato": "Número de contato do cliente (opcional)", + "email": "E-mail do cliente", + "idPergunta": 39, + "nome": "Nome do cliente", + "resposta": "Resposta enviada pelo cliente" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/question": { + "post": { + "tags": [ + "Question" + ], + "summary": "POST Question", + "description": "POST Question", + "operationId": "postQuestion", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "contato": { + "type": "string", + "example": "Número de contato do cliente (opcional)" + }, + "email": { + "type": "string", + "example": "E-mail do cliente" + }, + "idNivel": { + "type": "number", + "example": 41 + }, + "nivel": { + "type": "string", + "example": "Nível vinculado a pergunta[produto, categoria, marca, landingPage]" + }, + "nome": { + "type": "string", + "example": "Nome do cliente" + }, + "pergunta": { + "type": "string", + "example": "Pergunta enviada pelo cliente" + } + } + }, + "examples": { + "POST Question": { + "value": { + "contato": "Número de contato do cliente (opcional)", + "email": "E-mail do cliente", + "idNivel": 41, + "nivel": "Nível vinculado a pergunta[produto, categoria, marca, landingPage]", + "nome": "Nome do cliente", + "pergunta": "Pergunta enviada pelo cliente" + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/sale/cancel": { + "post": { + "tags": [ + "Sale", + "Cancel" + ], + "summary": "POST Sale cancel", + "description": "POST Sale cancel", + "operationId": "postSaleCancel", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/sales-channel/actual": { + "get": { + "tags": [ + "Sales-channel", + "Actual" + ], + "summary": "GET Sales-channel actual", + "description": "GET Sales-channel actual", + "operationId": "getSalesChannelActual", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "put": { + "tags": [ + "Sales-channel", + "Actual" + ], + "summary": "PUT Sales-channel actual", + "description": "PUT Sales-channel actual", + "operationId": "putSalesChannelActual", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "id": { + "type": "number", + "example": 44 + } + } + }, + "examples": { + "PUT Sales-channel actual": { + "value": { + "id": 44 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/settings": { + "get": { + "tags": [ + "Settings" + ], + "summary": "GET Settings", + "description": "GET Settings", + "operationId": "getSettings", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/shipment/list": { + "post": { + "tags": [ + "Shipment", + "List12" + ], + "summary": "POST Shipment list", + "description": "POST Shipment list", + "operationId": "postShipmentList", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "cep": { + "type": "string", + "example": "CEP de entrega (somente números)" + }, + "idLista": { + "type": "number", + "example": 92 + }, + "quantidade": { + "type": "number", + "example": 44 + } + } + }, + "examples": { + "POST Shipment list": { + "value": { + "cep": "CEP de entrega (somente números)", + "idLista": 92, + "quantidade": 44 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/shipment/product": { + "post": { + "tags": [ + "Shipment", + "Product123" + ], + "summary": "POST Shipment product", + "description": "POST Shipment product", + "operationId": "postShipmentProduct", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "cep": { + "type": "string", + "example": "CEP de entrega (somente números)" + }, + "idAtributoValor": { + "type": "number", + "example": 8 + }, + "idMarketplaceSeller": { + "type": "number", + "example": 26 + }, + "idProduto": { + "type": "number", + "example": 28 + }, + "marketplace": { + "type": "boolean", + "example": true + }, + "quantidade": { + "type": "number", + "example": 75 + } + } + }, + "examples": { + "POST Shipment product": { + "value": { + "cep": "CEP de entrega (somente números)", + "idAtributoValor": 8, + "idMarketplaceSeller": 26, + "idProduto": 28, + "marketplace": true, + "quantidade": 75 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/showcase/banners/{hash}": { + "get": { + "tags": [ + "Showcase", + "Banners" + ], + "summary": "GET Showcase banners", + "description": "GET Showcase banners", + "operationId": "getShowcaseBanners", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/showcase/instagram": { + "get": { + "tags": [ + "Showcase", + "Instagram" + ], + "summary": "GET Showcase instagram", + "description": "GET Showcase instagram", + "operationId": "getShowcaseInstagram", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/showcase/products/ultimos-vistos": { + "get": { + "tags": [ + "Showcase", + "Products" + ], + "summary": "GET Showcase products ultimos-vistos", + "description": "GET Showcase products ultimos-vistos", + "operationId": "getShowcaseProductsUltimosVistos", + "parameters": [ + { + "name": "productId", + "in": "query", + "schema": { + "type": "string", + "example": "223" + } + }, + { + "name": "seenProducts", + "in": "query", + "schema": { + "type": "string", + "example": "8;9;2;654" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/showcase/products/{hash}": { + "get": { + "tags": [ + "Showcase", + "Products" + ], + "summary": "GET Showcase products", + "description": "GET Showcase products", + "operationId": "getShowcaseProducts", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/showcase/products/produto-detalhe-indicados": { + "get": { + "tags": [ + "Showcase", + "Products" + ], + "summary": "GET Indicated Showcase products", + "description": "GET Indicated Showcase products", + "operationId": "getIndicatedShowcaseProducts", + "parameters": [ + { + "name": "productId", + "in": "query", + "schema": { + "type": "string", + "example": "223" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/struct/menus/{hash}": { + "get": { + "tags": [ + "Struct", + "Menus" + ], + "summary": "GET Struct menus", + "description": "GET Struct menus", + "operationId": "getStructMenus", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "hash", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/struct/popup/{nivel}": { + "get": { + "tags": [ + "Struct", + "Popup" + ], + "summary": "GET Struct popup", + "description": "GET Struct popup", + "operationId": "getStructPopup", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + }, + "parameters": [ + { + "name": "nivel", + "in": "path", + "required": true, + "schema": { + "type": "string" + } + } + ] + }, + "/api/v2/front/url/home": { + "get": { + "tags": [ + "Url", + "Home" + ], + "summary": "GET Url home", + "description": "GET Url home", + "operationId": "getUrlHome", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/list/detail": { + "get": { + "tags": [ + "Url", + "List123" + ], + "summary": "GET Url list detail", + "description": "GET Url list detail", + "operationId": "getUrlListDetail", + "parameters": [ + { + "name": "url", + "in": "query", + "schema": { + "type": "string", + "example": "/lista/lista-de-compra.html" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "AppToken", + "in": "header", + "schema": { + "type": "string", + "example": "wapstore" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/list/listing": { + "get": { + "tags": [ + "Url", + "List123" + ], + "summary": "GET Url list listing", + "description": "GET Url list listing", + "operationId": "getUrlListListing", + "parameters": [ + { + "name": "url", + "in": "query", + "schema": { + "type": "string", + "example": "/seu-filtro" + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "Popularidade" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/page": { + "get": { + "tags": [ + "Url", + "Page" + ], + "summary": "GET Url page", + "description": "GET Url page", + "operationId": "getUrlPage", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/product/detail": { + "get": { + "tags": [ + "Url", + "Product1234" + ], + "summary": "GET Url product detail", + "description": "GET Url product detail", + "operationId": "getUrlProductDetail", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/product/listing/category": { + "get": { + "tags": [ + "Url", + "Product1234" + ], + "summary": "GET Url product listing category", + "description": "GET Url product listing category", + "operationId": "getUrlProductListingCategory", + "parameters": [ + { + "name": "url", + "in": "query", + "schema": { + "type": "string", + "example": "/seu-filtro" + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "Popularidade" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/product/listing/brand": { + "get": { + "tags": [ + "Url", + "Product1234" + ], + "summary": "GET Url product listing brand", + "description": "GET Url product listing brand", + "operationId": "getUrlProductListingBrand", + "parameters": [ + { + "name": "url", + "in": "query", + "schema": { + "type": "string", + "example": "/seu-filtro" + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "Popularidade" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/product/listing/landing-page": { + "get": { + "tags": [ + "Url", + "Product1234" + ], + "summary": "GET Url product listing landing-page", + "description": "GET Url product listing landing-page", + "operationId": "getUrlProductListingLandingPage", + "parameters": [ + { + "name": "url", + "in": "query", + "schema": { + "type": "string", + "example": "/c/seu-filtro" + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "Popularidade" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/product/listing/search": { + "get": { + "tags": [ + "Url", + "Product1234" + ], + "summary": "GET Url product listing search", + "description": "GET Url product listing search", + "operationId": "getUrlProductListingSearch", + "parameters": [ + { + "name": "busca", + "in": "query", + "schema": { + "type": "string", + "example": "Sua busca" + } + }, + { + "name": "offset", + "in": "query", + "schema": { + "type": "string", + "example": "0" + } + }, + { + "name": "order", + "in": "query", + "schema": { + "type": "string", + "example": "Popularidade" + } + }, + { + "name": "limit", + "in": "query", + "schema": { + "type": "string", + "example": "100" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/url/verify": { + "get": { + "tags": [ + "Url", + "Verify" + ], + "summary": "GET Url verify", + "description": "GET Url verify", + "operationId": "getUrlVerify", + "parameters": [ + { + "name": "url", + "in": "query", + "schema": { + "type": "string", + "example": "/lista/lista-de-teste-para-api.html" + } + }, + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "example": { + "nivel": "product/listing/brand" + }, + "type": "object", + "properties": { + "nivel": { + "type": "string", + "description": "Nível da URL" + } + } + } + } + } + } + } + } + }, + "/api/v2/front/wishlist/add": { + "post": { + "tags": [ + "Wishlist", + "Add" + ], + "summary": "POST Wishlist add", + "description": "POST Wishlist add", + "operationId": "postWishlistAdd", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "idAtributoSimples": { + "type": "number", + "example": 88 + }, + "idProduto": { + "type": "number", + "example": 91 + }, + "idUnidadeVenda": { + "type": "number", + "example": 87 + }, + "parametroAdicional": { + "type": "string", + "example": "Paremetro adicional referente a personalização do produto (opcional)" + }, + "quantidade": { + "type": "number", + "example": 59 + } + } + }, + "examples": { + "POST Wishlist add": { + "value": { + "idAtributoSimples": 88, + "idProduto": 91, + "idUnidadeVenda": 87, + "parametroAdicional": "Paremetro adicional referente a personalização do produto (opcional)", + "quantidade": 59 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/wishlist/remove": { + "post": { + "tags": [ + "Wishlist", + "Remove" + ], + "summary": "POST Wishlist remove", + "description": "POST Wishlist remove", + "operationId": "postWishlistRemove", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "idAtributoSimples": { + "type": "number", + "example": 36 + }, + "idProduto": { + "type": "number", + "example": 90 + }, + "idUnidadeVenda": { + "type": "number", + "example": 83 + }, + "parametroAdicional": { + "type": "string", + "example": "Paremetro adicional referente a personalização do produto (opcional)" + }, + "quantidade": { + "type": "number", + "example": 25 + } + } + }, + "examples": { + "POST Wishlist remove": { + "value": { + "idAtributoSimples": 36, + "idProduto": 90, + "idUnidadeVenda": 83, + "parametroAdicional": "Paremetro adicional referente a personalização do produto (opcional)", + "quantidade": 25 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/wishlist/verify": { + "post": { + "tags": [ + "Wishlist", + "Verify1" + ], + "summary": "POST Wishlist verify", + "description": "POST Wishlist verify", + "operationId": "postWishlistVerify", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "object", + "properties": { + "idAtributoSimples": { + "type": "number", + "example": 27 + }, + "idProduto": { + "type": "number", + "example": 56 + }, + "idUnidadeVenda": { + "type": "number", + "example": 50 + }, + "parametroAdicional": { + "type": "string", + "example": "Paremetro adicional referente a personalização do produto (opcional)" + }, + "quantidade": { + "type": "number", + "example": 91 + } + } + }, + "examples": { + "POST Wishlist verify": { + "value": { + "idAtributoSimples": 27, + "idProduto": 56, + "idUnidadeVenda": 50, + "parametroAdicional": "Paremetro adicional referente a personalização do produto (opcional)", + "quantidade": 91 + } + } + } + } + } + }, + "responses": { + "200": { + "description": "" + } + } + } + }, + "/api/v2/front/wishlist": { + "get": { + "tags": [ + "Wishlist" + ], + "summary": "GET Wishlist", + "description": "GET Wishlist", + "operationId": "getWishlist", + "parameters": [ + { + "name": "Cache-Control", + "in": "header", + "schema": { + "type": "string", + "example": "no-cache" + } + }, + { + "name": "App-Token", + "in": "header", + "schema": { + "type": "string", + "example": "{{api.wapstore.v2.appToken}}" + } + }, + { + "name": "Session", + "in": "header", + "schema": { + "type": "string", + "example": "{{sessionId}}" + } + } + ], + "responses": { + "200": { + "description": "" + } + } + } + } + }, + "tags": [ + { + "name": "Brands" + }, + { + "name": "Checkout" + }, + { + "name": "Cart" + }, + { + "name": "Login" + }, + { + "name": "Password-recovery" + }, + { + "name": "User" + }, + { + "name": "Zipcode" + }, + { + "name": "Client" + }, + { + "name": "Reseller" + }, + { + "name": "Evaluations" + }, + { + "name": "List" + }, + { + "name": "Product" + }, + { + "name": "Store" + }, + { + "name": "Form" + }, + { + "name": "Contact" + }, + { + "name": "List1" + }, + { + "name": "Shop" + }, + { + "name": "Marketplace" + }, + { + "name": "Product1" + }, + { + "name": "Browsing-history" + }, + { + "name": "Newsletter" + }, + { + "name": "Associates" + }, + { + "name": "Ping" + }, + { + "name": "Product12" + }, + { + "name": "Budget" + }, + { + "name": "Combination" + }, + { + "name": "Component" + }, + { + "name": "Predefination" + }, + { + "name": "Shop1" + }, + { + "name": "Solicitation" + }, + { + "name": "Question" + }, + { + "name": "Answer" + }, + { + "name": "Sale" + }, + { + "name": "Cancel" + }, + { + "name": "Sales-channel" + }, + { + "name": "Actual" + }, + { + "name": "Settings" + }, + { + "name": "Shipment" + }, + { + "name": "List12" + }, + { + "name": "Product123" + }, + { + "name": "Showcase" + }, + { + "name": "Banners" + }, + { + "name": "Instagram" + }, + { + "name": "Products" + }, + { + "name": "Struct" + }, + { + "name": "Menus" + }, + { + "name": "Popup" + }, + { + "name": "Url" + }, + { + "name": "Home" + }, + { + "name": "List123" + }, + { + "name": "Page" + }, + { + "name": "Product1234" + }, + { + "name": "Verify" + }, + { + "name": "Wishlist" + }, + { + "name": "Add" + }, + { + "name": "Remove" + }, + { + "name": "Verify1" + } + ] +} diff --git a/wap/utils/transform.ts b/wap/utils/transform.ts new file mode 100644 index 000000000..c00041037 --- /dev/null +++ b/wap/utils/transform.ts @@ -0,0 +1,434 @@ +import { + Answer, + Filter, + FilterToggleValue, + ItemAvailability, + Product, + ProductGroup, + ProductLeaf, + PropertyValue, + Question, + UnitPriceSpecification, +} from "../../commerce/types.ts"; +import { + Breadcrumb, + ConteudoMidias, + Detalhes, + ValorSimples, + WapProductDatiled, + WapProduto, +} from "../utils/type.ts"; +import { DEFAULT_IMAGE } from "../../commerce/utils/constants.ts"; + +export const getUrl = (link: string, origin: string) => { + return new URL(link, origin); +}; + +export const toBreadcrumbList = ( + breadcrumbs: Breadcrumb[], + baseUrl: string, +) => { + return breadcrumbs.slice(1).map((breadcrumb, index) => ( + { + "@type": "ListItem" as const, + item: getUrl(new URL(breadcrumb.url).pathname, baseUrl).href, + name: breadcrumb.label, + position: index, + } + )); +}; + +export const getProductStatus = ( + status: WapProduto["status"], + estoque: number, +): ItemAvailability => { + if (status === "disponivel" && estoque > 1) { + return "https://schema.org/InStock"; + } + if (status === "sobConsulta") return "https://schema.org/PreOrder"; + + return "https://schema.org/OutOfStock"; +}; + +export const getPrices = ( + precos: WapProduto["precos"] | WapProductDatiled["precos"], +) => { + const priceSpecification: UnitPriceSpecification[] = []; + + if (precos?.parcelamento) { + precos.parcelamento.forEach((installmentPlan) => { + if (!installmentPlan) return null; + + priceSpecification.push({ + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/SalePrice", + priceComponentType: "https://schema.org/Installment", + billingDuration: installmentPlan?.parcelas, + billingIncrement: installmentPlan?.valorParcela, + price: installmentPlan.valorTotal, + }); + }); + } + + if (precos.de) { + priceSpecification.push({ + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/ListPrice", + price: precos.de, + }); + } + if (precos.por) { + priceSpecification.push({ + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/SalePrice", + price: precos.por, + }); + } + if (precos.vista) { + priceSpecification.push({ + "@type": "UnitPriceSpecification", + priceType: "https://schema.org/MinimumAdvertisedPrice", + price: precos.vista, + }); + } + + return priceSpecification; +}; + +export const toOffers = ( + i: WapProduto | WapProductDatiled | ValorSimples, + status: WapProduto["status"], +) => { + return { + "@type": "AggregateOffer" as const, + highPrice: i.precos.por ?? null, + lowPrice: i.precos.vista ?? null, + priceCurrency: "BRL", + offerCount: 1, + offers: [{ + "@type": "Offer" as const, + price: i.precos.por, + availability: getProductStatus(status, i.estoque), + inventoryLevel: { + value: i.estoque, + }, + priceSpecification: getPrices(i.precos), + }], + }; +}; + +export const toProduct = ( + product: WapProduto | WapProductDatiled, + baseUrl: string, +): Product => { + const additionalProperty: PropertyValue[] = []; + + Object.entries(product.descricoes).forEach(([key, value]) => { + if (!value) return; + + additionalProperty.push({ + "@type": "PropertyValue", + name: key, + value, + valueReference: "DESCRICOES", + }); + }); + + if ((product as WapProductDatiled)?.assinatura) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "assinatura", + value: String((product as WapProductDatiled).assinatura), + valueReference: "PROPERTY", + }); + } + + if ((product as WapProductDatiled)?.video) { + additionalProperty.push({ + "@type": "PropertyValue", + name: "video", + value: (product as WapProductDatiled)?.video?.url, + description: (product as WapProductDatiled).video?.plataforma, + valueReference: "PROPERTY", + }); + } + + (product.midias as ConteudoMidias)?.arquivos?.map((arquivo) => { + additionalProperty.push({ + "@type": "PropertyValue", + name: arquivo.label, + value: arquivo.arquivo, + valueReference: "MIDIAS_ARQUIVOS", + identifier: String(arquivo.id), + description: arquivo.descricao, + }); + }); + + (product.midias as ConteudoMidias)?.manuais?.map((manual) => { + additionalProperty.push({ + "@type": "PropertyValue", + name: manual.label, + value: manual.arquivo, + valueReference: "MIDIAS_MANUAIS", + identifier: String(manual.id), + description: manual.descricao, + }); + }); + + product?.selos?.forEach((selo) => { + additionalProperty.push({ + "@type": "PropertyValue", + name: selo.nome, + value: selo.label, + valueReference: "SELOS", + image: [{ + "@type": "ImageObject", + url: selo.imagem, + }], + }); + }); + + if (product?.filtros) { + product?.filtros.forEach((filtro) => { + additionalProperty.push({ + "@type": "PropertyValue", + name: filtro.nome, + value: filtro.label, + identifier: String(filtro.idFiltro), + valueReference: "FILTROS", + image: [{ + "@type": "ImageObject", + url: filtro.imagem, + }], + }); + }); + } + + const sku = new URL(baseUrl).searchParams.get("sku"); + + const images = product.midias.imagens.map((image) => ({ + "@type": "ImageObject" as const, + name: image.label, + description: image.descricao, + url: image.arquivos.big ?? "", + })); + + const hasVariant: ProductLeaf[] = (product as WapProductDatiled).atributos + ?.simples?.valores.map((v) => ({ + "@type": "Product", + productID: product.id.toString(), + sku: v.sku, + offers: toOffers(v, product.status), + name: product.nome, + url: `${ + getUrl(`/${product.rota.params.produto}`, baseUrl).href + }.html?sku=${v.sku}`, + additionalProperty: [ + { + "@type": "PropertyValue", + name: (product as WapProductDatiled).atributos?.simples.nome, + value: v.label, + propertyID: String(v.idAtributoValor), + image: [{ "@type": "ImageObject", name: "imagem", url: v.imagem }, { + "@type": "ImageObject", + name: "imagemOriginal", + url: v.imagemOriginal, + }], + valueReference: "ATRIBUTO SIMPLES", + }, + ], + })) ?? []; + + (product as WapProductDatiled).atributos + ?.unico?.valores.forEach((v) => { + hasVariant.push({ + "@type": "Product", + productID: product.id.toString(), + sku: product.sku, + offers: toOffers(product, product.status), + name: product.nome, + url: `${ + getUrl(`/${product.rota.params.produto}`, baseUrl).href + }.html?sku=${product.sku}`, + additionalProperty: [ + { + "@type": "PropertyValue", + name: (product as WapProductDatiled).atributos?.unico.nome, + value: v.label, + propertyID: String(v.idAtributoValor), + image: [{ "@type": "ImageObject", name: "imagem", url: v.imagem }, { + "@type": "ImageObject", + name: "imagemOriginal", + url: v.imagemOriginal, + }], + valueReference: "ATRIBUTO UNICO", + }, + ], + }); + }); + + const selected = hasVariant.find((i) => i.sku == sku) ?? hasVariant[0]; + + const isVariantOf: ProductGroup = { + "@type": "ProductGroup", + hasVariant, + productGroupID: product.id.toString(), + additionalProperty, + }; + + return { + // @ts-ignore its necessary to product without any variation spec + productID: product.id.toString(), + name: product.nome, + description: product.descricoes.longa, + brand: { + "@type": "Brand", + identifier: product.marca.id.toString(), + name: product.marca.nome, + logo: product.marca.imagem, + url: new URL(product.marca.rota.path, baseUrl).href, + }, + url: `${getUrl(`/${product.rota.params.produto}`, baseUrl).href}.html`, + image: images.length ? images : [DEFAULT_IMAGE], + category: (product as WapProductDatiled)?.categoria?.nome, + isVariantOf, + aggregateRating: product.avaliacao.quantidade > 0 + ? { + "@type": "AggregateRating", + ratingValue: product.avaliacao.media, + ratingCount: product.avaliacao.quantidade, + reviewCount: product.avaliacao.avaliacoes?.length, + } + : undefined, + review: product.avaliacao.avaliacoes?.map((avaliacao) => ({ + "@type": "Review", + // "@id": avaliacao.id, + author: [{ + "@type": "Author", + name: avaliacao.nome, + identifier: avaliacao.email, + }], + reviewBody: avaliacao?.comentario, + datePublished: avaliacao?.data, + itemReviewed: String(avaliacao?.produto?.id), + reviewRating: { + "@type": "AggregateRating", + ratingValue: avaliacao.nota, + ratingCount: 1, + bestRating: 5, + worstRating: 1, + }, + // TODO PARSE RATING MEDIA + // media: avaliacao.anexos.map((anexo: unknown) => ({})), + })), + + offers: toOffers(product, product.status), + isRelatedTo: (product as WapProductDatiled).combinacoes?.map(( + combinacao, + ) => toProduct(combinacao.produto, baseUrl)), + questions: (product as WapProductDatiled).perguntas?.map(( + pergunta, + ): Question => ({ + "@type": "Question", + answerCount: pergunta.respostas.length, + name: pergunta.pergunta, + text: pergunta.pergunta, + datePublished: pergunta.data, + suggestedAnswer: pergunta.respostas.map((resposta): Answer => ( + { + datePublished: resposta.data, + text: resposta.resposta, + author: [{ + "@type": "Author", + identifier: resposta.email, + name: resposta.nome, + }], + } + )), + author: [{ + "@type": "Author", + identifier: pergunta.email, + name: pergunta.nome, + }], + })), + ...selected, + }; +}; + +export const toFilter = ( + filtro: { + nome: string; + valores: Array< + { label?: string; nome?: string; url: string; ativo: boolean } + >; + }, + baseUrl: string, +): Filter | null => { + if (!filtro.valores.length) return null; + + return { + "@type": "FilterToggle", + key: filtro.nome, + label: filtro.nome, + quantity: filtro.valores?.length ?? 0, + values: filtro.valores?.map((filterItem): FilterToggleValue => { + const filterURL = new URL(baseUrl); + filterURL.pathname = new URL(filterItem.url).pathname; + filterURL.search = new URL(filterItem.url).search; + + return { + quantity: 0, + value: filterItem.label ?? filterItem.nome ?? "", + label: filterItem.label ?? filterItem.nome ?? "", + selected: filterItem.ativo, + url: filterURL.href, + }; + }) ?? [], + }; +}; + +export const toFilters = ( + details: Detalhes, + baseUrl: string, +): Filter[] => { + const filters = []; + + const fromFiltros = details.filtros.map((filtro) => + toFilter(filtro, baseUrl) + ); + + const fromMarcas = toFilter({ + nome: "marca", + valores: details.marcas, + }, baseUrl); + + const fromAttributes = details.atributos.map((filtro) => + toFilter(filtro, baseUrl) + ); + + const fromPrecos = toFilter({ + nome: "preco", + valores: details.filtrosPreco.map((i) => ({ + nome: `${i.de}-${i.ate}`, + ...i, + })), + }, baseUrl); + + const fromDescontoPrecoPor = toFilter({ + nome: "Desconto Preco Por", + valores: Object.values(details.filtrosDescontoPrecoPor).map((i) => ({ + nome: `${i.de}-${i.ate}`, + ...i, + })), + }, baseUrl); + + filters.push( + ...fromFiltros, + fromMarcas, + ...fromAttributes, + fromPrecos, + fromDescontoPrecoPor, + ); + + return filters.filter((f): f is Filter => Boolean(f)); +}; diff --git a/wap/utils/type.ts b/wap/utils/type.ts new file mode 100644 index 000000000..ce806d890 --- /dev/null +++ b/wap/utils/type.ts @@ -0,0 +1,1051 @@ +// Generated by https://quicktype.io + +export interface Status { + sucesso: boolean; +} +export interface WapProductsShowcasePage { + vitrine: Vitrine; + produtos: WapProduto[]; +} + +export interface Vitrine { + id: number; + nivel: string; + titulo: string; + tagTitulo: string; +} + +export interface WapProductsListPage { + estrutura: Estrutura; + conteudo: Conteudo; + info: Info; +} +export interface WapProductDatailsPage { + estrutura: Estrutura; + conteudo: WapProductDatiled; + info: Info; +} + +export interface Conteudo { + busca: Busca; + layoutPersonalizado: LayoutPersonalizado; + produtos: WapProduto[]; + detalhes: Detalhes; +} + +export interface Busca { + texto: string; + sugestao?: unknown[]; +} + +export interface Detalhes { + categorias: Categorias; + marcas: MarcaElement[]; + filtros: SiteElement[]; + filtrosPreco: FiltrosPreco[]; + filtrosDescontoPrecoPor: FiltroDescontoPrecoPor; + selos: Selo[]; + atributos: Atributo[]; + ordenacao: Ordenacao[]; +} + +export interface Atributo { + id: number; + nome: string; + tipo: string; + valores: AtributoValores[]; + dominio?: string; +} + +export interface AtributoValores { + id: number; + label: string; + imagem: string; + imagemOriginal: string; + ordem: number; + ativo: boolean; + rota: PurpleRota; + url: string; +} + +export interface PurpleRota { + name: string; + params?: unknown[]; + query: Query; +} + +export interface Categorias { + niveisAnteriores?: unknown[]; + atual?: unknown[]; + irmas?: unknown[]; + filhas?: unknown[]; +} + +export interface SiteElement { + id: number; + nome: string; + tipo: string; + valores: FiltroValores[]; + dominio?: string; +} + +export interface FiltroValores { + id: number; + label: string; + imagem: string; + imagemOriginal: string; + ordem: number; + ativo: boolean; + rota: FluffyRota; + url: string; +} + +export interface FluffyRota { + name: string; + params?: unknown[]; + query: Query; +} + +export interface FiltroDescontoPrecoPor { + [s: string]: FiltroDescontoPrecoPorItem; +} + +export interface FiltroDescontoPrecoPorItem { + de: number; + ate: number; + ativo: boolean; + rota: The50_Rota; + url: string; +} + +export interface The50_Rota { + name: string; + params?: unknown[]; + query: Query; +} + +export interface FiltrosPreco { + de: number; + ate: number; + ativo: boolean; + rota: FiltrosPrecoRota; + url: string; +} + +export interface FiltrosPrecoRota { + name: string; + params?: unknown[]; + query: Query; +} + +export interface MarcaElement { + id: number; + nome: string; + imagem: string; + imagemOriginal: string; + ativo: boolean; + rota: TentacledRota; + url: string; +} + +export interface TentacledRota { + name: string; + params?: unknown[]; + query: Query; +} + +export interface Ordenacao { + label: string; + title: string; + atual: boolean; + rota: OrdenacaoRota; + url: string; +} + +export interface OrdenacaoRota { + name: string; + params?: unknown[]; + query: Query; +} + +export interface LayoutPersonalizado { + layout: string; + codigoCss: string; +} + +export interface WapProduto { + id: number; + sku: string; + nome: string; + estoque: number; + estoqueMarketplace: number; + status: "disponivel" | "indisponivel" | "sobConsulta"; + descricoes: Record; + marca: ProdutoMarca; + avaliacao: Avaliacao; + precos: Precos; + pontos?: Pontos[]; + atributos?: unknown[]; + listaPresente?: unknown[]; + personalizacoes: Personalizacao[]; + predefinicoes?: unknown[]; + conjunto?: unknown[]; + carrinho?: unknown[]; + rota: ProdutoRota; + url: string; + sites: SiteElement[]; + canaisVenda: Atributo[]; + caracteristicas?: Caracteristica[]; + filtros: PurpleFiltro[]; + selos: Selo[]; + midias: Midias; + instancia: Instancia; +} + +export interface Pontos { + quantidade: number; + valorEmMoeda: number; + regra: RegraPontos; +} + +export interface RegraPontos { + id: number; + titulo: string; + valorBase: number; + valorMinimo: number; + dataInicio: string; + dataFim: string; + fimIndeterminado: string; +} + +export interface Personalizacao { + id: number; + nome: string; + descricao: string; + valorMinimo: number; + valorMaximo: number; + tipo: "select" | "checkbox" | "text" | "upload"; + obrigatorio: "s" | "n"; + limitarValores: "s" | "n"; + preco: number; + multiplicarPreco: "s" | "n"; + valores: Array<{ + id: number; + valor: number; + preco: number; + precoDefault: "s" | "n"; + segmentacao?: unknown[]; + selecionado: boolean; + quantidade: number; + }>; + configuracaoUpload: Array<{ + id: number; + arquivosValidos: string; + tamanho: string; + largura: number; + altura: number; + }>; +} + +export interface Avaliacao { + media: number; + quantidade: number; + avaliacoes?: AvaliacaoItem[]; +} + +export interface PurpleFiltro { + idFiltro: number; + idValor: number; + nome: string; + label: string; + imagem: string; + imagemOriginal: string; +} + +export interface Instancia { + ordemIndisponivel: string; + rankBuscaFullText: string; + idLandingPage: number; + status: string; + hashPromocional: null; + urlPromocional: string; +} + +export interface ProdutoMarca { + id: number; + nome: string; + imagem: string; + imagemOriginal: string; + rota: StickyRota; + url: string; + + ativo: boolean; +} + +export interface StickyRota { + name: string; + route: string; + path: string; + params: PurpleParams; + query: Query[]; +} + +export interface PurpleParams { + marca: string; +} + +export interface Midias { + imagens: Imagen[]; +} + +export interface Imagen { + id: number; + idAtributoValor: number; + descricao: string; + label: string; + arquivos: Arquivos; + arquivosOriginais: Arquivos; +} + +export interface Arquivos { + zoom: string; + big: string; + medium: string; + small: string; +} + +export interface Precos { + de: number; + por: number; + vista: number; + descontoVista: number; + editavel: boolean; + parcelamento: Parcelamento[]; + regrasAtacado?: unknown[]; +} + +export interface Parcelamento { + parcelas: number; + valorParcela: number; + valorTotal: number; + taxa: number; + exibirTaxa: boolean; +} + +export interface ProdutoRota { + name: string; + route: string; + path: string; + params: FluffyParams; + query: Query[]; +} + +export interface FluffyParams { + produto: string; +} + +export interface Estrutura { + nivel: string; + seo: SEO; + breadcrumb: Breadcrumb[]; + dadosEstruturados?: unknown[]; +} + +export interface Breadcrumb { + label: string; + atual: boolean; + rota: BreadcrumbRota; + url: string; +} + +export interface Filtros { + busca: string; +} + +export interface SEO { + title: string; + description: string; + titleSocial: string; + descriptionSocial: string; + keywords: string; + canonical: string; + indexar: boolean; +} + +export interface Info { + filtros: Filtros; + prev: string; + self: string; + next: string; + offset: number; + limit: number; + exibindo: number; + total: number; +} + +// Generated by https://quicktype.io + +export interface WapProductDatails { + estrutura: Estrutura; + conteudo: WapProductDatiled; + info: Info; +} + +export interface WapProductDatiled { + id: number; + sku: string; + ean: string; + mpn: string; + nome: string; + tipo: string; + estoque: number; + estoqueMarketplace: number; + prevenda?: Prevenda; + status: "disponivel" | "indisponivel" | "sobConsulta"; + layoutPersonalizado: LayoutPersonalizado; + descricoes: Descricoes; + video: Video; + avaliacao: Avaliacao; + marca: Marca; + categoria: Categoria; + precos: Precos; + AgendamentoPreco: AgendamentoPreco; + pontos: Pontos; + atributos: Atributos; + listaPresente?: unknown[]; + personalizacoes: Record; + predefinicoes?: unknown[]; + conjunto: Record; + assinatura: boolean; + carrinho: Carrinho; + rota: ValorRota; + url: string; + sites: CanaisVenda[]; + canaisVenda: CanaisVenda[]; + caracteristicas?: Caracteristica[]; + filtros: Filtro[]; + selos: Selo[]; + midias: ConteudoMidias; + combinacoes?: Combinacoes[]; + perguntas: Pergunta[]; + produtosLista?: unknown[]; +} + +export interface Prevenda { + dataEncerramento: string; +} + +export interface Combinacoes { + id: number; + tipoDesconto: "valor" | "porcentagem"; + desconto: number; + produto: WapProduto; +} + +export interface Caracteristica { + nome: string; + visivelSite: boolean; + itens: Array<{ + id: number; + label: string; + valor: string; + }>; +} + +export interface Pergunta { + id: number; + nome: string; + email: string; + contato: string; + pergunta: string; + respostas: Resposta[]; + data: string; +} + +export interface Resposta { + id: number; + nome: string; + email: string; + contato: string; + administrador: boolean; + resposta: string; + data: string; +} + +export interface Video { + plataforma: "youtube" | "vimeo"; + url: string; +} + +export interface Selo { + id: number; + nome: string; + tipo: "texto" | "imagem"; + label: string; + imagem: string; + imagemOriginal: string; + proporcaoDetalheProduto: number; + proporcaoVitrineProduto: number; + cores: { + texto: string; + selo: string; + posicao: { + x: "left" | "center" | "right"; + y: "top" | "middle" | "bottom"; + }; + }; +} + +export interface Atributos { + unico: Unico; + simples: Simples; +} + +export interface Unico { + id: string; + nome: string; + tipo: "texto" | "imagem"; + valores: ValorUnico[]; +} + +export interface ValorUnico { + idAtributoValor: number; + label: string; + imagem: string; + imagemOriginal: string; + produto: Produto; + rota: ValorRota; + url: string; + selecionado: boolean; +} +// Generated by https://quicktype.io + +export interface Simples { + id: string; + nome: string; + tipo: "texto" | "imagem"; + valores: ValorSimples[]; +} + +export interface ValorSimples { + idAtributoValor: number; + sku: string; + label: string; + imagem: string; + imagemOriginal: string; + estoque: number; + estoqueMarketplace: number; + descontoAdicional: number; + precos: Precos; + pontos: Pontos; + AgendamentoPreco?: AgendamentoPreco; + carrinho: Carrinho; + selecionado: boolean; + listaPresente?: number[]; +} + +export interface AgendamentoPreco { + aplicado?: AgendamentoPrecoItem; + geral?: AgendamentoPrecoItem[]; +} + +export interface AgendamentoPrecoItem { + nome: string; + precoDe: number; + precoPor: number; + descontoVista: number; + dataInicial: string; + dataFinal: string; +} + +export interface Carrinho { + hash: string; + url: string; + tipo: string; + itens: Item[]; +} + +export interface Item { + idProduto: string; + idAtributoSimples: string; + idUnidadeVenda: string; + idArmazem: string; + quantidade: string; + adicional: string; + parametros: string; +} + +export interface Precos { + de: number; + por: number; + vista: number; + descontoVista: number; + parcelamento: Parcelamento[]; + regrasAtacado?: unknown[]; +} + +export interface Parcelamento { + parcelas: number; + valorParcela: number; + valorTotal: number; + taxa: number; + exibirTaxa: boolean; +} + +export interface Produto { + id: number; + estoque: number; + estoqueMarketplace: number; + status: "disponivel" | "indisponivel" | "sobConsulta"; + midias: ProdutoMidias; + atributoSimples: Record; +} + +export interface ProdutoMidias { + imagens: Imagen[]; +} + +export interface Imagen { + id: number; + idAtributoValor: number; + descricao: string; + label: string; + arquivos: Arquivos; + arquivosOriginais: Arquivos; +} + +export interface Arquivos { + zoom: string; + big: string; + medium: string; + small: string; +} + +export interface ValorRota { + name: string; + route: string; + path: string; + params: PurpleParams; + query: Query[]; +} + +export interface PurpleParams { + produto: string; +} + +export interface Avaliacao { + media: number; + quantidade: number; + avaliacoes?: AvaliacaoItem[]; +} + +export interface AvaliacaoItem { + id: number; + nome: string; + email: string; + nota: number; + comentario: string; + recomenda: boolean; + data: string; + produto: { + id: number; + nome: string; + }; + anexos?: unknown[]; +} + +export interface CanaisVenda { + id: number; + nome: string; + tipo: string; + dominio: string; +} + +export interface Carrinho { + hash: string; + url: string; + tipo: string; + itens: Item[]; +} + +export interface Item { + idProduto: string; + idAtributoSimples: string; + idUnidadeVenda: string; + idArmazem: string; + quantidade: string; + adicional: string; + parametros: string; +} + +export interface Categoria { + id: number; + nome: string; + nivel: number; + taxonomia: Taxonomia[]; +} + +export interface Taxonomia { + id: number; + nome: string; +} + +export interface Descricoes { + curta: string; + longa: string; + simples: string; + opcional1: string; + opcional2: string; + opcional3: string; + tabelaMedida: string; +} + +export interface Filtro { + idFiltro: number; + idValor: number; + nome: string; + label: string; + imagem: string; + imagemOriginal: string; +} + +export interface LayoutPersonalizado { + layout: string; + layout2: string; + layout3: string; + codigoCss: string; + codigoJs: string; +} + +export interface Marca { + id: number; + nome: string; + imagem: string; + imagemOriginal: string; + rota: MarcaRota; + url: string; + ativo: boolean; +} + +export interface MarcaRota { + name: string; + route: string; + path: string; + params: FluffyParams; + query: Query[]; +} + +export interface FluffyParams { + marca: string; +} + +export interface ConteudoMidias { + imagens: Imagen[]; + imagensFull?: unknown[]; + imagensConjunto?: Imagen[]; + imagensRotativas?: FileObject[]; + arquivos: FileObject[]; + manuais: FileObject[]; +} + +export interface FileObject { + id: number; + idAtributoValor: number; + descricao: string; + label: string; + arquivo: string; +} + +export interface Regra { + id: number; + titulo: string; + valorBase: number; + valorMinimo: number; + dataInicio: string; + dataFim: string; + fimIndeterminado: string; +} + +export interface Precos { + de: number; + por: number; + vista: number; + descontoVista: number; + editavel: boolean; + parcelamento: Parcelamento[]; + regrasAtacado?: unknown[]; +} + +export interface Parcelamento { + parcelas: number; + valorParcela: number; + valorTotal: number; + taxa: number; + exibirTaxa: boolean; +} + +export interface Breadcrumb { + label: string; + atual: boolean; + rota: BreadcrumbRota; + url: string; +} + +export interface BreadcrumbRota { + name: string; + params: Record[] | ParamsParams; + query: Query[]; + route?: string; + path?: string; +} + +export interface ParamsParams { + categoriaNivel2?: string; + categoriaNivel3?: string; + produto?: string; +} + +export interface SEO { + title: string; + description: string; + titleSocial: string; + descriptionSocial: string; + openGraphUrlImagem: string; + twitterUrlImagem: string; + keywords: string; + canonical: string; + indexar: boolean; +} + +export interface Query { + atributo?: string; + filtro?: string; + descontoPrecoPor?: string; + order?: string; + marca?: string; + busca?: string; + preco?: string; + predefination?: string; + predefinationType?: string; +} + +export interface Cart { + quantidadeItens: number; + quantidadeTotal: number; + quantidadePontos: number; + mensagens?: CartMessage[]; + itens: CartItem[]; + subtotal: Subtotal; +} + +export interface CartMessage { + tipo: string; + mensagem: string; +} + +export interface CartItem { + nome: string; + sku: string; + tipo: "produto" | "lista"; + conjunto: boolean; + quantidade: number; + precos: CartPrecos; + imagem: string; + atributos: CartItemAtributos; + upsell?: Upsell; + hash: Hash; + personalizacao?: unknown[]; +} + +export interface Upsell { + id: number; + localOfeta: + | "carrinho" + | "carrinhoLateral" + | "pagamento" + | "pagamentoBox" + | "endereco"; + quantidadeMaxima: number; +} + +export interface CartItemAtributos { + unico: CartItemAtributosAtributo; + simples: CartItemAtributosAtributo; +} + +export interface CartItemAtributosAtributo { + atributo: Atributo; + atributoValor: AtributoValor; +} + +export interface Atributo { + id: number; + label: string; + tipo: string; +} + +export interface AtributoValor { + id: number; + label: string; + imagem: string; +} + +export interface Hash { + idProduto: number; + idAtributoSimples: number; + idUnidadeVenda: number; + idArmazem: number; + quantidade: number; + adicional: string; +} + +export interface CartPrecos { + precoDe: number; + precoPor: number; + descontoVista: number; + total: number; + tipo: string; +} + +export interface Subtotal { + valor: number; + descontoVista: DescontoVista; + parcelamento: Parcelamento[]; +} + +export interface DescontoVista { + valor: number; + porcentagem: number; + desconto: number; +} + +export interface Parcelamento { + parcelas: number; + valorParcela: number; + valorTotal: number; + taxa: number; + exibirTaxa: boolean; +} + +// Generated by https://quicktype.io + +export interface User { + id: number; + nomeRazao: string; + nomeFantasia: string; + celular: string; + telefone: string; + email: string; + pessoa: string; + sexo: "m" | "f" | "o" | "i"; + nascimento: string; + revendedor: boolean; + logado: boolean; + loginFacilitado: boolean; + primeiraCompra: boolean; + optin: boolean; + ativo: boolean; + representantes: Representante[]; + vendaInterna: VendaInterna; + endereco: Endereco; + pontos: UserPontos; + userHash: UserHash; + perfilMultiplo?: perfilMultiploItem[]; + listaPresente?: { + tipoAcesso: "presenteado" | "visitante"; + }; +} + +export interface perfilMultiploItem { + id: number; + nomeRazao: string; + nomeFantasia: string; + email: string; + cpfCnpj: string; +} + +export interface UserPontos { + valorTotal: { + quantidade: number; + valorEmMoeda: number; + }; + valorPorCanal: { + id: number; + nome: string; + dominio: string; + tipo: string; + quantidade: number; + valorEmMoeda: number; + }; +} + +export interface Endereco { + cep: string; + principal: Principal; +} + +export interface Principal { + cep: string; + cidade: string; + uf: string; + pais: string; +} + +export interface UserHash { + id: string; + nome: string; + sobrenome: string; + nomeRazao: string; + nomeFantasia: string; + celular: string; + telefone: string; + email: string; + pessoa: string; + sexo: string; + nascimento: string; + revendedor: string; + logado: string; + loginFacilitado: string; + primeiraCompra: string; + optin: string; + ativo: string; + endereco: Endereco; +} + +export interface Representante { + id?: number; + nome?: string; + celular?: string; + email?: string; + canais: Array<{ + id?: number; + codigo?: string; + nome?: string; + dominio?: string; + principal?: boolean; + canalPai?: { + id?: number; + nome?: string; + }; + }>; +} + +export interface VendaInterna { + id: number; + usuario: { + id: number; + nome: string; + }; + data: string; + canais: Array<{ + id?: number; + codigo?: string; + nome?: string; + dominio?: string; + principal?: boolean; + canalPai?: { + id?: number; + nome?: string; + }; + }>; +} diff --git a/weather/logo.png b/weather/logo.png new file mode 100644 index 000000000..a7e1a8141 Binary files /dev/null and b/weather/logo.png differ diff --git a/weather/manifest.gen.ts b/weather/manifest.gen.ts index d22448a21..42b0e01e8 100644 --- a/weather/manifest.gen.ts +++ b/weather/manifest.gen.ts @@ -4,11 +4,15 @@ import * as $$$0 from "./loaders/temperature.ts"; import * as $$$$$$$0 from "./matchers/temperature.ts"; +import * as $$$$$$0 from "./sections/WhatsTheTemperature.tsx"; const manifest = { "loaders": { "weather/loaders/temperature.ts": $$$0, }, + "sections": { + "weather/sections/WhatsTheTemperature.tsx": $$$$$$0, + }, "matchers": { "weather/matchers/temperature.ts": $$$$$$$0, }, diff --git a/weather/matchers/temperature.ts b/weather/matchers/temperature.ts index 1c9d59de3..b42732562 100644 --- a/weather/matchers/temperature.ts +++ b/weather/matchers/temperature.ts @@ -20,7 +20,9 @@ export interface Props { } /** - * @title Weather Matcher + * @title Weather + * @description Target users based on specific temperature + * @icon cloud-storm */ export default function MatchWeather( { temperatureRanges, temperature }: Props, diff --git a/weather/mod.ts b/weather/mod.ts index 6a7503bb4..d30afd8fc 100644 --- a/weather/mod.ts +++ b/weather/mod.ts @@ -1,15 +1,30 @@ -import type { App, AppContext as AC } from "deco/mod.ts"; import manifest, { Manifest } from "./manifest.gen.ts"; - +import { PreviewContainer } from "../utils/preview.tsx"; +import { type App, type AppContext as AC } from "@deco/deco"; // deno-lint-ignore ban-types export type State = {}; /** - * @title weather + * @title Deco Weather + * @description Vary your content based on the current weather of your visitors. + * @category Tool + * @logo https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png */ -export default function App( - state: State, -): App { +export default function App(state: State): App { return { manifest, state }; } - export type AppContext = AC>; +export const preview = () => { + return { + Component: PreviewContainer, + props: { + name: "Deco Weather", + owner: "deco.cx", + description: + "Vary your content based on the current weather of your visitors.", + logo: + "https://raw.githubusercontent.com/deco-cx/apps/main/weather/logo.png", + images: [], + tabs: [], + }, + }; +}; diff --git a/weather/sections/WhatsTheTemperature.tsx b/weather/sections/WhatsTheTemperature.tsx new file mode 100644 index 000000000..247d04f9b --- /dev/null +++ b/weather/sections/WhatsTheTemperature.tsx @@ -0,0 +1,19 @@ +import { Temperature } from "../loaders/temperature.ts"; + +export interface TemperatureProps { + /** + * @title Current Temperature + * @description The current temperature + * @examples [{"celsius": 20}] + */ + temperature?: Temperature | null; +} + +export default function WhatsTheTemperature({ temperature }: TemperatureProps) { + return ( +
+

The temperature now is

+

{temperature ? temperature.celsius : 20.2}°C

+
+ ); +} diff --git a/website/Preview.tsx b/website/Preview.tsx new file mode 100644 index 000000000..dc6b68039 --- /dev/null +++ b/website/Preview.tsx @@ -0,0 +1,29 @@ +import { renderTemplateString } from "./components/Seo.tsx"; +import { default as SEOPreview } from "./components/_seo/Preview.tsx"; +import { Props as WebsiteAppProps } from "./mod.ts"; + +interface Props { + state: WebsiteAppProps; +} + +export default function Preview(props: Props) { + const { seo } = props.state; + const { + title: _title = "", + description: _description = "", + descriptionTemplate = "%s", + titleTemplate = "%s", + } = seo ?? {}; + const title = renderTemplateString(titleTemplate, _title); + const description = renderTemplateString( + descriptionTemplate, + _description, + ); + + return ( +
+ {seo && } + {!seo &&

SEO not configured

} +
+ ); +} diff --git a/website/actions/secrets/encrypt.ts b/website/actions/secrets/encrypt.ts index 1e11d44ee..a57946779 100644 --- a/website/actions/secrets/encrypt.ts +++ b/website/actions/secrets/encrypt.ts @@ -1,28 +1,16 @@ -import { badRequest } from "deco/engine/errors.ts"; -import { context } from "deco/live.ts"; -import { ActionContext } from "deco/types.ts"; -import { allowCorsFor } from "deco/utils/http.ts"; import { encryptToHex } from "../../utils/crypto.ts"; - +import { type ActionContext, allowCorsFor } from "@deco/deco"; export interface Props { value: string; } - export interface SignedMessage { value: string; } - -export default async function Encrypt( +export default async function encrypt( { value }: Props, req: Request, ctx: ActionContext, ): Promise { - if (!context.isDeploy) { - badRequest({ - message: "could not update secrets in development mode", - code: "SECRET_ON_DEV_MODE_NOT_ALLOWED", - }); - } try { Object.entries(allowCorsFor(req)).map(([name, value]) => { ctx.response.headers.set(name, value); diff --git a/website/components/Analytics.tsx b/website/components/Analytics.tsx index b1ec2e9ef..e61d79b41 100644 --- a/website/components/Analytics.tsx +++ b/website/components/Analytics.tsx @@ -1,25 +1,108 @@ -import { context } from "deco/live.ts"; -import Script from "partytown/Script.tsx"; -import GoogleTagScript from "partytown/integrations/GTAG.tsx"; -import GoogleTagManager from "partytown/integrations/GTM.tsx"; -import { scriptAsDataURI } from "../../utils/dataURI.ts"; +import { Head } from "$fresh/runtime.ts"; +import { useScriptAsDataURI } from "@deco/deco/hooks"; +import { context } from "@deco/deco"; +declare global { + interface Window { + dataLayer: unknown[]; + } +} +export const getGTMIdFromSrc = (src: string | undefined) => { + const trackingId = src ? new URL(src).searchParams.get("id") : undefined; + return trackingId; +}; +interface TagManagerProps { + trackingId: string; + src?: string; +} +export function GoogleTagManager(props: TagManagerProps) { + const _isOnPremises = !!props.src; + const hasTrackingId = "trackingId" in props; + const id = _isOnPremises ? props.src : props.trackingId; + const hostname = _isOnPremises + ? props.src + : "https://www.googletagmanager.com"; + const src = new URL( + `/gtm.js?id=${hasTrackingId ? props.trackingId : ""}`, + hostname, + ); + const noscript = new URL( + `/ns.html?id=${hasTrackingId ? props.trackingId : ""}`, + hostname, + ); + return ( + <> + +