---
title: Refund a payment
slug: reference/refund-a-payment
docTags: 
createdAt: 2026-08-23T06:01:06.452Z
---

{
  "id": "yRmO4w134ZPOukrVK403d",
  "type": "api-oas-v2",
  "data": {
    "method": "POST",
    "url": "/api/payments/{id}/refunds",
    "servers": [],
    "name": "Refund a payment",
    "description": "",
    "contentType": "application/json",
    "request": {
      "pathParameters": [
        {
          "kind": "required",
          "name": "id",
          "type": "string",
          "description": "<p>Identifier of the payment to refund (the payment ID returned when the payment was created)</p>"
        }
      ],
      "headerParameters": [
        {
          "name": "accept",
          "type": "string",
          "kind": "optional",
          "description": "Generated from available response content types",
          "enum": [
            "application/json"
          ],
          "default": "application/json"
        },
        {
          "kind": "required",
          "name": "Idempotency-Key",
          "type": "string",
          "description": "<p>Client-supplied key to safely retry the request without duplicating the operation.</p>"
        }
      ],
      "queryParameters": [],
      "bodyDataParameters": [
        {
          "kind": "required",
          "name": "body",
          "type": "object",
          "description": "Create a refund request body",
          "customType": "CreateRefundBodyDTO",
          "schema": [
            {
              "name": "amount",
              "kind": "optional",
              "type": "number",
              "description": "<p>Amount in lowest denomination of the currency (e.g., cents for USD, pence for GBP). If not provided, defaults to the full payment amount.</p>",
              "example": 1357,
              "minimum": 1
            },
            {
              "name": "reason",
              "kind": "optional",
              "type": "string<duplicate | fraudulent | requested_by_customer | other>",
              "description": "Reason for payment refund",
              "example": "duplicate",
              "enum": [
                "duplicate",
                "fraudulent",
                "requested_by_customer",
                "other"
              ]
            },
            {
              "name": "chargeId",
              "kind": "optional",
              "type": "string",
              "description": "<p>Processor charge id to refund, as returned by capture in processor.chargeId. A refund is issued against one capture, so name it when the payment was captured more than once. Defaults to the most recent capture.</p>",
              "example": "ch_xyz789"
            }
          ],
          "modelRef": "#/components/schemas/CreateRefundBodyDTO",
          "isExpanded": true
        }
      ],
      "formDataParameters": [],
      "oAuthParameters": [],
      "cookieParameters": []
    },
    "responses": [
      {
        "statusCode": "201",
        "description": "Refund created",
        "jsonExample": "",
        "isExpanded": true,
        "schema": [
          {
            "kind": "optional",
            "type": "object",
            "description": "Refund details",
            "customType": "RefundResponseDTO",
            "schema": [
              {
                "name": "id",
                "kind": "required",
                "type": "string",
                "description": "Unique identifier for the refund"
              },
              {
                "name": "amount",
                "kind": "required",
                "type": "number",
                "description": "Amount of the refund in the lowest denomination of the currency",
                "example": 1357
              },
              {
                "name": "currency",
                "kind": "required",
                "type": "string<AED | ALL | AMD | ANG | AOA | ARS | AUD | AWG | AZN | BAM | BBD | BDT | BGN | BHD | BIF | BMD | BND | BOB | BRL | BSD | BWP | BYN | BZD | CAD | CHF | CLP | CNY | COP | CRC | CUP | CVE | CZK | DJF | DKK | DOP | DZD | EGP | ETB | EUR | FJD | FKP | GBP | GEL | GHS | GIP | GMD | GNF | GTQ | GYD | HKD | HNL | HRK | HTG | HUF | IDR | ILS | INR | IQD | JMD | JOD | JPY | KES | KGS | KHR | KMF | KRW | KWD | KYD | KZT | LAK | LBP | LKR | LRD | LSL | LYD | MAD | MDL | MGA | MKD | MMK | MNT | MOP | MRU | MUR | MVR | MWK | MXN | MYR | MZN | NAD | NGN | NIO | NOK | NPR | NZD | OMR | PAB | PEN | PGK | PHP | PKR | PLN | PYG | QAR | RON | RSD | RUB | RWF | SAR | SBD | SCR | SEK | SGD | SHP | SLE | SLL | SOS | SRD | SSP | STN | SVC | SZL | THB | TND | TOP | TRY | TTD | TWD | TZS | UAH | UGX | USD | UYU | UZS | VES | VND | VUV | WST | XAF | XCD | XOF | XPF | YER | ZAR | ZMW>",
                "description": "<p>Currency code for the refund, e.g., USD, EUR</p>",
                "example": "GBP",
                "enum": [
                  "AED",
                  "ALL",
                  "AMD",
                  "ANG",
                  "AOA",
                  "ARS",
                  "AUD",
                  "AWG",
                  "AZN",
                  "BAM",
                  "BBD",
                  "BDT",
                  "BGN",
                  "BHD",
                  "BIF",
                  "BMD",
                  "BND",
                  "BOB",
                  "BRL",
                  "BSD",
                  "BWP",
                  "BYN",
                  "BZD",
                  "CAD",
                  "CHF",
                  "CLP",
                  "CNY",
                  "COP",
                  "CRC",
                  "CUP",
                  "CVE",
                  "CZK",
                  "DJF",
                  "DKK",
                  "DOP",
                  "DZD",
                  "EGP",
                  "ETB",
                  "EUR",
                  "FJD",
                  "FKP",
                  "GBP",
                  "GEL",
                  "GHS",
                  "GIP",
                  "GMD",
                  "GNF",
                  "GTQ",
                  "GYD",
                  "HKD",
                  "HNL",
                  "HRK",
                  "HTG",
                  "HUF",
                  "IDR",
                  "ILS",
                  "INR",
                  "IQD",
                  "JMD",
                  "JOD",
                  "JPY",
                  "KES",
                  "KGS",
                  "KHR",
                  "KMF",
                  "KRW",
                  "KWD",
                  "KYD",
                  "KZT",
                  "LAK",
                  "LBP",
                  "LKR",
                  "LRD",
                  "LSL",
                  "LYD",
                  "MAD",
                  "MDL",
                  "MGA",
                  "MKD",
                  "MMK",
                  "MNT",
                  "MOP",
                  "MRU",
                  "MUR",
                  "MVR",
                  "MWK",
                  "MXN",
                  "MYR",
                  "MZN",
                  "NAD",
                  "NGN",
                  "NIO",
                  "NOK",
                  "NPR",
                  "NZD",
                  "OMR",
                  "PAB",
                  "PEN",
                  "PGK",
                  "PHP",
                  "PKR",
                  "PLN",
                  "PYG",
                  "QAR",
                  "RON",
                  "RSD",
                  "RUB",
                  "RWF",
                  "SAR",
                  "SBD",
                  "SCR",
                  "SEK",
                  "SGD",
                  "SHP",
                  "SLE",
                  "SLL",
                  "SOS",
                  "SRD",
                  "SSP",
                  "STN",
                  "SVC",
                  "SZL",
                  "THB",
                  "TND",
                  "TOP",
                  "TRY",
                  "TTD",
                  "TWD",
                  "TZS",
                  "UAH",
                  "UGX",
                  "USD",
                  "UYU",
                  "UZS",
                  "VES",
                  "VND",
                  "VUV",
                  "WST",
                  "XAF",
                  "XCD",
                  "XOF",
                  "XPF",
                  "YER",
                  "ZAR",
                  "ZMW"
                ]
              },
              {
                "name": "status",
                "kind": "required",
                "type": "string<pending | succeeded | failed | voided>",
                "description": "Status of the refund",
                "example": "succeeded",
                "enum": [
                  "pending",
                  "succeeded",
                  "failed",
                  "voided"
                ]
              },
              {
                "name": "reason",
                "kind": "optional",
                "type": "string<duplicate | fraudulent | requested_by_customer | other>",
                "description": "Reason for payment refund",
                "example": "duplicate",
                "enum": [
                  "duplicate",
                  "fraudulent",
                  "requested_by_customer",
                  "other"
                ]
              },
              {
                "name": "processor",
                "kind": "optional",
                "type": "object",
                "description": "",
                "complexType": "allOf",
                "complexItems": [
                  {
                    "name": "ProcessorDTO",
                    "description": "",
                    "modelRef": "#/components/schemas/ProcessorDTO",
                    "schema": [
                      {
                        "name": "name",
                        "kind": "optional",
                        "type": "string<stripe | adyen | braintree | airwallex | connexpay | echo | fiserv>",
                        "description": "Processor used for the payment",
                        "enum": [
                          "stripe",
                          "adyen",
                          "braintree",
                          "airwallex",
                          "connexpay",
                          "echo",
                          "fiserv"
                        ]
                      },
                      {
                        "name": "transactionId",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Processor-assigned transaction id</p>",
                        "example": "pi_abc123"
                      },
                      {
                        "name": "chargeId",
                        "kind": "optional",
                        "type": "string",
                        "description": "<p>Processor-assigned charge id</p>",
                        "example": "ch_xyz789"
                      }
                    ]
                  }
                ],
                "schema": []
              },
              {
                "name": "createdAt",
                "kind": "optional",
                "type": "string<date-time>",
                "description": "<p>ISO 8601 formatted timestamp (e.g., 2025-07-14T12:34</p><div></div>.000Z)<p></p>",
                "example": "2025-07-14T12:34:56.000Z",
                "format": "date-time"
              }
            ],
            "modelRef": "#/components/schemas/RefundResponseDTO",
            "isExpanded": true
          }
        ]
      },
      {
        "statusCode": "400",
        "description": "Bad request",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "401",
        "description": "Unauthorized",
        "jsonExample": "",
        "isExpanded": true
      },
      {
        "statusCode": "404",
        "description": "Not found",
        "jsonExample": "",
        "isExpanded": true
      }
    ],
    "hasXCodeSamples": false,
    "examples": {
      "languages": [
        {
          "id": "k4RI4Wjy3d1uj9sD6n0vi",
          "language": "curl",
          "label": "cURL",
          "code": "curl --request POST \\\n     --url /api/payments/{id}/refunds \\\n     --header 'accept: application/json' \\\n     --header 'idempotency-key: string'"
        },
        {
          "id": "FVURvDM1SdqYeeGa1eAVg",
          "language": "javascript",
          "label": "javascript",
          "code": "var myHeaders = new Headers();\nmyHeaders.append(\"accept\", \"application/json\");\nmyHeaders.append(\"content-type\", \"application/json\");\nmyHeaders.append(\"idempotency-key\", \"string\");\n\nvar requestOptions = {\n   method: 'POST',\n   headers: myHeaders,\n   redirect: 'follow'\n};\n\nfetch(\"/api/payments/{id}/refunds\", requestOptions)\n   .then(response => response.text())\n   .then(result => console.log(result))\n   .catch(error => console.log('error', error));"
        },
        {
          "id": "xpGAoaii227RtMoQ5HSMN",
          "language": "ruby",
          "label": "Ruby",
          "code": "require \"uri\"\nrequire \"json\"\nrequire \"net/http\"\n\nurl = URI(\"/api/payments/{id}/refunds\")\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[\"idempotency-key\"] = \"string\"\n\nresponse = http.request(request)\nputs response.read_body\n"
        },
        {
          "id": "NTMtVPcfeYnRExM2G1dMm",
          "language": "python",
          "label": "Python",
          "code": "import requests\nimport json\n\nurl = \"/api/payments/{id}/refunds\"\n\npayload = {}\nheaders = {\n   'accept': 'application/json',\n   'content-type': 'application/json',\n   'idempotency-key': 'string'\n}\n\nresponse = requests.request(\"POST\", url, headers=headers, data=payload)\n\nprint(response.text)\n"
        }
      ],
      "selectedLanguageId": "k4RI4Wjy3d1uj9sD6n0vi"
    },
    "results": {
      "languages": [
        {
          "id": "dg7x1kDgCJHNrnpyWAPwi",
          "language": "201",
          "code": "// Refund created\n{\n  \"id\": \"\",\n  \"amount\": 1357,\n  \"currency\": \"GBP\",\n  \"status\": \"succeeded\",\n  \"reason\": \"duplicate\",\n  \"processor\": {},\n  \"createdAt\": \"2025-07-14T12:34:56.000Z\"\n}"
        },
        {
          "id": "eRY6EnmJOgYVq6nLvz9lh",
          "language": "400",
          "code": "// Bad request\n"
        },
        {
          "id": "2asYSitfYD_8akEnjuPH6",
          "language": "401",
          "code": "// Unauthorized\n"
        },
        {
          "id": "5EmSaFBtp0o6iAaFp_fh1",
          "language": "404",
          "code": "// Not found\n"
        }
      ],
      "selectedLanguageId": "dg7x1kDgCJHNrnpyWAPwi"
    }
  },
  "children": [
    {
      "text": ""
    }
  ]
}