Skip to main content

Delete Product

This endpoint deletes a product and all its associated variants from the system.

πŸ”Ή Endpoint Details​

DELETE /api/v1/products/{productId}

πŸ”’ Authentication​

HeaderRequiredDescription
Content-TypeYesMust be application/json
AuthorizationYesFormat: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature

🧩 Request Example​

curl -X DELETE "https://openapi.onlive.site/api/v1/products/{productId}" \
-H "Content-Type: application/json" \
-H "Authorization: ONLIVESITE Credential:ONLIVEAccessKeyId, Signature=CalculatedSignature"

πŸ“€ Response Format​

{
"id": "123e4567-e89b-12d3-a456-426614174000",
"name": "Premium T-Shirt",
"deleted": true,
"deletedAt": "2025-05-22T10:30:00Z"
}

πŸ“˜ Notes​

  • Deleting a product will also delete all its variants
  • This operation cannot be undone
  • Associated images are not physically deleted
  • Historical orders will maintain their product data
  • Deletion is permanent and removes the product from all listings

βœ… Common Use Cases​

  • πŸ—‘οΈ Product Discontinuation: Remove discontinued products
  • πŸ”„ Catalog Cleanup: Remove obsolete products
  • 🎯 Version Management: Remove old product versions
  • 🏷️ Category Restructuring: Remove products during reorganization
  • ⚑ Data Management: Clean up test or duplicate products

⚠️ Pre-deletion Checklist​

  1. Ensure the product is not:

    • Part of active orders
    • Referenced in active promotions
    • Listed in active collections
    • Required for inventory records
  2. Consider:

    • Archiving instead of deleting
    • Backing up product data
    • Notifying relevant stakeholders
    • Updating related catalogs

❌ Error Responses​

401 Unauthorized​

{
"statusCode": 401,
"message": "Invalid or missing authorization credentials"
}

403 Forbidden​

{
"statusCode": 403,
"message": "Insufficient permissions to delete this product"
}

404 Not Found​

{
"statusCode": 404,
"message": "Product not found"
}

409 Conflict​

{
"statusCode": 409,
"message": "Product cannot be deleted while in use by active orders"
}