Delete product

Permanently deletes a product that has never been bought. A product sold on any page is refused. A product offered as an order bump or event add-on is refused unless fromAllPages=true, which takes it off those pages first. A product on an archived page is always refused.

DELETE/v1/products/:productId

Authorization

api_key_auth
AuthorizationBearer <token>

API key authentication. Use "Bearer YOUR_API_KEY" format.

In: header

Path Parameters

productIdstringrequired

Unique identifier. Must be in BSON ObjectId format.

^[0-9a-fA-F]{24}$

Query Parameters

fromAllPagesstring

Take the product off every page that offers it as an order bump or event add-on, archived pages included, and out of any store it was added to, then delete it. Without it, a product that is still offered or in a store is refused. A product a checkout page sells as its own is refused either way.

truefalse

Returns

Product deleted successfully

    • successboolean
    • messagestring

Bad request - the product cannot be deleted

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Unauthorized - Missing or invalid API key

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Forbidden - Insufficient permissions or validation error

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Product not found

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

Rate Limit Exceeded - Please try again later.

  • messagestring

    Human-readable error message.

Internal server error

  • statusstring

    Indicates the request failed.

    error
  • typestring

    Machine-readable error category.

  • messagestring

    Human-readable error message.

  • Optional validation details for invalid requests.

import { createCheckoutPageClient } from '@checkoutpage/sdk';const checkoutpage = createCheckoutPageClient({  apiKey: process.env.CHECKOUTPAGE_API_KEY!,});const response = await checkoutpage.products.delete('65f4a1c2e4a9f3d2b1c0a9e8');
{
  "data": {
    "success": true,
    "message": "string"
  }
}
{
  "status": "error",
  "type": "error",
  "message": "Bad request - the product cannot be deleted"
}
{
  "status": "error",
  "type": "error",
  "message": "Missing or invalid API key"
}
{
  "status": "error",
  "type": "error",
  "message": "Insufficient permissions requires: BOOKINGS_WRITE"
}
{
  "status": "error",
  "type": "error",
  "message": "Product not found"
}
{
  "message": "API key rate limit exceeded. Please try again later."
}
{
  "status": "error",
  "type": "error",
  "message": "Internal server error"
}