{
  "info": {
    "name": "QAFakeAPI - Free Bruno Starter Collection",
    "_postman_id": "qafakeapi-bruno-starter-v2",
    "description": "Official companion Bruno starter collection for QAFakeAPI by Ziara TechQ Labs. Import directly into Bruno to test all endpoints with pre-configured assertions and auth token chaining.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "baseUrl",
      "value": "http://localhost:3000",
      "type": "string"
    },
    {
      "key": "authToken",
      "value": "",
      "type": "string"
    }
  ],
  "item": [
    {
      "name": "01 - Authentication",
      "item": [
        {
          "name": "User Login & Capture Token",
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "// Bruno post-response script to automatically store JWT token",
                  "const res = res.getBody();",
                  "if (res.token) {",
                  "  bru.setEnvVar(\"authToken\", res.token);",
                  "  console.log(\"Captured JWT Bearer Token:\", res.token);",
                  "}"
                ]
              }
            }
          ],
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"username\": \"aquil\",\n  \"password\": \"test1234\"\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/auth/login",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "login"
              ]
            },
            "description": "Authenticates test credentials and captures Bearer token into environment variable."
          }
        },
        {
          "name": "Get Current User Profile",
          "request": {
            "method": "GET",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/auth/me",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "me"
              ]
            },
            "description": "Requires active Bearer token captured from login."
          }
        },
        {
          "name": "Revoke Session (Logout)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/auth/logout",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "auth",
                "logout"
              ]
            },
            "description": "Invalidates the current session token."
          }
        }
      ]
    },
    {
      "name": "02 - Products (CRUD)",
      "item": [
        {
          "name": "List All Products",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/products?limit=10&page=1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "products"
              ],
              "query": [
                {
                  "key": "limit",
                  "value": "10"
                },
                {
                  "key": "page",
                  "value": "1"
                }
              ]
            },
            "description": "Fetches paginated list of catalog products."
          }
        },
        {
          "name": "Search Products by Keyword",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/products?q=mouse",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "products"
              ],
              "query": [
                {
                  "key": "q",
                  "value": "mouse"
                }
              ]
            },
            "description": "Case-insensitive search across product title and category."
          }
        },
        {
          "name": "Get Product by ID",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/products/1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "products",
                "1"
              ]
            }
          }
        },
        {
          "name": "Create Product (Auth Required)",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"title\": \"Pro Gaming Mechanical Keyboard\",\n  \"price\": 119.99,\n  \"category\": \"Electronics\",\n  \"inStock\": true\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/products",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "products"
              ]
            }
          }
        },
        {
          "name": "Update Product",
          "request": {
            "method": "PUT",
            "header": [
              {
                "key": "Content-Type",
                "value": "application/json"
              },
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              }
            ],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"price\": 99.99,\n  \"inStock\": false\n}"
            },
            "url": {
              "raw": "{{baseUrl}}/api/v1/products/1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "products",
                "1"
              ]
            }
          }
        },
        {
          "name": "Delete Product",
          "request": {
            "method": "DELETE",
            "header": [
              {
                "key": "Authorization",
                "value": "Bearer {{authToken}}"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/api/v1/products/1",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "products",
                "1"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "03 - Users & Orders",
      "item": [
        {
          "name": "List Users",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/users",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "users"
              ]
            }
          }
        },
        {
          "name": "List Nested Relational Orders",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/orders",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "orders"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "04 - QA Chaos & Simulators",
      "item": [
        {
          "name": "Simulate 500 Server Error",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/mock/status/500",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "mock",
                "status",
                "500"
              ]
            }
          }
        },
        {
          "name": "Simulate 429 Rate Limiting",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/mock/status/429",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "mock",
                "status",
                "429"
              ]
            }
          }
        },
        {
          "name": "Simulate 800ms Network Latency",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/mock/delay/800",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "mock",
                "delay",
                "800"
              ]
            }
          }
        }
      ]
    },
    {
      "name": "05 - System",
      "item": [
        {
          "name": "Health Check",
          "request": {
            "method": "GET",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/meta/health",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "meta",
                "health"
              ]
            }
          }
        },
        {
          "name": "Reset Database to Seed State",
          "request": {
            "method": "POST",
            "header": [],
            "url": {
              "raw": "{{baseUrl}}/api/v1/reset",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "api",
                "v1",
                "reset"
              ]
            }
          }
        }
      ]
    }
  ]
}