Takazudo Modular Docs

Type to search...

to open search from anywhere

Admin Reservation Delete

Admin Reservation Delete

Permanently delete reservations from the blob store. This action cannot be undone.

This endpoint permanently deletes data. Use with caution - deleted reservations cannot be recovered.

Endpoint

POST /api/admin/reservations/delete

Authentication

Requires Bearer token authentication.

Authorization: Bearer <PREORDER_API_TOKEN>

Request

Headers

HeaderRequiredValue
Content-TypeYesapplication/json
AuthorizationYesBearer <token>

Body

interface AdminBulkDeleteRequest {
  ids: Array<{
    id: string;         // Reservation ID
    productSlug: string; // Product slug for the reservation
  }>;
}

Example Request

curl -X POST https://preview--takazudomodular.netlify.app/api/admin/reservations/delete \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PREORDER_API_TOKEN" \
  -d '{
    "ids": [
      { "id": "res-001", "productSlug": "n32b-slim" },
      { "id": "res-002", "productSlug": "n32b-slim" }
    ]
  }'

Response

Success Response (200)

interface AdminBulkDeleteResponse {
  success: true;
  deletedCount: number;          // Number of successfully deleted reservations
  deletedIds: string[];          // IDs that were successfully deleted
  errors?: Array<{               // Optional: any errors that occurred
    id: string;
    error: string;
  }>;
}

Example Success Response

{
  "success": true,
  "deletedCount": 2,
  "deletedIds": ["res-001", "res-002"]
}

Partial Success Response

When some items fail to delete:

{
  "success": true,
  "deletedCount": 1,
  "deletedIds": ["res-001"],
  "errors": [
    { "id": "res-999", "error": "Failed to delete reservation" }
  ]
}

Error Responses

Validation Error (400)

{
  "success": false,
  "error": "ids array is required"
}
{
  "success": false,
  "error": "ids array cannot be empty"
}

Authentication Error (401)

{
  "success": false,
  "error": "Unauthorized"
}

Behavior

  1. Validates the request body contains a non-empty ids array
  2. Iterates through each reservation ID
  3. Permanently deletes the reservation from the blob store
  4. Removes the reservation from the product index
  5. Returns summary of deleted items and any errors

Use Cases

  • Cleaning up test data
  • Removing duplicate entries
  • GDPR compliance (data deletion requests)
  • Pruning old archived records