DELETE
/
products
/
{id}
curl -X DELETE https://api.contazen.ro/v1/products/prod_5f6g7h8i9j \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "id": "prod_5f6g7h8i9j",
    "object": "product",
    "deleted": true
  },
  "meta": {
    "version": "v1",
    "response_time": "34.56ms"
  }
}

Request

id
string
required
The product ID (ID) to delete
Products that have been used in invoices cannot be deleted. You will receive an error indicating how many invoices contain this product.

Response

success
boolean
Indicates if the request was successful
data
object
meta
object
Response metadata including version and response time
curl -X DELETE https://api.contazen.ro/v1/products/prod_5f6g7h8i9j \
  -H "Authorization: Bearer sk_live_YOUR_API_KEY"
{
  "success": true,
  "data": {
    "id": "prod_5f6g7h8i9j",
    "object": "product",
    "deleted": true
  },
  "meta": {
    "version": "v1",
    "response_time": "34.56ms"
  }
}

Important Notes

Permanent Deletion

Product deletion is permanent and cannot be undone. The product table does not use soft deletes.

Invoice Dependencies

Products that have been used in any invoice (draft or finalized) cannot be deleted. This ensures data integrity and prevents broken references in your invoices. If you need to stop using a product, consider:
  1. Updating its name to indicate it’s discontinued
  2. Setting a price of 0 to prevent accidental use
  3. Creating a new product for replacements

Alternative Approaches

Instead of deleting products, you might want to:
  • Update the product name to include β€œ[DISCONTINUED]”
  • Set special pricing to indicate unavailability
  • Use product categories to organize active vs. inactive products

Stock Management Note

The stock management endpoint (/api/v1/products/{id}/stock) is not implemented as the product table does not support inventory tracking. If you need stock management, this must be handled through a separate system or custom implementation.