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ções | Tempo em Segundos |
|---|---|
| 120 | 60 |
Parâmetros
| Parâmetro | Tipo | Localização | Descrição | Obrigatório |
|---|---|---|---|---|
| refProduct | string | Path | A referência única do produto que deseja atualizar. | Sim |
| IdDataSourceCompanyBranch | string | Header | Identificador da Company Branch. | Sim |
| Authorization | string | Header | Token de autenticação. | Sim |
| body | Objeto JSON | Corpo | O 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
| Atributo | Tipo | Descrição | Obrigatório |
|---|---|---|---|
| refProduct | string | Referência do produto | Sim |
| name | string | Nome do produto | Sim |
| shortDescription | string | Descrição curta do produto | Sim |
| longDescription | string | Descrição longa do produto | Sim |
| metaTags | string[] | Tags meta associadas ao produto | Não |
| keyWords | string[] | Palavras-chave associadas ao produto | Não |
| category | objeto | Informações sobre a categoria do produto | Sim |
| - refCategory | string | Referência da categoria | Sim |
| brand | objeto | Informações sobre a marca do produto | Sim |
| - refBrand | string | Referência da marca | Sim |
| skus | objeto[] | Informações sobre os SKUs (variantes) do produto | Sim |
| - refSku | string | Referência do SKU | Sim |
| - ean | string | Código EAN do SKU | Sim |
| - description | string | Descrição do SKU | Sim |
| - inative | boolean | Indica se o SKU está inativo | Não |
| - priceOf | number | Preço do SKU (por unidade) | Sim |
| - priceBy | number | Preço por unidade do SKU | Sim |
| - weight | number | Peso do SKU em gramas | Sim |
| - height | number | Altura do SKU em centímetros | Sim |
| - width | number | Largura do SKU em centímetros | Sim |
| - length | number | Comprimento do SKU em centímetros | Sim |
| - realWeight | number | Peso real do SKU em gramas | Não |
| - realHeight | number | Altura real do SKU em centímetros | Não |
| - realWidth | number | Largura real do SKU em centímetros | Não |
| - realLength | number | Comprimento real do SKU em centímetros | Não |
| - cubicWeight | number | Peso cúbico do SKU em gramas | Não |
| - position | number | Posição do SKU | Não |
| - images | objeto[] | Imagens associadas ao SKU | Não |
| -- url | string | URL da imagem | Sim |
| -- name | string | Nome da imagem | Sim |
| -- description | string | Descrição da imagem | Sim |
| -- position | number | Posição da imagem | Sim |
| - skuAttributesV2 | objeto[] | Atributos do SKU | Não |
| -- refAttribute | string | Referência do atributo | Sim |
| -- attribute | objeto | Informações sobre o atributo | Sim |
| --- refAttribute | string | Referência do atributo | Sim |
| -- skuAttributeValuesV2 | objeto[] | Valores do atributo do SKU | Sim |
| --- refAttributeValue | string | Referência do valor do atributo | Sim |
| productAttributes | objeto[] | Atributos do produto | Não |
| - refAttribute | string | Referência do atributo | Sim |
| - attribute | objeto | Informações sobre o atributo | Sim |
| -- refAttribute | string | Referência do atributo | Sim |
| - productAttributeValues | objeto[] | Valores do atributo do produto | Sim |
| -- openFieldValue | string | Valor do atributo do produto | Não |
| -- refAttributeValue | string | Referência do valor do atributo | Nã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."