{
  "info": {
    "_postman_id": "whish-pay",
    "name": "Whish \u00b7 Whish Pay (v1.4.3)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Whish Pay API (itel-service). Set channel, secret, websiteUrl and userAgent as collection variables (or use an environment)."
  },
  "item": [
    {
      "name": "Get balance",
      "request": {
        "method": "GET",
        "header": [
          {
            "key": "channel",
            "value": "{{channel}}"
          },
          {
            "key": "secret",
            "value": "{{secret}}"
          },
          {
            "key": "websiteUrl",
            "value": "{{websiteUrl}}"
          },
          {
            "key": "User-Agent",
            "value": "{{userAgent}}"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/payment/account/balance?currency=USD",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment",
            "account",
            "balance"
          ],
          "query": [
            {
              "key": "currency",
              "value": "USD"
            }
          ]
        }
      }
    },
    {
      "name": "Post payment",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "channel",
            "value": "{{channel}}"
          },
          {
            "key": "secret",
            "value": "{{secret}}"
          },
          {
            "key": "websiteUrl",
            "value": "{{websiteUrl}}"
          },
          {
            "key": "User-Agent",
            "value": "{{userAgent}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/payment/whish",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment",
            "whish"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"amount\": \"1\",\n  \"currency\": \"USD\",\n  \"invoice\": \"Order #1\",\n  \"externalId\": 1,\n  \"successCallbackUrl\": \"https://example.com/api/payment/success\",\n  \"failureCallbackUrl\": \"https://example.com/api/payment/failure\",\n  \"successRedirectUrl\": \"https://example.com/thank-you\",\n  \"failureRedirectUrl\": \"https://example.com/payment-error\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Get status",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "channel",
            "value": "{{channel}}"
          },
          {
            "key": "secret",
            "value": "{{secret}}"
          },
          {
            "key": "websiteUrl",
            "value": "{{websiteUrl}}"
          },
          {
            "key": "User-Agent",
            "value": "{{userAgent}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/payment/collect/status",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment",
            "collect",
            "status"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"currency\": \"USD\",\n  \"externalId\": 1\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    },
    {
      "name": "Post refund",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "channel",
            "value": "{{channel}}"
          },
          {
            "key": "secret",
            "value": "{{secret}}"
          },
          {
            "key": "websiteUrl",
            "value": "{{websiteUrl}}"
          },
          {
            "key": "User-Agent",
            "value": "{{userAgent}}"
          },
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/payment/whish/refund",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "payment",
            "whish",
            "refund"
          ]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"currency\": \"USD\",\n  \"externalId\": 1,\n  \"refundReason\": \"Customer canceled order\"\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        }
      }
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.whish.money/itel-service/api"
    },
    {
      "key": "channel",
      "value": "YOUR_CHANNEL"
    },
    {
      "key": "secret",
      "value": "YOUR_SECRET"
    },
    {
      "key": "websiteUrl",
      "value": "https://yoursite.com"
    },
    {
      "key": "userAgent",
      "value": "AcmeStore/1.0 (https://acme.example; dev@acme.example)"
    }
  ]
}