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
| Parameter | Type | Required | Description |
|---|---|---|---|
| merchantProductId | Integer | Yes | Product Id |
Response
{
"merchantProductId": 12345,
"deleted": true
}
Response Fields
| Field | Type | Description |
|---|---|---|
| merchantProductId | Integer | ID of the deleted product |
| deleted | Boolean | Indicates if the deletion was successful |
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 Status | Code | Description |
|---|---|---|
| 400 | 3073 | The product has at least one active warranty record, so it cannot be deleted. |
| 404 | 3003 | No product was found for the given merchantProductId. |
| 503 | 3074 | The 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.
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.