@lap v0.3
# Machine-readable API spec. Each @endpoint block is one API call.
@api Catalog API - Seller Portal
@base https://apiexamples.vtexcommercestable.com.br
@auth ApiKey X-VTEX-API-AppKey in header | ApiKey X-VTEX-API-AppToken in header | ApiKey VtexIdclientAutCookie in header
@common_fields {Content-Type: str # Type of the content being sent., Accept: str # HTTP Client Negotiation _Accept_ Header. Indicates the types of responses the client can understand.}
@endpoints 16
@toc api(16)

@endpoint GET /api/catalog-seller-portal/products/{productId}
@desc Get product by ID
@required {productId: str # Product unique identifier number.}
@returns(200) {id: str, externalId: str, status: str, name: str, brandId: str, description: str, brandName: str, categoryIds: [str], categoryNames: [str], specs: [map], attributes: [map], slug: str, images: [map], skus: [map], transportModal: str?, taxCode: str?, origin: str, createdAt: str, updatedAt: str} # OK

@endpoint PUT /api/catalog-seller-portal/products/{productId}
@desc Update product
@required {productId: str # Product unique identifier number., status: str # Status of the product. Its values can be `active` or `inactive`., name: str # Product name. Use simple words and avoid other languages or complex writing. This field is essential for SEO and must respect the 150 character limit., brandId: str # Product's brand unique identifier number., categoryIds: [str] # Product's categories unique identifier numbers. It can have multiples IDs for each category and subcategories., specs: [map{name!: str, values!: [str]}] # Specifications that will differentiate the possible product SKUs., attributes: [map{name!: str, value!: str}] # Attributes of the product. Attributes are additional properties used to create site browsing filters., slug: str # Reference of the product in the URL of the store., images: [map{id!: str, url!: str, alt: str}] # Information of the images of the product., skus: [map{id: str, name: str, externalId: str, description: str, ean: str, manufacturerCode: str, isActive!: bool, weight!: int, dimensions!: map, RealWeight: num, RealDimensions: map, specs!: [map], images!: [str]}] # SKUs of the product., origin: str # Origin account of the product. It is not possible to alter products where the origin is `marketplace`.}
@optional {id: str # Product's unique identifier number., externalId: str # Product reference unique identifier number in the store., description: str # New description data for SKU/product., transportModal: str # Transport modal of the product., taxCode: str # Product tax code.}
@returns(204) No Content

@endpoint GET /api/catalog-seller-portal/products/{productId}/description
@desc Get product description by product ID
@required {productId: str # Product unique identifier number.}
@returns(200) {productId: str, createdAt: str, updatedAt: str} # OK

@endpoint PUT /api/catalog-seller-portal/products/{productId}/description
@desc Update product description by product ID
@required {productId: str # Product unique identifier number., productId: str # Product's unique identifier number., description: str # Product description.}
@returns(204) No Content

@endpoint GET /api/catalog-seller-portal/products/{param}
@desc Get product by external ID,  SKU ID, SKU external ID or slug
@required {param: str # This part of the path must follow this format: `{param}={value}`. Replace `{param}` with the name of the parameter used to fetch a product, which can be one of the following: `external-id` (product reference unique identifier number in the store), `sku-id` (SKU unique identifier number), `sku-external-id` (SKU reference unique identifier number in the store) or `slug` (reference of the product in the URL of the store). Replace `{value}` with the value of the selected param. Make sure there is a `=` between them.}
@returns(200) {id: str, externalId: str, description: str, status: str, name: str, brandId: str, brandName: str, categoryIds: [str], categoryNames: [str], specs: [map], attributes: [map], slug: str, images: [map], skus: [map], transportModal: str, taxCode: str, origin: str, createdAt: str, updatedAt: str} # OK

@endpoint POST /api/catalog-seller-portal/products
@desc Create product
@required {status: str # Status of the product. Its values can be `active` or `inactive`., name: str # Product name. Use simple words and avoid other languages or complex writing. This field is essential for SEO and must respect the 150 character limit., brandId: str # Product's brand unique identifier number., categoryIds: [str] # Product's categories unique identifier numbers. It can have multiples IDs for each category and subcategories., specs: [map{name!: str, values!: [str]}] # Specifications that will differentiate the possible product SKUs., attributes: [map{name!: str, value!: str}] # Attributes of the product. Attributes are additional properties used to create site browsing filters., slug: str # Reference of the product in the URL of the store., images: [map{id!: str, url!: str, alt: str}] # Information of the images of the product., skus: [map{name!: str, externalId: str, description: str, ean: str, manufacturerCode: str, isActive!: bool, weight!: int, dimensions!: map, RealWeight: num, RealDimensions: map, specs!: [map], images!: [str]}] # SKUs of the product., origin: str # Origin account of the product. It is not possible to alter products where the origin is `marketplace`.}
@optional {externalId: str # Product reference unique identifier number in the store., description: str # Product's data description., transportModal: str # Transport modal of the product., taxCode: str # Product tax code.}
@returns(200) {id: str, externalId: str, status: str, name: str, brandId: str, brandName: str, description: str, categoryIds: [str], categoryNames: [str], specs: [map], attributes: [map], slug: str, images: [map], skus: [map], origin: str, transportModal: str?, taxCode: str?, createdAt: str, updatedAt: str} # OK
@returns(204) No Content

@endpoint GET /api/catalog-seller-portal/skus/_search
@desc Search for SKU
@optional {from: str # The first page of the interval of the product list., to: str # The last page of the interval of the product list., id: int # SKU unique idenfier number., externalid: int # SKU reference unique identifier number in the store.}
@returns(200) {data: [map], _metadata: map{total: int, from: int, to: int}} # OK

@endpoint GET /api/catalog-seller-portal/skus/ids
@desc Get list of SKUs
@optional {from: str # The first page of the interval of the product list., to: str # The last page of the interval of the product list.}
@returns(200) {data: [str], _metadata: map{total: int, from: int, to: int}} # OK

@endpoint GET /api/catalog-seller-portal/brands
@desc Get list of brands
@optional {q: str # Search word., from: str # The first page of the interval of the brand list., to: str # The last page of the interval of the brand list., orderBy: str # The order that the list is displayed. You can select `name`, or `updated_at` to select the order criteria. Then you can add `,` , `asc` or `desc` to define the brands order., name: str # Brand name.}
@returns(200) {data: [map], _metadata: map{total: int, from: int, to: int, orderBy: str}} # OK

@endpoint POST /api/catalog-seller-portal/brands
@desc Create brand
@required {name: str # Brand name., isActive: bool # The condition defines if the brand is active (`true`) or inactive (`false`).}
@returns(200) {id: str, name: str, isActive: bool, createdAt: str, updatedAt: str} # OK

@endpoint GET /api/catalog-seller-portal/brands/{brandId}
@desc Get brand by ID
@required {brandId: str # Brand unique identifier number.}
@returns(200) {id: str, name: str, isActive: bool, createdAt: str, updatedAt: str} # OK

@endpoint PUT /api/catalog-seller-portal/brands/{brandId}
@desc Update brand
@required {brandId: str # Brand unique identifier number., id: str # Brand unique identifier number., name: str # Brand name., isActive: bool # The condition defines if the brand is active (`true`) or inactive (`false`).}
@returns(204) No Content
@example_request {"id":"20","name":"Zwilling","isActive":true}

@endpoint GET /api/catalog-seller-portal/category-tree
@desc Get category tree
@optional {depth: int # Category tree level.}
@returns(200) {roots: [map], createdAt: str, updatedAt: str} # OK

@endpoint PUT /api/catalog-seller-portal/category-tree
@desc Update category tree
@required {roots: [map{value!: map, children!: [map]}] # List of all categories of the store.}
@returns(204) No Content

@endpoint GET /api/catalog-seller-portal/category-tree/categories/{categoryId}
@desc Get category by ID
@required {categoryId: str # Category unique identifier number.}
@returns(200) {value: map{id: str, name: str, isActive: bool}, children: [map]} # OK

@endpoint POST /api/catalog-seller-portal/category-tree/categories
@desc Create category
@required {parentId: str # Parent category unique identifier number., Name: str # Category name.}
@returns(200) {value: map{id: str, name: str, isActive: bool}, children: [map]} # OK
@example_request {"parentId":"567","Name":"Beauty"}

@end
