Skip to main content
DELETE
/
v1
/
products
/
{productId}
Delete a product
curl --request DELETE \
  --url https://api-eu.flexportal.io/v1/products/{productId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Tenant-ID: <tenant-id>'
{
  "success": true,
  "message": "<string>",
  "productId": "<string>",
  "productSku": "<string>"
}

Overview

Discontinue a product by marking it as inactive. This is a soft delete—the product is hidden from active catalog queries but preserved for historical records and existing subscriptions.
Products cannot be permanently deleted if they have associated orders or subscriptions. This ensures data integrity and accurate historical reporting.

What Happens When You Delete a Product

  1. Product status changes to discontinued
  2. All variants are marked as inactive
  3. New orders cannot use this product’s SKUs
  4. Existing subscriptions continue unaffected
  5. Historical data is preserved for reporting

Common Use Cases

  • End of Life: Product is no longer available from suppliers
  • Catalog Cleanup: Remove products that are no longer offered
  • Replacement: Old product replaced by new model
  • Temporary Removal: Pause product while resolving supply issues

Before Deleting

Check for active usage:
// Get product details to check for active orders
const product = await getProduct('prod_abc123');

// Check for pending orders using this product's variants
const pendingOrders = await listOrders({
  status: 'pending',
  // Filter by product variants would need to be done client-side
});

// Check for active subscriptions
const activeSubscriptions = await listSubscriptions({
  status: 'active',
  sku: product.variants[0].sku
});

if (activeSubscriptions.count > 0) {
  console.log('Warning: Product has active subscriptions');
}

Reactivating a Discontinued Product

To bring back a discontinued product, use the Update Product endpoint:
PUT /v1/products/{productId}
{
  "status": "active"
}
You’ll also need to reactivate individual variants as needed.

Alternative: Deactivate Specific Variants

If you only want to remove certain variants (not the whole product), update individual variant status instead:
PATCH /v1/products/variants/{variantId}/status
{
  "status": "inactive"
}
This keeps the product active while hiding specific configurations.

Error Handling

Error CodeCauseSolution
NOT_FOUNDProduct doesn’t existVerify product ID
PRODUCT_HAS_ACTIVE_ORDERSCannot delete with pending ordersComplete or cancel orders first

Authorizations

Authorization
string
header
required

API key obtained from FlexPortal dashboard

Headers

Tenant-ID
string
required

Your tenant identifier

Path Parameters

productId
string
required

The product ID

Response

Product deleted

success
enum<boolean>
required
Available options:
true,
false
message
string
required
productId
string
required
productSku
string
required