---
title: Refund
slug: refund
createdAt: 2023-09-22T04:49:16.512Z
---

:::ApiMethodV2
```json
{
  "name": "Refund",
  "method": "POST",
  "url": "Your endpoint here",
  "description": "",
  "tab": "examples",
  "examples": {
    "languages": [
      {
        "id": "R4FHWSin1ZEx96VUw4umL",
        "language": "json",
        "code": "{\n      \"share_public\": \"string\",\n      \"read_event\": \"string\",\n      \"source_id\": \"string\",\n      \"destination_id\": \"string\",\n      \"token_id\": \"string\",\n      \"transaction_id\": \"string\",\n      \"refund_amount\": \"string\",\n      \"token_balance\": \"string\"\n}",
        "customLabel": ""
      },
      {
        "id": "mjUumtIxSbuMmSP6r9hUU",
        "language": "curl",
        "code": "curl --location --request POST '' \\\n--header 'Accept: application/json' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"share_public\":\"string\",\"read_event\":\"string\",\"source_id\":\"string\",\"destination_id\":\"string\",\"token_id\":\"string\",\"transaction_id\":\"string\",\"refund_amount\":\"string\",\"token_balance\":\"string\"}'",
        "customLabel": ""
      },
      {
        "id": "jqXG7g8St8yUHacK9MdGl",
        "language": "nodejs",
        "code": "var request = require('request');\nvar options = {\n   'method': 'POST',\n   'url': '',\n   'headers': {\n      'Accept': 'application/json',\n      'Content-Type': 'application/json'\n   },\n   body: JSON.stringify({\n      \"share_public\": \"string\",\n      \"read_event\": \"string\",\n      \"source_id\": \"string\",\n      \"destination_id\": \"string\",\n      \"token_id\": \"string\",\n      \"transaction_id\": \"string\",\n      \"refund_amount\": \"string\",\n      \"token_balance\": \"string\"\n   })\n\n};\nrequest(options, function (error, response) {\n   if (error) throw new Error(error);\n   console.log(response.body);\n});\n",
        "customLabel": ""
      },
      {
        "id": "qbHTH4MGuLUQp7GoT1-q-",
        "language": "javascript",
        "code": "var myHeaders = new Headers();\nmyHeaders.append(\"Accept\", \"application/json\");\nmyHeaders.append(\"Content-Type\", \"application/json\");\n\nvar raw = JSON.stringify({\n   \"share_public\": \"string\",\n   \"read_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"token_id\": \"string\",\n   \"transaction_id\": \"string\",\n   \"refund_amount\": \"string\",\n   \"token_balance\": \"string\"\n});\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   body: raw,\n   redirect: 'follow'\n};\n\nfetch(\"\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));",
        "customLabel": ""
      },
      {
        "id": "s_E9osXPmVR0eq3JwH9yJ",
        "language": "python",
        "code": "import requests\nimport json\n\nurl = \"\"\n\npayload = json.dumps({\n   \"share_public\": \"string\",\n   \"read_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"token_id\": \"string\",\n   \"transaction_id\": \"string\",\n   \"refund_amount\": \"string\",\n   \"token_balance\": \"string\"\n})\nheaders = {\n   'Accept': 'application/json',\n   'Content-Type': 'application/json'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n",
        "customLabel": ""
      },
      {
        "id": "IW2Mipp88VJFco2uITGim",
        "language": "ruby",
        "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"\")\n\nhttp = Net::HTTP.new(url.host, url.port);\nrequest = Net::HTTP::Post.new(url)\nrequest[\"Accept\"] = \"application/json\"\nrequest[\"Content-Type\"] = \"application/json\"\nrequest.body = JSON.dump({\n   \"share_public\": \"string\",\n   \"read_event\": \"string\",\n   \"source_id\": \"string\",\n   \"destination_id\": \"string\",\n   \"token_id\": \"string\",\n   \"transaction_id\": \"string\",\n   \"refund_amount\": \"string\",\n   \"token_balance\": \"string\"\n})\n\nresponse = http.request(request)\nputs response.read_body\n",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "R4FHWSin1ZEx96VUw4umL"
  },
  "results": {
    "languages": [
      {
        "id": "0MENzhUDCKlDaSsrqwEZx",
        "language": "200",
        "customLabel": "",
        "code": "{\n   \"success\": true,\n   \"message\": \"Success\",\n}\n"
      },
      {
        "id": "DdjSl11sZsRnnc1wdB4bO",
        "language": "413",
        "customLabel": "",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"413\",\n    \"message\": \"Destination ID Unknown\"\n  }\n}"
      },
      {
        "id": "aCMS4hwkcm9Dnswx8AzFH",
        "language": "428",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"428\",\n    \"message\": \"Token ID doesn't match\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "mU74fja-Do2U9xM4y5S6N",
        "language": "500",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"500\",\n    \"message\": \"internal Server Error\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "H07xXW_12wO7qM00KXd1N",
        "language": "502",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"502\",\n    \"message\": \"Bad Gateway\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "_OKzznvtmg2JlQpe2EG5D",
        "language": "503",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"503\",\n    \"message\": \"Service Unavailable\"\n  }\n}",
        "customLabel": ""
      },
      {
        "id": "m3w8CTrshGe8eWIRhKaFk",
        "language": "504",
        "code": "{\n  \"success\": \"false\",\n  \"errors\": {\n    \"code\": \"504\",\n    \"message\": \"Gateway Timeout\"\n  }\n}",
        "customLabel": ""
      }
    ],
    "selectedLanguageId": "0MENzhUDCKlDaSsrqwEZx"
  },
  "request": {
    "pathParameters": [],
    "queryParameters": [],
    "headerParameters": [],
    "bodyDataParameters": [
      {
        "name": "share_public",
        "kind": "required",
        "type": "string",
        "description": "Public keys are accessible in your PayDocker account under integration menu.",
        "children": []
      },
      {
        "name": "read_event",
        "kind": "required",
        "type": "string",
        "description": "A condition to allow execution of the action that is connected to the token. The condition would be \"token.refund_available\".",
        "children": []
      },
      {
        "name": "source_id",
        "kind": "required",
        "type": "string",
        "description": "Your PayDocker Account ID assigned upon account creation (e.g. PDR1). It is case sensitive.",
        "children": []
      },
      {
        "name": "destination_id",
        "kind": "required",
        "type": "string",
        "description": "Property ID (e.g. ID 001) generated in your platform. It represents the token recipient.",
        "children": []
      },
      {
        "name": "token_id",
        "kind": "required",
        "type": "string",
        "description": "The unique identifier associated with the token that the user is requesting a modification for. (e.g. 2908926013012565)",
        "children": []
      },
      {
        "name": "transaction_id",
        "kind": "required",
        "type": "string",
        "description": "A unique identifier comprising of 20 digits generated by PayDocker upon a successful modification of token.",
        "children": []
      },
      {
        "name": "refund_amount",
        "kind": "required",
        "type": "string",
        "description": "The sum that had been collected by the recipient but subsequently requested for return by the sender, subjected to the maximum balance amount in the recipient's account. \n\nThe amount value supports up to twelve digits (e.g. a value of 9,999,999,999.99) divided by decimal.",
        "children": []
      },
      {
        "name": "token_balance",
        "kind": "required",
        "type": "string",
        "description": "The sum that is available in the token. ",
        "children": []
      }
    ],
    "formDataParameters": []
  },
  "currentNewParameter": {
    "label": "Body Parameter",
    "value": "bodyDataParameters"
  }
}
```
:::

