<!-- ZenPays documentation · https://docs.zenpayz.com/docs/rest-api/endpoints/billing/products/delete-product -->

# Delete Product

Archive a product (soft delete). The product will be set to `ARCHIVED` status and will no longer appear in active product listings.

<EndpointHeader verb="DELETE" path="/merchant/api/v1/products/:productId" />

## Request

### Headers

<ParamTable
  label="Header"
  rows={[
    { name: "Authorization", required: true, desc: "`Bearer {api_key}`" },
    { name: "X-Signature", required: true, desc: "HMAC-SHA256 signature" },
    { name: "X-Timestamp", required: true, desc: "ISO 8601 timestamp" },
    { name: "X-Secret-Salt", required: true, desc: "Secret salt for HMAC validation" },
    { name: "Content-Type", required: true, desc: "`application/json`" },
  ]}
/>

### Path Parameters

<ParamTable
  rows={[
    { name: "productId", type: "string", required: true, desc: "The product ID (e.g. `prod_a1b2c3d4e5f6g7h8`)" },
  ]}
/>

## Response

### Success (200 OK)

```json
{
  "success": true,
  "data": {
    "productId": "prod_a1b2c3d4e5f6g7h8",
    "status": "ARCHIVED"
  },
  "message": "Product archived successfully",
  "error": null,
  "meta": {
    "request_id": "req_xxxxx",
    "timestamp": "2024-01-16T14:20:00.000Z",
    "processing_time_ms": 30,
    "api_version": "v1",
    "endpoint": "DELETE /products/:productId",
    "user_type": "merchant"
  }
}
```

### Error Responses

<ErrorTable
  rows={[
    { code: "UNAUTHORIZED", status: "401", message: "Invalid API key" },
    { code: "PRODUCT_NOT_FOUND", status: "404", message: "Product does not exist" },
  ]}
/>

<CodeRail>

## Examples

<Tabs groupId="language">
  <TabItem value="curl" label="cURL" default>

```bash
curl -X DELETE https://api.zenpayz.com/merchant/api/v1/products/prod_a1b2c3d4e5f6g7h8 \
  -H "Authorization: Bearer zp_test_xxxxx" \
  -H "X-Timestamp: 2024-01-16T14:20:00.000Z" \
  -H "X-Signature: a1b2c3d4e5f6..." \
  -H "X-Secret-Salt: your_secret_salt" \
  -H "Content-Type: application/json"
```

  </TabItem>
  <TabItem value="javascript" label="JavaScript">

```javascript
const response = await fetch('https://api.zenpayz.com/merchant/api/v1/products/prod_a1b2c3d4e5f6g7h8', {
  method: 'DELETE',
  headers: {
    'Authorization': `Bearer ${apiKey}`,
    'X-Timestamp': timestamp,
    'X-Signature': signature,
    'X-Secret-Salt': secretSalt,
    'Content-Type': 'application/json',
  },
});

const result = await response.json();
console.log(result.data.status); // "ARCHIVED"
```

  </TabItem>
  <TabItem value="sdk" label="SDK">

```javascript
const result = await zenpays.products.delete('prod_a1b2c3d4e5f6g7h8');

console.log(result.status); // "ARCHIVED"
```

  </TabItem>
</Tabs>

</CodeRail>

## Related Endpoints

- [Create Product](/docs/rest-api/endpoints/billing/products/create-product)
- [Get Product](/docs/rest-api/endpoints/billing/products/get-product)
- [List Products](/docs/rest-api/endpoints/billing/products/list-products)
- [Update Product](/docs/rest-api/endpoints/billing/products/update-product)
