{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-guides/product/send-money/sidebars.yaml","api-docs-api-reference/@latest/index.yaml":"api-docs-api-reference/@latest/index.yaml"},"props":{"metadata":{"markdoc":{"tagList":["sub-header","admonition","openapi-code-sample"]},"type":"markdown"},"seo":{"title":"Testing refunds","siteUrl":"https://docs.wise.com","projectTitle":"Wise Platform","description":"Simulate refunds in Sandbox to test the transfers#refund webhook end-to-end, including Swift partial refund scenarios."},"dynamicMarkdocComponents":["openapi"],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"testing-refunds","__idx":0},"children":["Testing refunds"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"span","attributes":{"class":"sub-header"},"children":["How to test refund webhooks in the sandbox."]}]},{"$$mdtype":"Tag","name":"hr","attributes":{},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use the simulation endpoints to test how your integration handles refunds, including Swift partial refunds, without initiating real-world financial transactions."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["When a transfer’s status becomes ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["funds_refunded"]},", Wise sends a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#refund"]}," webhook event to your subscribed URL."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Important!"},"children":[{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Even if funding moves the transfer to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["processing"]},", you must still call the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["/processing"]}," simulation step."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Simulation isn’t supported for email transfers."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"refund-behaviour-in-sandbox","__idx":1},"children":["Refund behaviour in sandbox"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["In production, refund amounts can differ by payout method. For example, Swift intermediary bank fees may reduce the amount returned, resulting in a partial refund. The sandbox simulates this to help you test your webhook handling."]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"width":"25%","data-label":"Transfer payout type"},"children":["Transfer payout type "]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Refund amount"},"children":["Refund amount"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Non-Swift transfer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Typically the full gross amount the customer paid for the transfer (including Wise fees)."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Swift transfer"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["A random percentage from 5–15% is deducted from the gross amount to simulate intermediary bank fees."]}]}]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"simulate-a-refund","__idx":2},"children":["Simulate a refund"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["To simulate a refund, you'll go throught the following steps in the sandbox environment (described in the sections below):"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a quote."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create a recipient."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Create and fund the transfer using your normal flow."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Subscribe to the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#refund"]}," event."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["Simulate the transfer state changes. The change of transfer state to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["funds_refunded"]}," triggers the webhook event notification."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-1-create-quote","__idx":3},"children":["Step 1: Create quote"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create an ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/product/send-money/quotes/authenticated-quote"},"children":["athenticated quote"]}," for the transfer."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["To test ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Swift partial refunds"]},", set ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["payOut"]}," to ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["SWIFT"]}," when creating the quote. See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/product/send-money/swift-network-transfers"},"children":["Swift network transfers guide"]}," for more details."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-request","__idx":4},"children":["Example request"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"quoteCreate","parameters":{"path":{"profileId":101}},"requestBody":{"sourceCurrency":"USD","targetCurrency":"EUR","sourceAmount":1000,"targetAccount":null,"payOut":"SWIFT"},"environments":{},"codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  https://api.wise.com/2026Q4/profiles/101/quotes \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479' \\\n  -d '{\n    \"sourceCurrency\": \"USD\",\n    \"targetCurrency\": \"EUR\",\n    \"sourceAmount\": 1000,\n    \"targetAccount\": null,\n    \"payOut\": \"SWIFT\"\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const profileId = '101';\nconst resp = await fetch(\n  `https://api.wise.com/2026Q4/profiles/${profileId}/quotes`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'X-External-Correlation-Id': 'f47ac10b-58cc-4372-a567-0e02b2c3d479',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    },\n    body: JSON.stringify({\n      sourceCurrency: 'USD',\n      targetCurrency: 'EUR',\n      sourceAmount: 1000,\n      targetAccount: null,\n      payOut: 'SWIFT'\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const profileId = '101';\n  const resp = await fetch(\n    `https://api.wise.com/2026Q4/profiles/${profileId}/quotes`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'X-External-Correlation-Id': 'f47ac10b-58cc-4372-a567-0e02b2c3d479',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      },\n      body: JSON.stringify({\n        sourceCurrency: 'USD',\n        targetCurrency: 'EUR',\n        sourceAmount: 1000,\n        targetAccount: null,\n        payOut: 'SWIFT'\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\nprofile_id = \"101\"\nurl = \"https://api.wise.com/2026Q4/profiles/\" + profile_id + \"/quotes\"\n\npayload = {\n  \"sourceCurrency\": \"USD\",\n  \"targetCurrency\": \"EUR\",\n  \"sourceAmount\": 1000,\n  \"targetAccount\": None,\n  \"payOut\": \"SWIFT\"\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"X-External-Correlation-Id\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"sourceCurrency\\\": \\\"USD\\\",\"\n      , \" \\\"targetCurrency\\\": \\\"EUR\\\",\"\n      , \" \\\"sourceAmount\\\": 1000,\"\n      , \" \\\"targetAccount\\\": null,\"\n      , \" \\\"payOut\\\": \\\"SWIFT\\\"\"\n      , \"}\"\n    );\n\n    var host = \"https://api.wise.com\";\n    var profileId = \"101\";\n    var pathname = \"/2026Q4/profiles/%7BprofileId%7D/quotes\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"X-External-Correlation-Id\", \"f47ac10b-58cc-4372-a567-0e02b2c3d479\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"X-External-Correlation-Id\", \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"},\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      sourceCurrency = \"USD\",\n      targetCurrency = \"EUR\",\n      sourceAmount = \"1000\",\n      targetAccount = \"null\",\n      payOut = \"SWIFT\"\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n      var ProfileId = \"101\";\n    using HttpResponseMessage request = await client.PostAsync(\"https://api.wise.com/2026Q4/profiles/\" + ProfileId + \"/quotes\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst profileId = \"101\";\n$curl = curl_init();\n\n$payload = array(\n  \"sourceCurrency\" => \"USD\",\n  \"targetCurrency\" => \"EUR\",\n  \"sourceAmount\" => 1000,\n  \"targetAccount\" => NULL,\n  \"payOut\" => \"SWIFT\"\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\",\n    \"Content-Type: application/json\",\n    \"X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://api.wise.com/2026Q4/profiles/\" . profileId . \"/quotes\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  profileId := \"101\";\n  reqUrl := \"https://api.wise.com/2026Q4/profiles/\" + profileId + \"/quotes\"\n  var data = []byte(`{\n    \"sourceCurrency\": \"USD\",\n    \"targetCurrency\": \"EUR\",\n    \"sourceAmount\": 1000,\n    \"targetAccount\": null,\n    \"payOut\": \"SWIFT\"\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"X-External-Correlation-Id\", \"f47ac10b-58cc-4372-a567-0e02b2c3d479\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nprofile_id = '101'\nurl = URI('https://api.wise.com/2026Q4/profiles/' + profile_id + '/quotes')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['X-External-Correlation-Id'] = 'f47ac10b-58cc-4372-a567-0e02b2c3d479'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\nrequest.body = {\n  sourceCurrency: 'USD',\n  targetCurrency: 'EUR',\n  sourceAmount: 1000,\n  targetAccount: nil,\n  payOut: 'SWIFT'\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"sourceCurrency\": \"USD\",\n   \"targetCurrency\": \"EUR\",\n   \"sourceAmount\": 1000,\n   \"targetAccount\": null,\n   \"payOut\": \"SWIFT\"\n}'\n\nprofile_id = \"101\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://api.wise.com/2026Q4/profiles/\" %&% profile_id %&% \"/quotes\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"X-External-Correlation-Id\" = \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"sourceCurrency\": \"GBP\",\n  \"targetCurrency\": \"USD\",\n  \"sourceAmount\": 100,\n  \"targetAmount\": null,\n  \"targetAccount\": 12345,\n  \"payOut\": null,\n  \"preferredPayIn\": null,\n  \"paymentMetadata\": {\n    \"transferNature\": \"MOVING_MONEY_BETWEEN_OWN_ACCOUNTS\"\n  },\n  \"pricingConfiguration\": {\n    \"fee\": {\n      \"type\": \"OVERRIDE\",\n      \"variable\": 0.011,\n      \"fixed\": 15.42\n    }\n  }\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-2-create-recipient","__idx":5},"children":["Step 2: Create recipient"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/recipient/recipientcreate"},"children":["Create a recipient account"]}," for the transfer."]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["For Swift, use recipient/account details that route via Swift as described in the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/product/send-money/swift-network-transfers"},"children":["Swift network transfers guide"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":["If the recipient doesn’t support Swift for your currency/route, the quote changes to a non-Swift payout method when you update it with the recipient."]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-3-create-and-fund-transfer","__idx":6},"children":["Step 3: Create and fund transfer"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create the transfer using the quote and recipient, then fund it using your normal funding flow."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/guides/product/send-money/use-cases/correspondent/send-money"},"children":["Send money guide"]}," for instructions on creating transfers."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-4-create-application-webhook-subscription","__idx":7},"children":["Step 4: Create application webhook subscription"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create an ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/webhook/webhookapplicationsubscriptioncreate"},"children":["application webhook subscription"]}," for ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#refund"]}," using a ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["client credentials token"]},"."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Endpoint: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["POST /v3/applications/{clientKey}/subscriptions"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-request-1","__idx":8},"children":["Example request"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"webhookApplicationSubscriptionCreate","parameters":{},"requestBody":{"name":"Sandbox transfers refund subscription","trigger_on":"transfers#refund","delivery":{"version":"4.0.0","url":"https://example.com/webhooks/wise"}},"environments":{},"environment":"https://api.wise-sandbox.com","codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X POST \\\n  'https://api.wise.com/2026Q4/applications/{clientKey}/subscriptions' \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'Content-Type: application/json' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479' \\\n  -d '{\n    \"name\": \"Sandbox transfers refund subscription\",\n    \"trigger_on\": \"transfers#refund\",\n    \"delivery\": {\n      \"version\": \"4.0.0\",\n      \"url\": \"https://example.com/webhooks/wise\"\n    }\n  }'"},{"lang":"javascript","title":"JavaScript","source":"const clientKey = 'YOUR_clientKey_PARAMETER';\nconst resp = await fetch(\n  `https://api.wise.com/2026Q4/applications/${clientKey}/subscriptions`,\n  {\n    method: 'POST',\n    headers: {\n      'Content-Type': 'application/json',\n      'X-External-Correlation-Id': 'f47ac10b-58cc-4372-a567-0e02b2c3d479',\n      Authorization: 'Bearer <YOUR_JWT_HERE>'\n    },\n    body: JSON.stringify({\n      name: 'Sandbox transfers refund subscription',\n      trigger_on: 'transfers#refund',\n      delivery: {\n        version: '4.0.0',\n        url: 'https://example.com/webhooks/wise'\n      }\n    })\n  }\n);\n\nconst data = await resp.json();\nconsole.log(data);"},{"lang":"javascript","title":"Node.js","source":"import fetch from 'node-fetch';\n\nasync function run() {\n  const clientKey = 'YOUR_clientKey_PARAMETER';\n  const resp = await fetch(\n    `https://api.wise.com/2026Q4/applications/${clientKey}/subscriptions`,\n    {\n      method: 'POST',\n      headers: {\n        'Content-Type': 'application/json',\n        'X-External-Correlation-Id': 'f47ac10b-58cc-4372-a567-0e02b2c3d479',\n        Authorization: 'Bearer <YOUR_JWT_HERE>'\n      },\n      body: JSON.stringify({\n        name: 'Sandbox transfers refund subscription',\n        trigger_on: 'transfers#refund',\n        delivery: {\n          version: '4.0.0',\n          url: 'https://example.com/webhooks/wise'\n        }\n      })\n    }\n  );\n\n  const data = await resp.json();\n  console.log(data);\n}\n\nrun();"},{"lang":"python","title":"Python","source":"import requests\n\nclient_key = \"YOUR_clientKey_PARAMETER\"\nurl = \"https://api.wise.com/2026Q4/applications/\" + client_key + \"/subscriptions\"\n\npayload = {\n  \"name\": \"Sandbox transfers refund subscription\",\n  \"trigger_on\": \"transfers#refund\",\n  \"delivery\": {\n    \"version\": \"4.0.0\",\n    \"url\": \"https://example.com/webhooks/wise\"\n  }\n}\n\nheaders = {\n  \"Content-Type\": \"application/json\",\n  \"X-External-Correlation-Id\": \"f47ac10b-58cc-4372-a567-0e02b2c3d479\",\n  \"Authorization\": \"Bearer <YOUR_JWT_HERE>\"\n}\n\nresponse = requests.post(url, json=payload, headers=headers)\n\ndata = response.json()\nprint(data)"},{"lang":"java","title":"Java","source":"import java.net.*;\nimport java.net.http.*;\nimport java.util.*;\n\npublic class App {\n  public static void main(String[] args) throws Exception {\n    var httpClient = HttpClient.newBuilder().build();\n\n    var payload = String.join(\"\\n\"\n      , \"{\"\n      , \" \\\"name\\\": \\\"Sandbox transfers refund subscription\\\",\"\n      , \" \\\"trigger_on\\\": \\\"transfers#refund\\\",\"\n      , \" \\\"delivery\\\": {\"\n      , \"  \\\"version\\\": \\\"4.0.0\\\",\"\n      , \"  \\\"url\\\": \\\"https://example.com/webhooks/wise\\\"\"\n      , \" }\"\n      , \"}\"\n    );\n\n    var host = \"https://api.wise.com\";\n    var clientKey = \"YOUR_clientKey_PARAMETER\";\n    var pathname = \"/2026Q4/applications/%7BclientKey%7D/subscriptions\";\n    var request = HttpRequest.newBuilder()\n      .POST(HttpRequest.BodyPublishers.ofString(payload))\n      .uri(URI.create(host + pathname ))\n      .header(\"Content-Type\", \"application/json\")\n      .header(\"X-External-Correlation-Id\", \"f47ac10b-58cc-4372-a567-0e02b2c3d479\")\n      .header(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n      .build();\n\n    var response = httpClient.send(request, HttpResponse.BodyHandlers.ofString());\n\n    System.out.println(response.body());\n  }\n}"},{"lang":"csharp","title":"C#","source":"using System;\nusing System.Net.Http;\nusing System.Threading.Tasks;\nusing System.Text;\nusing System.Text.Json;\n\npublic class Program\n{\n  public static async Task Main()\n  {\n    System.Net.Http.HttpClient client = new()\n    {\n      DefaultRequestHeaders =\n      {\n        {\"X-External-Correlation-Id\", \"f47ac10b-58cc-4372-a567-0e02b2c3d479\"},\n        {\"Authorization\", \"Bearer <YOUR_JWT_HERE>\"},\n      }\n    };\n\n    string json = JsonSerializer.Serialize(new\n    {\n      name = \"Sandbox transfers refund subscription\",\n      trigger_on = \"transfers#refund\",\n      delivery = new {\n        version = \"4.0.0\",\n        url = \"https://example.com/webhooks/wise\"\n      }\n    });\n\n    using StringContent postData = new(json, Encoding.UTF8, \"application/json\");\n      var ClientKey = \"YOUR_clientKey_PARAMETER\";\n    using HttpResponseMessage request = await client.PostAsync(\"https://api.wise.com/2026Q4/applications/\" + ClientKey + \"/subscriptions\", postData);\n    string response = await request.Content.ReadAsStringAsync();\n\n    Console.WriteLine(response);\n  }\n}"},{"lang":"php","title":"PHP","source":"/**\n * Requires libcurl\n */\n\nconst clientKey = \"YOUR_clientKey_PARAMETER\";\n$curl = curl_init();\n\n$payload = array(\n  \"name\" => \"Sandbox transfers refund subscription\",\n  \"trigger_on\" => \"transfers#refund\",\n  \"delivery\" => array(\n    \"version\" => \"4.0.0\",\n    \"url\" => \"https://example.com/webhooks/wise\"\n  )\n);\n\ncurl_setopt_array($curl, [\n  CURLOPT_HTTPHEADER => [\n    \"Authorization: Bearer <YOUR_JWT_HERE>\",\n    \"Content-Type: application/json\",\n    \"X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479\"\n  ],\n  CURLOPT_POSTFIELDS => json_encode($payload),\n  CURLOPT_URL => \"https://api.wise.com/2026Q4/applications/\" . clientKey . \"/subscriptions\",\n  CURLOPT_RETURNTRANSFER => true,\n  CURLOPT_CUSTOMREQUEST => \"POST\",\n]);\n\n$response = curl_exec($curl);\n$error = curl_error($curl);\n\ncurl_close($curl);\n\nif ($error) {\n  echo \"cURL Error #:\" . $error;\n} else {\n  echo $response;\n}"},{"lang":"go","title":"Go","source":"package main\n\nimport (\n  \"fmt\"\n  \"bytes\"\n  \"net/http\"\n  \"io/ioutil\"\n)\n\nfunc main() {\n  clientKey := \"YOUR_clientKey_PARAMETER\";\n  reqUrl := \"https://api.wise.com/2026Q4/applications/\" + clientKey + \"/subscriptions\"\n  var data = []byte(`{\n    \"name\": \"Sandbox transfers refund subscription\",\n    \"trigger_on\": \"transfers#refund\",\n    \"delivery\": {\n      \"version\": \"4.0.0\",\n      \"url\": \"https://example.com/webhooks/wise\"\n    }\n  }`)\n  req, err := http.NewRequest(\"POST\", reqUrl, bytes.NewBuffer(data))\n  if err != nil {\n    panic(err)\n  }\n  req.Header.Add(\"Content-Type\", \"application/json\")\n  req.Header.Add(\"X-External-Correlation-Id\", \"f47ac10b-58cc-4372-a567-0e02b2c3d479\")\n  req.Header.Add(\"Authorization\", \"Bearer <YOUR_JWT_HERE>\")\n  res, err := http.DefaultClient.Do(req)\n  if err != nil {\n    panic(err)\n  }\n  defer res.Body.Close()\n  body, err := ioutil.ReadAll(res.Body)\n  if err != nil {\n    panic(err)\n  }\n\n  fmt.Println(res)\n  fmt.Println(string(body))\n}"},{"lang":"ruby","title":"Ruby","source":"require 'json'\nrequire 'uri'\nrequire 'net/http'\nrequire 'openssl'\n\nclient_key = 'YOUR_clientKey_PARAMETER'\nurl = URI('https://api.wise.com/2026Q4/applications/' + client_key + '/subscriptions')\n\nhttp = Net::HTTP.new(url.host, url.port)\nhttp.use_ssl = true\n\nrequest = Net::HTTP::Post.new(url)\nrequest['Content-Type'] = 'application/json'\nrequest['X-External-Correlation-Id'] = 'f47ac10b-58cc-4372-a567-0e02b2c3d479'\nrequest['Authorization'] = 'Bearer <YOUR_JWT_HERE>'\nrequest.body = {\n  name: 'Sandbox transfers refund subscription',\n  trigger_on: 'transfers#refund',\n  delivery: {\n    version: '4.0.0',\n    url: 'https://example.com/webhooks/wise'\n  }\n}.to_json\n\nresponse = http.request(request)\nputs response.read_body\n"},{"lang":"r","title":"R","source":"library(httr)\n\nbody = '{\n   \"name\": \"Sandbox transfers refund subscription\",\n   \"trigger_on\": \"transfers#refund\",\n   \"delivery\": {\n    \"version\": \"4.0.0\",\n    \"url\": \"https://example.com/webhooks/wise\"\n   }\n}'\n\nclient_key = \"YOUR_clientKey_PARAMETER\"\n\n# create you own operator\n\"%&%\" <- function(x, y)paste0(x,y)\n\nurl = \"https://api.wise.com/2026Q4/applications/\" %&% client_key %&% \"/subscriptions\"\n\ndata_req <- POST(\n  url,\n  add_headers(\"Content-Type\" = \"application/json\", \"X-External-Correlation-Id\" = \"f47ac10b-58cc-4372-a567-0e02b2c3d479\", \"Authorization\" = \"Bearer <YOUR_JWT_HERE>\"),\n  body = body,\n  encode = \"json\",\n  verbose()\n)\n\ncontent(data_req)"},{"lang":"json","title":"Payload application/json","source":"{\n  \"name\": \"Webhook Subscription #1\",\n  \"trigger_on\": \"transfers#state-change\",\n  \"delivery\": {\n    \"version\": \"4.0.0\",\n    \"url\": \"https://your.webhook.url/12345\"\n  }\n}"}]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-5-simulate-transfer-state-changes","__idx":9},"children":["Step 5: Simulate transfer state changes"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Use ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/simulation/simulationtransferstatechange"},"children":["Simulate transfer state change"]}," to move the transfer through states ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["in this order"]},":"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["processing"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["funds_converted"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["outgoing_payment_sent"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["bounced_back"]}," → ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["funds_refunded"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Endpoint: ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["GET /v1/simulation/transfers/{transferId}/{status}"]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-requests","__idx":10},"children":["Example requests"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Processing"]},":"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"simulationTransferStateChange","language":"curl","parameters":{"path":{"transferId":15574445,"status":"processing"}},"environments":{},"environment":"https://api.wise-sandbox.com","codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  https://api.wise.com/2026Q4/simulation/transfers/15574445/processing \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479'"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Funds converted"]},":"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"simulationTransferStateChange","language":"curl","parameters":{"path":{"transferId":15574445,"status":"funds_converted"}},"environments":{},"environment":"https://api.wise-sandbox.com","codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  https://api.wise.com/2026Q4/simulation/transfers/15574445/funds_converted \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479'"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Outgoing payment sent"]},":"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"simulationTransferStateChange","language":"curl","parameters":{"path":{"transferId":15574445,"status":"outgoing_payment_sent"}},"environments":{},"environment":"https://api.wise-sandbox.com","codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  https://api.wise.com/2026Q4/simulation/transfers/15574445/outgoing_payment_sent \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479'"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Bounced back"]},":"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"simulationTransferStateChange","language":"curl","parameters":{"path":{"transferId":15574445,"status":"bounced_back"}},"environments":{},"environment":"https://api.wise-sandbox.com","codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  https://api.wise.com/2026Q4/simulation/transfers/15574445/bounced_back \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479'"}]},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Fund refunded"]},":"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"simulationTransferStateChange","language":"curl","parameters":{"path":{"transferId":15574445,"status":"funds_refunded"}},"environments":{},"environment":"https://api.wise-sandbox.com","codeSamplesResolved":[{"lang":"shell","title":"curl","source":"curl -i -X GET \\\n  https://api.wise.com/2026Q4/simulation/transfers/15574445/funds_refunded \\\n  -H 'Authorization: Bearer <YOUR_JWT_HERE>' \\\n  -H 'X-External-Correlation-Id: f47ac10b-58cc-4372-a567-0e02b2c3d479'"}]},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"step-6-receive-and-verify-webhook","__idx":11},"children":["Step 6: Receive and verify webhook"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["After you simulate ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["funds_refunded"]},", Wise sends a ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#refund"]}," webhook payload to your subscribed endpoint."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["The webhook includes:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.resource.refund_amount"]}," — amount returned to the sender"]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["data.resource.refund_currency"]}," — currency of the refund"]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/webhook-event/eventtransfersrefund"},"children":["transfers#refund"]}," api reference for more details about the event."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":4,"id":"example-webhook-payload","__idx":12},"children":["Example webhook payload"]},{"$$mdtype":"Tag","name":"OpenApiCodeSample","attributes":{"descriptionFile":"api-docs-api-reference/@latest/index.yaml","operationId":"eventTransfersRefund","language":"Payload","parameters":{},"environments":{}},"children":[]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["See the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/webhook-event/eventtransfersrefund"},"children":["event type reference"]}," for more details about the ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["transfers#refund"]}," webhook."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"sandbox-limitations","__idx":13},"children":["Sandbox limitations"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Webhook-only simulation"]},": The simulated refund amount applies only to the webhook payload."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Not suitable for reconciliation"]},": Account balances and the sandbox UI can reflect different values (for example, a full refund), regardless of payout method. Don’t reconcile sandbox webhooks to balances/statements."]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["For more details, see the ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/api-reference/simulation/simulationtransferstatechange#sandbox-refund"},"children":["Simulate transfer state change"]}," endpoint."]}]},"headings":[{"value":"Testing refunds","id":"testing-refunds","depth":1},{"value":"Refund behaviour in sandbox","id":"refund-behaviour-in-sandbox","depth":2},{"value":"Simulate a refund","id":"simulate-a-refund","depth":2},{"value":"Step 1: Create quote","id":"step-1-create-quote","depth":3},{"value":"Example request","id":"example-request","depth":4},{"value":"Step 2: Create recipient","id":"step-2-create-recipient","depth":3},{"value":"Step 3: Create and fund transfer","id":"step-3-create-and-fund-transfer","depth":3},{"value":"Step 4: Create application webhook subscription","id":"step-4-create-application-webhook-subscription","depth":3},{"value":"Example request","id":"example-request-1","depth":4},{"value":"Step 5: Simulate transfer state changes","id":"step-5-simulate-transfer-state-changes","depth":3},{"value":"Example requests","id":"example-requests","depth":4},{"value":"Step 6: Receive and verify webhook","id":"step-6-receive-and-verify-webhook","depth":3},{"value":"Example webhook payload","id":"example-webhook-payload","depth":4},{"value":"Sandbox limitations","id":"sandbox-limitations","depth":2}],"frontmatter":{"seo":{"description":"Simulate refunds in Sandbox to test the transfers#refund webhook end-to-end, including Swift partial refund scenarios.","title":"Testing refunds"},"keywords":["Refunds","Webhooks","Sandbox","Simulation","transfers#refund","Swift"],"markdown":{"toc":{"depth":3}}},"lastModified":"2026-09-16T07:03:08.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/guides/product/send-money/refunds/testing-refunds","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}