Takazudo Modular Docs

Type to search...

to open search from anywhere

Admin Reservation Archives List

Admin Reservation Archives List

List archived reservations with pagination support.

Endpoint

POST /api/admin/reservations/archives/list

Authentication

Requires Bearer token authentication.

Authorization: Bearer <PREORDER_API_TOKEN>

Request

Headers

HeaderRequiredValue
Content-TypeYesapplication/json
AuthorizationYesBearer <token>

Body

interface AdminArchiveListRequest {
  page?: number;        // Page number (1-based, default: 1)
  pageSize?: number;    // Items per page (default: 20, max: 100)
  productSlug?: string; // Filter by product slug
  status?: string;      // Filter by original status
}

Parameters

FieldTypeRequiredDefaultDescription
pagenumberNo1Page number (1-based)
pageSizenumberNo20Items per page (max: 100)
productSlugstringNo-Filter by product slug
statusstringNo-Filter by original status

Example Request

# Get first page of archives
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/reservations/archives/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PREORDER_API_TOKEN" \
  -d '{}'

# Get page 2 with 10 items per page
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/reservations/archives/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PREORDER_API_TOKEN" \
  -d '{ "page": 2, "pageSize": 10 }'

# Filter by product
curl -X POST https://preview--takazudomodular.netlify.app/api/admin/reservations/archives/list \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $PREORDER_API_TOKEN" \
  -d '{ "productSlug": "n32b-slim" }'

Response

Success Response (200)

interface AdminArchiveListResponse {
  success: true;
  reservations: Reservation[];  // Array of archived reservations
  total: number;                // Total count of archived reservations
  page: number;                 // Current page number
  pageSize: number;             // Items per page
  totalPages: number;           // Total number of pages
}

Example Success Response

{
  "success": true,
  "reservations": [
    {
      "id": "res-001",
      "email": "user1@example.com",
      "name": "John Doe",
      "productSlug": "n32b-slim",
      "createdAt": "2024-01-15T10:30:00Z",
      "status": "responded",
      "respondedAt": "2024-01-20T12:00:00Z",
      "isArchived": true,
      "archivedAt": "2024-02-01T09:00:00Z"
    },
    {
      "id": "res-002",
      "email": "user2@example.com",
      "name": "Jane Smith",
      "productSlug": "module-x",
      "createdAt": "2024-01-10T09:00:00Z",
      "status": "reserved",
      "isArchived": true,
      "archivedAt": "2024-02-01T09:00:00Z"
    }
  ],
  "total": 15,
  "page": 1,
  "pageSize": 20,
  "totalPages": 1
}

Empty Result

{
  "success": true,
  "reservations": [],
  "total": 0,
  "page": 1,
  "pageSize": 20,
  "totalPages": 0
}

Error Responses

Validation Error (400)

{
  "success": false,
  "error": "pageSize must be between 1 and 100"
}

Authentication Error (401)

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

Behavior

  1. Fetches all reservations where isArchived === true
  2. Applies optional filters (productSlug, status)
  3. Sorts by archivedAt descending (most recently archived first)
  4. Paginates results based on page and pageSize parameters
  5. Returns paginated list with metadata

Reservation Object

FieldTypeDescription
idstringUnique reservation ID
emailstringCustomer’s email address
namestringCustomer’s name
productSlugstringProduct identifier
statusstringOriginal status when archived
createdAtstringISO 8601 timestamp of reservation creation
respondedAtstring | nullISO 8601 timestamp when responded
isArchivedbooleanAlways true for archived reservations
archivedAtstringISO 8601 timestamp when archived

Sorting

Results are sorted by archivedAt in descending order (most recently archived first).