Delete file
Deletes a file.
/v1/files/:fileIdAuthorization
api_key_auth API key authentication. Use "Bearer YOUR_API_KEY" format.
In: header
Path Parameters
Unique identifier. Must be in BSON ObjectId format.
^[0-9a-fA-F]{24}$
Returns
File deleted successfully
- successboolean
- messagestring
Bad request - Invalid request parameters
- 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.
File not found or not owned by your account
- statusstring
Indicates the request failed.
error - typestring
Machine-readable error category.
- messagestring
Human-readable error message.
Optional validation details for invalid requests.
File is used by a product, checkout page, event, form, theme, ticket type, store logo or link in bio, or was sold in a past order.
- 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.files.delete('65f4a1c2e4a9f3d2b1c0a9e8');{
"data": {
"success": true,
"message": "string"
}
}{
"status": "error",
"type": "ValidationError",
"message": "Bad request - Invalid body: Field 'email' must be a valid email address",
"errors": [
{
"param": "email",
"message": "must be a valid email address"
}
]
}{
"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": "File not found"
}{
"status": "error",
"type": "error",
"message": "File is used by a product, checkout page, event, form, theme, ticket type, store logo or link in bio, or was sold in a past order."
}{
"message": "API key rate limit exceeded. Please try again later."
}{
"status": "error",
"type": "error",
"message": "Internal server error"
}