Produtos
Atualiza o produto e seus skus

Insere o produto e seus skus

PUThttps://erp.hub.it4360.com/api/v1/products/{refProduct}

Este endpoint permite atualizar um produto e seus respectivos skus.

Rate limit

Quantidade de RequisiçõesTempo em Segundos
12060

Parâmetros

ParâmetroTipoLocalizaçãoDescriçãoObrigatório
refProductstringPathA referência única do produto que deseja atualizar.Sim
IdDataSourceCompanyBranchstringHeaderIdentificador da Company Branch.Sim
AuthorizationstringHeaderToken de autenticação.Sim
bodyObjeto JSONCorpoO objeto de requisição que contém os parâmetros necessários para criar o produto.Sim

Exemplo de corpo da Requisição

{
  "longDescription": "Exemplo descrição longa edit",
  "name": "Produto Exemplo Edit",
  "shortDescription": "Exemplo descrição curta edit",
  "metaTags": ["Meta", "Edit"],
  "keyWords": ["Key", "Edit"],
  "category": {
    "refCategory": "ExemploRefCatEdit"
  },
  "brand": {
    "refBrand": "ExemploRefBrandEdit"
  },
  "skus": [
    {
      "description": "Sku Exemplo Edit",
      "ean": "ExemploEanEdit",
      "height": 1.0,
      "length": 2.0,
      "priceBy": 3.0,
      "priceOf": 4.0,
      "refSku": "ExemploRefSkuEdit",
      "weight": 6.0,
      "width": 7.0,
      "inative": false,
      "realWeight": 8.0,
      "realHeight": 9.0,
      "realWidth": 10.0,
      "realLength": 11.0,
      "cubicWeight": 12.0,
      "position": 0,
      "images": [
        {
          "description": "Exemplo descrição imagem 1 edit",
          "name": "Exemplo Imagem 1 Edit",
          "position": 0,
          "url": "https://exemplo.com.br/imagem1_edit.png"
        },
        {
          "description": "Exemplo descrição imagem 2 edit",
          "name": "Exemplo Imagem 2 Edit",
          "position": 1,
          "url": "https://exemplo.com.br/imagem2_edit.png"
        }
      ],
      "skuAttributesV2": [
        {
          "attribute": {
            "refAttribute": "ExemploRefSkuAttributeEdit"
          },
          "refAttribute": "ExemploRefSkuAttributeEdit",
          "skuAttributeValuesV2": [
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal1"
            },
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal2"
            }
          ]
        },
        {
          "attribute": {
            "refAttribute": "ExemploRefSkuAttributeEdit2"
          },
          "refAttribute": "ExemploRefSkuAttributeEdit2",
          "skuAttributeValuesV2": [
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal3"
            },
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal4"
            }
          ]
        }
      ]
    },
    {
      "description": "Criacao Sku Exemplo 2",
      "ean": "ExemploEanCriacao2",
      "height": 11.0,
      "length": 22.0,
      "priceBy": 33.0,
      "priceOf": 44.0,
      "refSku": "ExemploRefSkuCriacao2",
      "weight": 66.0,
      "width": 77.0,
      "inative": false,
      "realWeight": 88.0,
      "realHeight": 99.0,
      "realWidth": 100.0,
      "realLength": 111.0,
      "cubicWeight": 122.0,
      "position": 1,
      "images": [
        {
          "description": "Exemplo descrição imagem 3 criacao",
          "name": "Exemplo Imagem 3 cricao",
          "position": 0,
          "url": "https://exemplo.com.br/imagem3.png"
        },
        {
          "description": "Exemplo descrição imagem 4 criacao",
          "name": "Exemplo Imagem 4 criacao",
          "position": 1,
          "url": "https://exemplo.com.br/imagem4.png"
        }
      ],
      "skuAttributesV2": [
        {
          "attribute": {
            "refAttribute": "ExemploRefSkuAttribute3"
          },
          "refAttribute": "ExemploRefSkuAttribute3",
          "skuAttributeValuesV2": [
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal5"
            },
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal6"
            }
          ]
        },
        {
          "attribute": {
            "refAttribute": "ExemploRefSkuAttribute4"
          },
          "refAttribute": "ExemploRefSkuAttribute4",
          "skuAttributeValuesV2": [
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal7"
            },
            {
              "refAttributeValue": "ExemploRefSkuAttributeVal8"
            }
          ]
        }
      ]
    }
  ],
  "productAttributes": [
    {
      "attribute": {
        "refAttribute": "ExemploRefProdAttribute"
      },
      "productAttributeValues": [
        {
          "openFieldValue": "Atributo do tipo campo aberto",
          "refAttributeValue": null
        },
        {
          "openFieldValue": null,
          "refAttributeValue": "ExemploRefAttributeVal"
        }
      ],
      "refAttribute": "ExemploRefProdAttribute"
    },
    {
      "attribute": {
        "refAttribute": "ExemploRefProdAttribute2"
      },
      "productAttributeValues": [
        {
          "openFieldValue": "Atributo do tipo campo aberto",
          "refAttributeValue": null
        },
        {
          "openFieldValue": null,
          "refAttributeValue": "ExemploRefAttributeVal2"
        }
      ],
      "refAttribute": "ExemploRefProdAttribute2"
    }
  ]
}

Atributos do corpo da Requisição

AtributoTipoDescriçãoObrigatório
refProductstringReferência do produtoSim
namestringNome do produtoSim
shortDescriptionstringDescrição curta do produtoSim
longDescriptionstringDescrição longa do produtoSim
metaTagsstring[]Tags meta associadas ao produtoNão
keyWordsstring[]Palavras-chave associadas ao produtoNão
categoryobjetoInformações sobre a categoria do produtoSim
- refCategorystringReferência da categoriaSim
brandobjetoInformações sobre a marca do produtoSim
- refBrandstringReferência da marcaSim
skusobjeto[]Informações sobre os SKUs (variantes) do produtoSim
- refSkustringReferência do SKUSim
- eanstringCódigo EAN do SKUSim
- descriptionstringDescrição do SKUSim
- inativebooleanIndica se o SKU está inativoNão
- priceOfnumberPreço do SKU (por unidade)Sim
- priceBynumberPreço por unidade do SKUSim
- weightnumberPeso do SKU em gramasSim
- heightnumberAltura do SKU em centímetrosSim
- widthnumberLargura do SKU em centímetrosSim
- lengthnumberComprimento do SKU em centímetrosSim
- realWeightnumberPeso real do SKU em gramasNão
- realHeightnumberAltura real do SKU em centímetrosNão
- realWidthnumberLargura real do SKU em centímetrosNão
- realLengthnumberComprimento real do SKU em centímetrosNão
- cubicWeightnumberPeso cúbico do SKU em gramasNão
- positionnumberPosição do SKUNão
- imagesobjeto[]Imagens associadas ao SKUNão
-- urlstringURL da imagemSim
-- namestringNome da imagemSim
-- descriptionstringDescrição da imagemSim
-- positionnumberPosição da imagemSim
- skuAttributesV2objeto[]Atributos do SKUNão
-- refAttributestringReferência do atributoSim
-- attributeobjetoInformações sobre o atributoSim
--- refAttributestringReferência do atributoSim
-- skuAttributeValuesV2objeto[]Valores do atributo do SKUSim
--- refAttributeValuestringReferência do valor do atributoSim
productAttributesobjeto[]Atributos do produtoNão
- refAttributestringReferência do atributoSim
- attributeobjetoInformações sobre o atributoSim
-- refAttributestringReferência do atributoSim
- productAttributeValuesobjeto[]Valores do atributo do produtoSim
-- openFieldValuestringValor do atributo do produtoNão
-- refAttributeValuestringReferência do valor do atributoNão

Exemplos de Requisição

curl --location --request PUT 'https://erp.hub.it4360.com/api/v1/products/<string>' \
	--header 'IdDataSourceCompanyBranch: <string>' \
	--header 'Content-Type: application/json' \
	--header 'Accept: text/plain' \
	--header 'Authorization: Bearer token-de-autorizacao' \
	--data '{
	  "longDescription": "Exemplo descrição longa edit",
	  "name": "Produto Exemplo Edit",
	  "shortDescription": "Exemplo descrição curta edit",
	  "metaTags": [
		"Meta",
		"Edit"
	  ],
	  "keyWords": [
		"Key",
		"Edit"
	  ],
	  "category": {
		"refCategory": "ExemploRefCatEdit"
	  },
	  "brand": {
		"refBrand": "ExemploRefBrandEdit"
	  },
	  "skus": [
		{
		  "description": "Sku Exemplo Edit",
		  "ean": "ExemploEanEdit",
		  "height": 1.00,
		  "length": 2.00,
		  "priceBy": 3.00,
		  "priceOf": 4.00,
		  "refSku": "ExemploRefSkuEdit",
		  "weight": 6.00,
		  "width": 7.00,
		  "inative": false,
		  "realWeight": 8.00,
		  "realHeight": 9.00,
		  "realWidth": 10.00,
		  "realLength": 11.00,
		  "cubicWeight": 12.00,
		  "position": 0,
		  "images": [
			{
			  "description": "Exemplo descrição imagem 1 edit",
			  "name": "Exemplo Imagem 1 Edit",
			  "position": 0,
			  "url": "https://exemplo.com.br/imagem1_edit.png"
			},
			{
			  "description": "Exemplo descrição imagem 2 edit",
			  "name": "Exemplo Imagem 2 Edit",
			  "position": 1,
			  "url": "https://exemplo.com.br/imagem2_edit.png"
			}
		  ],
		  "skuAttributesV2": [
			{
			  "attribute": {
				"refAttribute": "ExemploRefSkuAttributeEdit"
			  },
			  "refAttribute": "ExemploRefSkuAttributeEdit",
			  "skuAttributeValuesV2": [
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal1"
				},
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal2"
				}
			  ]
			},
			{
			  "attribute": {
				"refAttribute": "ExemploRefSkuAttributeEdit2"
			  },
			  "refAttribute": "ExemploRefSkuAttributeEdit2",
			  "skuAttributeValuesV2": [
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal3"
				},
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal4"
				}
			  ]
			}
		  ]
		},
		{
		  "description": "Criacao Sku Exemplo 2",
		  "ean": "ExemploEanCriacao2",
		  "height": 11.00,
		  "length": 22.00,
		  "priceBy": 33.00,
		  "priceOf": 44.00,
		  "refSku": "ExemploRefSkuCriacao2",
		  "weight": 66.00,
		  "width": 77.00,
		  "inative": false,
		  "realWeight": 88.00,
		  "realHeight": 99.00,
		  "realWidth": 100.00,
		  "realLength": 111.00,
		  "cubicWeight": 122.00,
		  "position": 1,
		  "images": [
			{
			  "description": "Exemplo descrição imagem 3 criacao",
			  "name": "Exemplo Imagem 3 cricao",
			  "position": 0,
			  "url": "https://exemplo.com.br/imagem3.png"
			},
			{
			  "description": "Exemplo descrição imagem 4 criacao",
			  "name": "Exemplo Imagem 4 criacao",
			  "position": 1,
			  "url": "https://exemplo.com.br/imagem4.png"
			}
		  ],
		  "skuAttributesV2": [
			{
			  "attribute": {
				"refAttribute": "ExemploRefSkuAttribute3"
			  },
			  "refAttribute": "ExemploRefSkuAttribute3",
			  "skuAttributeValuesV2": [
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal5"
				},
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal6"
				}
			  ]
			},
			{
			  "attribute": {
				"refAttribute": "ExemploRefSkuAttribute4"
			  },
			  "refAttribute": "ExemploRefSkuAttribute4",
			  "skuAttributeValuesV2": [
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal7"
				},
				{
				  "refAttributeValue": "ExemploRefSkuAttributeVal8"
				}
			  ]
			}
		  ]
		}
	  ],
	  "productAttributes": [
		{
		  "attribute": {
			"refAttribute": "ExemploRefProdAttribute"
		  },
		  "productAttributeValues": [
			{
			  "openFieldValue": "Atributo do tipo campo aberto",
			  "refAttributeValue": null
			},
			{
			  "openFieldValue": null,
			  "refAttributeValue": "ExemploRefAttributeVal"
			}
		  ],
		  "refAttribute": "ExemploRefProdAttribute"
		},
		{
		  "attribute": {
			"refAttribute": "ExemploRefProdAttribute2"
		  },
		  "productAttributeValues": [
			{
			  "openFieldValue": "Atributo do tipo campo aberto",
			  "refAttributeValue": null
			},
			{
			  "openFieldValue": null,
			  "refAttributeValue": "ExemploRefAttributeVal2"
			}
		  ],
		  "refAttribute": "ExemploRefProdAttribute2"
		}
	  ]
	}'

Respostas

  • 204 No Content - Sucesso. O produto foi atualizado com sucesso.

  • 400 Bad Request - Não foi possível atender à requisição. Valide os dados informados.

    Corpo da Resposta (Exemplo):

    "Mensagem de erro detalhada."
  • 404 Not Found - Não encontrado. O Produto informado não pôde ser encontrado

    Corpo da Resposta (Exemplo):

    "Produto não encontrado."