{
  "info": {
    "_postman_id": "whish-pay",
    "name": "Whish · Whish Pay (v1.4.3)",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
    "description": "Whish Pay API (itel-service). baseUrl defaults to the SANDBOX environment (https://api.sandbox.whish.money/itel-service/api) so you cannot accidentally call Production. Switch baseUrl to https://api.whish.money/itel-service/api for live traffic. Set channel, secret, websiteUrl and userAgent as collection variables (or use an environment)."
  },
  "item": [
    {
      "name": "Get account 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"
            }
          ]
        }
      },
      "response": [
        {
          "name": "200 - Success (USD)",
          "originalRequest": {
            "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"
                }
              ]
            }
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": true,\n  \"code\": null,\n  \"dialog\": null,\n  \"actions\": null,\n  \"extra\": null,\n  \"data\": {\n    \"balance\": 10439.0\n  }\n}"
        }
      ]
    },
    {
      "name": "Create a 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"
            }
          }
        }
      },
      "response": [
        {
          "name": "200 - Success",
          "originalRequest": {
            "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"
                }
              }
            }
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": true,\n  \"code\": null,\n  \"dialog\": null,\n  \"extra\": null,\n  \"data\": {\n    \"collectUrl\": \"https://whish.money/pay/8nQS2mL\"\n  }\n}"
        }
      ]
    },
    {
      "name": "Get payment 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"
            }
          }
        }
      },
      "response": [
        {
          "name": "200 - Success",
          "originalRequest": {
            "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"
                }
              }
            }
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": true,\n  \"code\": null,\n  \"dialog\": null,\n  \"extra\": null,\n  \"data\": {\n    \"collectStatus\": \"success\",\n    \"payerPhoneNumber\": \"96170902894\"\n  }\n}"
        }
      ]
    },
    {
      "name": "Refund a 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/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"
            }
          }
        }
      },
      "response": [
        {
          "name": "200 - Success",
          "originalRequest": {
            "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"
                }
              }
            }
          },
          "status": "OK",
          "code": 200,
          "_postman_previewlanguage": "json",
          "header": [
            {
              "key": "Content-Type",
              "value": "application/json"
            }
          ],
          "cookie": [],
          "body": "{\n  \"status\": true,\n  \"code\": null,\n  \"dialog\": null,\n  \"actions\": null,\n  \"extra\": null,\n  \"retrieved\": false,\n  \"data\": null\n}"
        }
      ]
    }
  ],
  "variable": [
    {
      "key": "baseUrl",
      "value": "https://api.sandbox.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)"
    }
  ]
}