{
  "info": {
    "_postman_id": "whish-cash-collection-locations",
    "name": "Whish Money \u00b7 Cash Collection Locations (v1.0.0)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Cash Collection Locations API. Replace username and key with your credentials (or attach the Whish Money environment); baseUrl already points at sandbox. Request-id auto-generates a fresh numeric value before every send, as the API requires on every endpoint. Both endpoints are read-only lookups."
  },
  "item": [
    {
      "name": "List governorates and districts",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "username",
            "value": "{{username}}"
          },
          {
            "key": "key",
            "value": "{{key}}"
          },
          {
            "key": "Request-id",
            "value": "{{Request-id}}"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/governorates",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "governorates"
          ]
        }
      }
    },
    {
      "name": "List shops",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "username",
            "value": "{{username}}"
          },
          {
            "key": "key",
            "value": "{{key}}"
          },
          {
            "key": "Request-id",
            "value": "{{Request-id}}"
          },
          {
            "key": "Accept",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/shops?governorateId=3&districtId=4",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "shops"
          ],
          "query": [
            {
              "key": "governorateId",
              "value": "3"
            },
            {
              "key": "districtId",
              "value": "4"
            }
          ]
        },
        "description": "governorateId and districtId are optional filters (Beirut in this example). Remove them to return all shops."
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://sandbox.woocash.money/api",
      "description": "Base URL for this environment. Correct as shipped; attach an environment to switch."
    },
    {
      "key": "username",
      "value": "",
      "description": "Your account username, issued by Whish Money. Replace this before sending."
    },
    {
      "key": "key",
      "value": "",
      "description": "Your secret API key, issued by Whish Money. Replace this before sending."
    },
    {
      "key": "Request-id",
      "value": "",
      "description": "Set automatically before every send by the pre-request script: a new unique numeric value per transfer. Leave this empty. To exercise a timeout retry by hand, disable the collection pre-request script and set the id of the transfer you are retrying."
    },
    {
      "key": "_seq",
      "value": "",
      "description": "Internal counter used by the pre-request script to keep generated ids unique. Leave this empty."
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          "// Request-id is required on every call and must be unique per request. Fresh numeric value",
          "// per send. Digits only (Long); never add a prefix. Millisecond clock + a monotonic counter",
          "// so several sends in the same millisecond still differ.",
          "var seq = (parseInt(pm.collectionVariables.get('_seq'), 10) || 0) + 1;",
          "pm.collectionVariables.set('_seq', seq);",
          "pm.collectionVariables.set('Request-id', String(Date.now()) + String(seq % 10000).padStart(4, '0'));"
        ]
      }
    }
  ]
}