{
  "info": {
    "name": "Paynet UWS Integration",
    "description": "Collection for testing Universal Web Service (UWS) integration with Paynet. This collection uses JSON-RPC 2.0 over HTTP POST.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "item": [
    {
      "name": "1. GetInformation (Check Subscriber)",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"GetInformation\",\n  \"id\": 1,\n  \"params\": {\n    \"serviceId\": 1,\n    \"fields\": {\n      \"client_id\": \"1234567\"\n    }\n  }\n}"
        },
        "url": {
          "raw": "{{base_url}}/uws",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "uws"
          ]
        }
      },
      "response": []
    },
    {
      "name": "2. PerformTransaction (Make Payment)",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"PerformTransaction\",\n  \"id\": 2,\n  \"params\": {\n    \"amount\": 1000000,\n    \"serviceId\": 1,\n    \"transactionId\": {{$timestamp}},\n    \"fields\": {\n      \"client_id\": \"1234567\"\n    }\n  }\n}"
        },
        "url": {
          "raw": "{{base_url}}/uws",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "uws"
          ]
        }
      },
      "response": []
    },
    {
      "name": "3. CheckTransaction (Status Check)",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"CheckTransaction\",\n  \"id\": 3,\n  \"params\": {\n    \"serviceId\": 1,\n    \"transactionId\": 12345678900,\n    \"timestamp\": \"Mon Jun 16 06:12:41 UZT 2021\"\n  }\n}"
        },
        "url": {
          "raw": "{{base_url}}/uws",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "uws"
          ]
        }
      },
      "response": []
    },
    {
      "name": "4. CancelTransaction (Refund)",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"CancelTransaction\",\n  \"id\": 4,\n  \"params\": {\n    \"serviceId\": 1,\n    \"transactionId\": 12345678900,\n    \"timestamp\": \"2023-10-27 15:35:00\"\n  }\n}"
        },
        "url": {
          "raw": "{{base_url}}/uws",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "uws"
          ]
        }
      },
      "response": []
    },
    {
      "name": "5. GetStatement (Reconciliation)",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"GetStatement\",\n  \"id\": 5,\n  \"params\": {\n    \"serviceId\": 1,\n    \"dateFrom\": \"2023-10-01 00:00:00\",\n    \"dateTo\": \"2023-10-31 23:59:59\"\n  }\n}"
        },
        "url": {
          "raw": "{{base_url}}/uws",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "uws"
          ]
        }
      },
      "response": []
    },
    {
      "name": "6. ChangePassword (Optional Method)",
      "request": {
        "auth": {
          "type": "basic",
          "basic": [
            {
              "key": "password",
              "value": "{{password}}",
              "type": "string"
            },
            {
              "key": "username",
              "value": "{{username}}",
              "type": "string"
            }
          ]
        },
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json",
            "type": "text"
          },
          {
            "key": "Accept",
            "value": "application/json",
            "type": "text"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"jsonrpc\": \"2.0\",\n  \"method\": \"ChangePassword\",\n  \"id\": 6,\n  \"params\": {\n    \"newPassword\": \"newSecurePassword\"\n  }\n}"
        },
        "url": {
          "raw": "{{base_url}}/uws",
          "host": [
            "{{base_url}}"
          ],
          "path": [
            "uws"
          ]
        }
      },
      "response": []
    }
  ],
  "event": [
    {
      "listen": "prerequest",
      "script": {
        "type": "text/javascript",
        "exec": [
          ""
        ]
      }
    },
    {
      "listen": "test",
      "script": {
        "type": "text/javascript",
        "exec": [
          ""
        ]
      }
    }
  ],
  "variable": [
    {
      "key": "base_url",
      "value": "https://api.partner.domain",
      "type": "string"
    },
    {
      "key": "username",
      "value": "paynet_test",
      "type": "string"
    },
    {
      "key": "password",
      "value": "secret_password",
      "type": "string"
    }
  ]
}