Skip to main content

Update Product

GET /api/v1/Products/:id

Description

This endpoint allows updating an existing product.

Headers:

  • No specific headers are required.

Path Parameters:

  • version: The version of the API.

Request Body:

URL:

  • PUT: /api/v1/Products

Response:

  • 200: Success, returns the updated product details.

Error Codes:

  • 400: Bad request, the request is not valid.

  • 404: Not found, the product does not exist or is invalid.

  • 500: Internal server error, something went wrong while processing the request.

Example Request Body:

{
"id": "123",
"name": "Product1",
"description": "Description of Product1",
"price": 100.00,
"categoryId": "abc123",
"imageUrl": "https://example.com/product1.jpg",
"availability": true
}

Example Response:

HTTP/1.1 200 OK
{
"id": "123",
"name": "Product1",
"description": "Description of Product1",
"price": 100.00,
"categoryId": "abc123",
"imageUrl": "https://example.com/product1.jpg",
"availability": true,
"updatedAt": "2024-02-17T12:00:00Z"
}

Method: PUT

/api/v1/Products

Headers

Content-TypeValue
Content-Typeapplication/json

Headers

Content-TypeValue
Accepttext/plain

Body (raw)

{
"id": "<uuid>",
"name": "<string>",
"number": "<string>",
"description": "<string>",
"salesPrice": "<double>",
"documents": [
{
"id": "<uuid>",
"externalId": "<uuid>",
"base64": "<string>",
"fileName": "<string>"
},
{
"id": "<uuid>",
"externalId": "<uuid>",
"base64": "<string>",
"fileName": "<string>"
}
]
}

Response: 200

{
"succeeded": "<boolean>",
"message": "<string>",
"errors": [
"<string>",
"<string>"
],
"data": {
"id": "<uuid>",
"merchantId": "<uuid>",
"name": "<string>",
"number": "<string>",
"description": "<string>",
"salesPrice": "<double>",
"documents": [
{
"id": "<uuid>",
"externalId": "<uuid>",
"url": "<string>",
"name": "<string>"
},
{
"id": "<uuid>",
"externalId": "<uuid>",
"url": "<string>",
"name": "<string>"
}
]
}
}

LANGUAGE

AUTHORIZATION

Bearer

CURL REQUEST


curl --request GET \ 
--url /api/v1/Products/:id \
--header 'accept: application/json' \
--header 'content-type: application/json'

RESPONSE


Click Try It! to start a request and see the response here!