{
  "info": {
    "_postman_id": "3f7974b4-8592-50a5-92e9-a8f3afc4d3c3",
    "name": "POS GROVE POS API — Admin",
    "description": "Activity log, permissions and settings. API keys need the `admin` scope.\n\n**Setup**\n1. Set the collection variable `baseUrl` to your POS GROVE address followed by `/api/v1`.\n2. Either paste an API key (Online store → API & Webhooks) into `accessToken`, or run **Get an access token** (in the *Sign in* or *Authentication* folder): it signs in with a username and password and saves the token for you (valid 12 hours).\n3. Send any request. A test checks the `{ success }` envelope on every answer.\n\nAll responses use `{ success, message, data, meta }`; errors use `{ success: false, message, error: { code, details, requestId } }`. Lists accept `page`, `limit`, `sort` and `fields`.\n\nReference: https://posgrove.com/docs/pos-api",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [
      {
        "key": "token",
        "value": "{{accessToken}}",
        "type": "string"
      }
    ]
  },
  "event": [
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// POS GROVE APIs answer { success, message, data } (or { success: false, error, message }).",
          "pm.test(\"Response is JSON\", function () { pm.response.to.be.json; });",
          "pm.test(\"Envelope has a success flag\", function () {",
          "  var b = pm.response.json();",
          "  pm.expect(b).to.have.property(\"success\");",
          "  if (pm.response.code < 400) pm.expect(b.success).to.eql(true);",
          "});"
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://your-store.example.com/api/v1",
      "type": "string",
      "description": "Your POS GROVE address followed by /api/v1, e.g. https://shop.example.com/api/v1"
    },
    {
      "key": "accessToken",
      "value": "",
      "type": "string",
      "description": "An API key, or the token saved by the Get an access token request."
    }
  ],
  "item": [
    {
      "name": "Sign in",
      "description": "Run once: saves {{accessToken}} for the other requests (or paste an API key instead).",
      "item": [
        {
          "name": "Get an access token",
          "request": {
            "method": "POST",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              },
              {
                "key": "Content-Type",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/auth/token",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "auth",
                "token"
              ]
            },
            "description": "Signs in with a username and password (and the 6-digit code when two-factor sign-in is on) and returns a bearer token valid for 12 hours. The token is shown only once. Five wrong passwords in a row disable the account, as on the sign-in page.\n\nNo authentication needed.\n\n`POST /auth/token` · operationId `auth.token`",
            "body": {
              "mode": "raw",
              "raw": "{\n  \"username\": \"jane\",\n  \"password\": \"••••••••\"\n}",
              "options": {
                "raw": {
                  "language": "json"
                }
              }
            },
            "auth": {
              "type": "noauth"
            }
          },
          "response": [
            {
              "name": "201 Success",
              "originalRequest": {
                "method": "POST",
                "header": [
                  {
                    "key": "Accept",
                    "value": "application/json"
                  },
                  {
                    "key": "Content-Type",
                    "value": "application/json"
                  }
                ],
                "url": {
                  "raw": "{{baseUrl}}/auth/token",
                  "host": [
                    "{{baseUrl}}"
                  ],
                  "path": [
                    "auth",
                    "token"
                  ]
                },
                "body": {
                  "mode": "raw",
                  "raw": "{\n  \"username\": \"jane\",\n  \"password\": \"••••••••\"\n}",
                  "options": {
                    "raw": {
                      "language": "json"
                    }
                  }
                }
              },
              "status": "Success",
              "code": 201,
              "_postman_previewlanguage": "json",
              "header": [
                {
                  "key": "Content-Type",
                  "value": "application/json; charset=utf-8"
                }
              ],
              "body": "{\n  \"success\": true,\n  \"message\": \"OK\",\n  \"data\": {\n    \"token\": \"mtk_<token shown once>\",\n    \"tokenType\": \"Bearer\",\n    \"expiresAt\": \"2026-10-02T21:30:00.000Z\",\n    \"expiresIn\": 43200,\n    \"user\": {\n      \"id\": \"66f1c2a9e4b0a1b2c3d4e502\",\n      \"username\": \"jane\",\n      \"name\": \"Jane Doe\"\n    }\n  }\n}"
            }
          ],
          "event": [
            {
              "listen": "test",
              "script": {
                "type": "text/javascript",
                "exec": [
                  "var body = {};",
                  "try { body = pm.response.json(); } catch (e) {}",
                  "if (body && body.data && body.data.token) {",
                  "  pm.collectionVariables.set(\"accessToken\", body.data.token);",
                  "  if (pm.environment && pm.environment.has(\"accessToken\")) pm.environment.set(\"accessToken\", body.data.token);",
                  "  console.log(\"POS GROVE: access token saved to {{accessToken}} (valid until \" + body.data.expiresAt + \")\");",
                  "}",
                  "pm.test(\"Access token received\", function () { pm.expect(body.data && body.data.token).to.be.a(\"string\"); });"
                ]
              }
            }
          ]
        }
      ]
    },
    {
      "name": "Activity log",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/admin/activity-logs",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "admin",
            "activity-logs"
          ],
          "query": [
            {
              "key": "page",
              "value": "1",
              "description": "Page number (starts at 1).",
              "disabled": true
            },
            {
              "key": "limit",
              "value": "25",
              "description": "Items per page (max 100).",
              "disabled": true
            },
            {
              "key": "q",
              "value": "",
              "description": "Search text.",
              "disabled": true
            },
            {
              "key": "from",
              "value": "",
              "description": "Only items on or after this date (YYYY-MM-DD).",
              "disabled": true
            },
            {
              "key": "to",
              "value": "",
              "description": "Only items on or before this date (YYYY-MM-DD, whole day included).",
              "disabled": true
            },
            {
              "key": "module",
              "value": "",
              "description": "",
              "disabled": true
            },
            {
              "key": "action",
              "value": "",
              "description": "",
              "disabled": true
            },
            {
              "key": "userId",
              "value": "",
              "description": "",
              "disabled": true
            },
            {
              "key": "resource",
              "value": "",
              "description": "",
              "disabled": true
            },
            {
              "key": "resourceId",
              "value": "",
              "description": "",
              "disabled": true
            },
            {
              "key": "status",
              "value": "",
              "description": "One of: success, failure.",
              "disabled": true
            }
          ]
        },
        "description": "Who did what and when, across all modules (including API calls, marked with source \"api\"). Sensitive values in before/after snapshots are redacted.\n\nPermission: `admin.admin` or `logs/general.activity` or `logs/general.logs`.\n\nScope: `admin:read`.\n\n`GET /admin/activity-logs` · operationId `admin.activity`"
      },
      "response": [
        {
          "name": "200 Success",
          "originalRequest": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/admin/activity-logs",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "activity-logs"
              ],
              "query": [
                {
                  "key": "page",
                  "value": "1",
                  "description": "Page number (starts at 1).",
                  "disabled": true
                },
                {
                  "key": "limit",
                  "value": "25",
                  "description": "Items per page (max 100).",
                  "disabled": true
                },
                {
                  "key": "q",
                  "value": "",
                  "description": "Search text.",
                  "disabled": true
                },
                {
                  "key": "from",
                  "value": "",
                  "description": "Only items on or after this date (YYYY-MM-DD).",
                  "disabled": true
                },
                {
                  "key": "to",
                  "value": "",
                  "description": "Only items on or before this date (YYYY-MM-DD, whole day included).",
                  "disabled": true
                },
                {
                  "key": "module",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "action",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "userId",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "resource",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "resourceId",
                  "value": "",
                  "description": "",
                  "disabled": true
                },
                {
                  "key": "status",
                  "value": "",
                  "description": "One of: success, failure.",
                  "disabled": true
                }
              ]
            }
          },
          "status": "Success",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json; charset=utf-8"
            }
          ],
          "body": "{\n  \"success\": true,\n  \"message\": \"OK\",\n  \"data\": [\n    {\n      \"id\": \"66f1c2a9e4b0a1b2c3d4e518\",\n      \"at\": \"2026-10-02T14:05:00.000Z\",\n      \"module\": \"pos\",\n      \"action\": \"update\",\n      \"resource\": \"pos_product\",\n      \"resourceId\": \"66f1c2a9e4b0a1b2c3d4e503\",\n      \"description\": \"Updated product Rice 5kg (API, token)\",\n      \"status\": \"success\",\n      \"user\": {\n        \"id\": \"66f1c2a9e4b0a1b2c3d4e502\",\n        \"name\": \"Jane Doe\"\n      },\n      \"source\": \"api\",\n      \"ip\": \"102.89.1.20\",\n      \"method\": \"PATCH\",\n      \"path\": \"/api/v1/products/66f1c2a9e4b0a1b2c3d4e503\",\n      \"requestId\": \"106213322361546\",\n      \"before\": {\n        \"name\": \"Rice 5 kg\"\n      },\n      \"after\": {\n        \"name\": \"Rice 5kg\"\n      }\n    }\n  ]\n}"
        }
      ]
    },
    {
      "name": "Permission catalogue",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/admin/permissions",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "admin",
            "permissions"
          ]
        },
        "description": "Every menu and permission key the app knows, as used by PUT /users/{id}/permissions.\n\nPermission: `admin.permission` or `admin.admin`.\n\nScope: `admin:read`.\n\n`GET /admin/permissions` · operationId `admin.permissions`"
      },
      "response": [
        {
          "name": "200 Success",
          "originalRequest": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/admin/permissions",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "permissions"
              ]
            }
          },
          "status": "Success",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json; charset=utf-8"
            }
          ],
          "body": "{\n  \"success\": true,\n  \"message\": \"OK\",\n  \"data\": [\n    {\n      \"menu\": \"pos\",\n      \"name\": \"POS\",\n      \"permissions\": {\n        \"pos\": \"View POS\",\n        \"products\": \"View Products\"\n      }\n    }\n  ]\n}"
        }
      ]
    },
    {
      "name": "Main settings (no secrets)",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/admin/settings",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "admin",
            "settings"
          ]
        },
        "description": "Permission: `pos.setting` or `pos.onlinestore`.\n\nScope: `admin:read`.\n\n`GET /admin/settings` · operationId `admin.settings`"
      },
      "response": [
        {
          "name": "200 Success",
          "originalRequest": {
            "method": "GET",
            "header": [
              {
                "key": "Accept",
                "value": "application/json"
              }
            ],
            "url": {
              "raw": "{{baseUrl}}/admin/settings",
              "host": [
                "{{baseUrl}}"
              ],
              "path": [
                "admin",
                "settings"
              ]
            }
          },
          "status": "Success",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json; charset=utf-8"
            }
          ],
          "body": "{\n  \"success\": true,\n  \"message\": \"OK\",\n  \"data\": {\n    \"vatRate\": 7.5,\n    \"currencySymbol\": \"NGN\",\n    \"lowStockAlert\": true,\n    \"enableOnlineOrder\": true,\n    \"minOrderAmount\": 0,\n    \"orderPrepTime\": 20,\n    \"notificationEmail\": \"owner@example.com\",\n    \"messaging\": {\n      \"emailConfigured\": true,\n      \"fromEmail\": \"shop@example.com\",\n      \"fromName\": \"Main Street\",\n      \"smsConfigured\": false,\n      \"smsProvider\": \"\",\n      \"sendOrderConfirmation\": true,\n      \"enableSmsNotifications\": false,\n      \"sendWelcomeEmails\": false\n    },\n    \"api\": {\n      \"keys\": 2,\n      \"activeKeys\": 1\n    },\n    \"webhooks\": 1,\n    \"maintenance\": {\n      \"enabled\": false\n    }\n  }\n}"
        }
      ]
    }
  ]
}