{
  "app": "apiworkbench",
  "format": 1,
  "exportedAt": "2026-11-09T00:00:00.000",
  "collections": [
    {
      "id": "60433434-6b39-5bfe-9600-7240fda85704",
      "name": "Shop API (sample)",
      "requests": [
        {
          "id": "b287231f-e0a0-5588-b1ce-3f759a29bc5f",
          "name": "Sign in",
          "method": "POST",
          "url": "{{baseUrl}}/auth/login",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"email\": \"{{email}}\",\n  \"password\": \"{{password}}\"\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "user.email",
              "x": "ada@example.com",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "expiresIn",
              "x": "3600",
              "e": true
            }
          ],
          "folder": "Auth",
          "description": "Signs in and saves the token as {{token}} for the requests that need it.",
          "captures": {
            "token": "body.token"
          }
        },
        {
          "id": "f84ba0b1-882c-5eab-8590-e28c2b7708f9",
          "name": "Sign in with a wrong password",
          "method": "POST",
          "url": "{{baseUrl}}/auth/login",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"email\": \"{{email}}\",\n  \"password\": \"not-the-password\"\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "401",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "error",
              "x": "invalid_credentials",
              "e": true
            }
          ],
          "folder": "Auth",
          "description": "A negative test: the API must refuse with 401."
        },
        {
          "id": "44cd5b1b-1a40-5bc8-8ef0-9920725ef645",
          "name": "Who am I",
          "method": "GET",
          "url": "{{baseUrl}}/me",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "{{token}}",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "name",
              "x": "Ada Lovelace",
              "e": true
            }
          ],
          "folder": "Auth",
          "description": "Sends the token as a Bearer token."
        },
        {
          "id": "af62b8f8-2e10-5873-8c60-11d687d19c0a",
          "name": "Who am I, without a token",
          "method": "GET",
          "url": "{{baseUrl}}/me",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "401",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "error",
              "x": "unauthorized",
              "e": true
            }
          ],
          "folder": "Auth",
          "description": "A negative test: no token, so 401."
        },
        {
          "id": "97b9a70d-94b3-59fe-91f9-0f1ee0a6dc8e",
          "name": "List products",
          "method": "GET",
          "url": "{{baseUrl}}/products",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "total",
              "x": "3",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "items[0].name",
              "x": "Mechanical keyboard",
              "e": true
            },
            {
              "kind": "timeBelow",
              "t": "",
              "x": "1000",
              "e": true
            }
          ],
          "folder": "Catalog"
        },
        {
          "id": "724e87e4-5a98-51e7-b21e-fd2ae4d3ae92",
          "name": "List only books",
          "method": "GET",
          "url": "{{baseUrl}}/products",
          "params": [
            {
              "k": "category",
              "v": "books",
              "e": true
            }
          ],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "total",
              "x": "1",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "items[0].category",
              "x": "books",
              "e": true
            }
          ],
          "folder": "Catalog",
          "description": "The query parameter changes which answer the mock picks."
        },
        {
          "id": "0b9ba228-23a8-5b90-bc87-f50c91ebfb82",
          "name": "Get a product",
          "method": "GET",
          "url": "{{baseUrl}}/products/2",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "id",
              "x": "2",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "inStock",
              "x": "true",
              "e": true
            }
          ],
          "folder": "Catalog"
        },
        {
          "id": "2e823722-c6ca-5d03-a830-c8b522b4ee11",
          "name": "Get a product that does not exist",
          "method": "GET",
          "url": "{{baseUrl}}/products/999",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "404",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "error",
              "x": "not_found",
              "e": true
            }
          ],
          "folder": "Catalog"
        },
        {
          "id": "851d9e1a-2b3b-57fc-a5fc-0204ef531ca5",
          "name": "Place an order",
          "method": "POST",
          "url": "{{baseUrl}}/orders",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"productId\": {{productId}},\n  \"quantity\": {{quantity}}\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "{{token}}",
          "assertions": [],
          "folder": "Orders",
          "description": "Uses {{productId}} and {{quantity}}: from the collection variables, or from a data file in a data-driven run. Saves the order id as {{orderId}}.",
          "testScript": "// Runs after the response. In a data-driven run, each row of the data\n// file supplies productId, quantity and expectedStatus.\nconst expected = Number(pm.iterationData.get('expectedStatus') || 201);\npm.test('status is ' + expected, function () {\n  pm.response.to.have.status(expected);\n});",
          "captures": {
            "orderId": "body.id"
          }
        },
        {
          "id": "9dd136d1-970e-56fb-8b73-9b70df150e5e",
          "name": "Place an order that is too large",
          "method": "POST",
          "url": "{{baseUrl}}/orders",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"productId\": 1,\n  \"quantity\": 50\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "{{token}}",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "422",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "error",
              "x": "quantity_too_large",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "max",
              "x": "10",
              "e": true
            }
          ],
          "folder": "Orders",
          "description": "A boundary test: more than 10 must be refused with 422."
        },
        {
          "id": "d43add7c-69e5-50e2-a94f-0fc7c0d65c75",
          "name": "Place an order without a token",
          "method": "POST",
          "url": "{{baseUrl}}/orders",
          "params": [],
          "headers": [],
          "bodyType": "json",
          "body": "{\n  \"productId\": 1,\n  \"quantity\": 1\n}",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "none",
          "bearerToken": "",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "401",
              "e": true
            }
          ],
          "folder": "Orders"
        },
        {
          "id": "81b754da-ed12-5c74-acaf-294f72806180",
          "name": "Check the order",
          "method": "GET",
          "url": "{{baseUrl}}/orders/{{orderId}}",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "{{token}}",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "200",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "status",
              "x": "shipped",
              "e": true
            },
            {
              "kind": "jsonEquals",
              "t": "items[0].quantity",
              "x": "1",
              "e": true
            }
          ],
          "folder": "Orders",
          "description": "Uses the order id captured by Place an order."
        },
        {
          "id": "a359137f-d3e4-58e2-8a9a-1896511199bb",
          "name": "Cancel the order",
          "method": "DELETE",
          "url": "{{baseUrl}}/orders/{{orderId}}",
          "params": [],
          "headers": [],
          "bodyType": "none",
          "body": "",
          "graphqlVariables": "",
          "formFields": [],
          "authType": "bearer",
          "bearerToken": "{{token}}",
          "assertions": [
            {
              "kind": "statusEquals",
              "t": "",
              "x": "204",
              "e": true
            }
          ],
          "folder": "Orders"
        }
      ],
      "variables": [
        {
          "k": "baseUrl",
          "v": "http://localhost:4020",
          "e": true
        },
        {
          "k": "email",
          "v": "ada@example.com",
          "e": true
        },
        {
          "k": "password",
          "v": "secret123",
          "e": true
        },
        {
          "k": "productId",
          "v": "1",
          "e": true
        },
        {
          "k": "quantity",
          "v": "2",
          "e": true
        }
      ],
      "description": "Login, catalog and order requests with tests, for the Shop API sample mock. From learn.dhivalabs.com."
    }
  ],
  "environments": []
}
