Skip to main content

Delete Product

You can delete a product by merchantProductId using this service.

Request

curl --location --request DELETE '<BASE_URL>/merchant-products/{merchantProductId}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <jwtToken>'

Path Variables

ParameterTypeRequired
Description
merchantProductIdIntegerYesProduct Id

Response

{
"merchantProductId": 12345,
"deleted": true
}

Response Fields

FieldType
Description
merchantProductIdIntegerID of the deleted product
deletedBooleanIndicates if the deletion was successful
Soft Delete

The product is soft deleted. It is not physically removed, but it no longer appears in the listing and query services such as Get Products, Get Product By ID and Get ID By Product Code.

Error Cases

HTTP StatusCode
Description
4003073The product has at least one active warranty record, so it cannot be deleted.
4043003No product was found for the given merchantProductId.
5033074The active warranty check could not be completed temporarily. The product was not deleted.

Product With Active Warranties (400 – 3073)

A product that still has active warranty records cannot be deleted. Delete the related warranty records first using the Delete Warranty service, then retry the product deletion.

{
"traceId": "16264259-9daa-40c4-bef5-418d2a89a4d0",
"timestamp": 1693484146171,
"errors": [
{
"code": 3073,
"message": "Bu ürüne ait aktif garanti kaydı bulunduğu için ürün silinemez. Önce ilgili garanti kayıtlarını siliniz."
}
]
}

Warranty Check Unavailable (503 – 3074)

The active warranty check is performed through a query between internal services. If that query cannot be completed at that moment, the service responds with HTTP 503 and code 3074, and the product is not deleted. This is a deliberate safe-side behaviour: the product is never deleted while it is unknown whether it has active warranties.

Retry Is Safe

A 503 with code 3074 is a temporary failure and no change was applied, so you can simply retry the same request later. A 400 with code 3073 is not temporary: retrying it will keep failing until the related warranty records are deleted.