---
updatedAt: 2026-07-30T10:10:46.000Z
agentTools:
  projectIndex: https://developer.peachpayments.com/llms.txt
---

# Refund

Refund a successful debit transaction. You can only refund [certain payment methods](https://developer.peachpayments.com/docs/pp-payment-methods).

For more information, see the [documentation](https://developer.peachpayments.com/docs/payments-api-flows#refund-flow), and for sample calls, see our [public Postman collection](https://www.postman.com/peachpayments/peach-payments-public-workspace/request/i97xsu8/payments-public?action=share&creator=20323380&ctx=documentation&active-environment=13324425-9345d747-fcdd-4a5c-83e4-6f637771b28b).


# OpenAPI definition

```json
{
  "openapi": "3.0.3",
  "info": {
    "version": "2.0.0",
    "title": "Payments API",
    "description": "The Payments API enables you to do a custom integration with Peach Payments and thereby support multiple payment methods.",
    "termsOfService": "https://swagger.io/terms/",
    "contact": {
      "name": "Peach Payments Support",
      "email": "support@peachpayments.com",
      "url": "https://support.peachpayments.com/support/home"
    },
    "license": {
      "name": "MIT",
      "url": "https://mit-license.org"
    }
  },
  "servers": [
    {
      "url": "https://testapi-v2.peachpayments.com",
      "description": "Sandbox testing environment."
    },
    {
      "url": "https://api-v2.peachpayments.com",
      "description": "Live production environment."
    }
  ],
  "paths": {
    "/payments/{uniqueId}": {
      "post": {
        "tags": [
          "Payment or refund"
        ],
        "summary": "Refund",
        "description": "Refund a successful debit transaction. You can only refund [certain payment methods](https://developer.peachpayments.com/docs/pp-payment-methods).\n\nFor more information, see the [documentation](https://developer.peachpayments.com/docs/payments-api-flows#refund-flow), and for sample calls, see our [public Postman collection](https://www.postman.com/peachpayments/peach-payments-public-workspace/request/i97xsu8/payments-public?action=share&creator=20323380&ctx=documentation&active-environment=13324425-9345d747-fcdd-4a5c-83e4-6f637771b28b).\n",
        "operationId": "refund",
        "parameters": [
          {
            "name": "uniqueId",
            "in": "path",
            "required": true,
            "description": "The Peach Payments unique ID of the original debit transaction.",
            "schema": {
              "$ref": "#/components/schemas/UniqueId"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RefundRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK.",
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "$ref": "#/components/schemas/RefundResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Refund200ErrorResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "description": "Bad request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error400Response"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "$ref": "#/components/responses/RefundErrorResponse"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "UserId": {
        "description": "Authentication userId.",
        "type": "string",
        "pattern": "^[0-9a-f]{32}$",
        "minLength": 32,
        "maxLength": 32,
        "example": "5fb5e392d6fa11ef9b3002f694e28f55"
      },
      "Password": {
        "description": "Authentication password.",
        "type": "string",
        "example": "OMydSc7ewVmEKPZCAj2WxHoik"
      },
      "EntityId": {
        "description": "Authentication entityId",
        "type": "string",
        "pattern": "^[0-9a-f]{32}$",
        "minLength": 32,
        "maxLength": 32,
        "example": "8ac7a4c894809722019482d1df62029d"
      },
      "Code": {
        "description": "The unique code that indicates the result status of the request.",
        "type": "string",
        "pattern": "^([0-9]{3}.[0-9]{3}.[0-9]{3})$",
        "minLength": 11,
        "maxLength": 11,
        "example": "800.100.152"
      },
      "Result": {
        "description": "The result object.",
        "type": "object",
        "required": [
          "code",
          "description"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/Code"
          },
          "description": {
            "type": "string",
            "example": "Request successfully processed."
          }
        }
      },
      "Timestamp": {
        "description": "The timestamp of the transaction.",
        "type": "string",
        "format": "date-time",
        "example": "2021-04-23T07:41:25.519947Z"
      },
      "UniqueId": {
        "description": "The unique transaction ID provided by Peach Payments.",
        "type": "string",
        "pattern": "^[0-9a-f]{32}$",
        "minLength": 32,
        "maxLength": 32,
        "example": "41a57893d4a44191be8cd410398464e6"
      },
      "PaymentType": {
        "description": "Payment type of the transaction. See the [payment methods documentation](https://developer.peachpayments.com/docs/pp-payment-methods#south-africa) for details on which payment methods support the RF payment type.",
        "type": "string",
        "enum": [
          "DB",
          "RF"
        ],
        "example": "DB"
      },
      "PaymentBrand": {
        "description": "The payment brand specifies the method of payment for the request.",
        "type": "string",
        "enum": [
          "PAYFLEX",
          "ZEROPAY",
          "1FORYOU",
          "MASTERPASS",
          "MPESA",
          "BLINKBYEMTEL",
          "MOBICRED",
          "CAPITECPAY",
          "PEACHEFT",
          "MCBJUICE",
          "RCS",
          "FLOAT",
          "HAPPYPAY",
          "MAUCAS",
          "MONEYBADGER",
          "PAYSHAP"
        ],
        "example": "PEACHEFT"
      },
      "Amount": {
        "description": "The payment request amount.",
        "type": "string",
        "pattern": "(?!0+$)(?!0+\\.00)^\\d{1,8}(\\.\\d{2})?$",
        "minLength": 1,
        "maxLength": 11,
        "example": "22.50"
      },
      "Currency": {
        "description": "The currency code of the payment request amount as defined by ISO-4217.",
        "type": "string",
        "format": "iso-4217",
        "pattern": "^[A-Z]{3}$",
        "minLength": 3,
        "maxLength": 3,
        "example": "ZAR"
      },
      "ResultDetails": {
        "description": "Additional details that can provide information about the status or result of the transaction.",
        "type": "object",
        "properties": {
          "ExtendedDescription": {
            "type": "string",
            "example": "Purchase Approved OK"
          },
          "AcquirerResponse": {
            "type": "string",
            "example": "Approved"
          },
          "UserDisplayMessage": {
            "type": "string",
            "example": "Message 16 - Your session was created."
          }
        }
      },
      "ConnectorTxID1": {
        "description": "The unique transaction identifier provided by the payment service provider.",
        "type": "string",
        "pattern": "^[\\S]{1,64}$",
        "minLength": 1,
        "maxLength": 64,
        "example": "8ac7a49f7921f2fd0179230196ec4bbe"
      },
      "CustomParameters": {
        "description": "A JSON object depicting custom information sent by the merchant. Echoed back in the response.",
        "type": "object"
      },
      "ParameterErrors": {
        "description": "Error details of the request parameters which failed validation.",
        "type": "array",
        "items": {
          "type": "object",
          "required": [
            "value",
            "name",
            "message"
          ],
          "properties": {
            "value": {
              "description": "The value of the parameter which failed validation. Can be any value - string, number, boolean, array, or object.",
              "nullable": true
            },
            "name": {
              "type": "string",
              "description": "The name of the parameter."
            },
            "message": {
              "type": "string",
              "description": "A message describing the error."
            }
          }
        },
        "example": [
          {
            "value": "null",
            "name": "authenticationValue",
            "message": "Payments API requires authenticationValue."
          }
        ]
      },
      "Error400Result": {
        "description": "Error result object describing the error code and parameter errors.",
        "type": "object",
        "required": [
          "code",
          "parameterErrors",
          "description"
        ],
        "properties": {
          "code": {
            "$ref": "#/components/schemas/Code"
          },
          "parameterErrors": {
            "$ref": "#/components/schemas/ParameterErrors"
          },
          "description": {
            "type": "string",
            "example": "Errors in the processed request."
          }
        }
      },
      "Error400Response": {
        "description": "Error object describing the 400 status code error.",
        "type": "object",
        "required": [
          "result",
          "timestamp"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/Error400Result"
          },
          "resultDetails": {
            "$ref": "#/components/schemas/ResultDetails"
          },
          "timestamp": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      },
      "ErrorResponse": {
        "description": "Error object describing the error.",
        "type": "object",
        "required": [
          "result",
          "timestamp"
        ],
        "properties": {
          "result": {
            "$ref": "#/components/schemas/Result"
          },
          "resultDetails": {
            "$ref": "#/components/schemas/ResultDetails"
          },
          "timestamp": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "id": {
            "$ref": "#/components/schemas/UniqueId"
          },
          "paymentType": {
            "$ref": "#/components/schemas/PaymentType"
          },
          "paymentBrand": {
            "$ref": "#/components/schemas/PaymentBrand"
          },
          "customParameters": {
            "$ref": "#/components/schemas/CustomParameters"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          }
        }
      },
      "Authentication": {
        "description": "Authenticate requests using the userId, password, and entityId.",
        "type": "object",
        "required": [
          "userId",
          "password",
          "entityId"
        ],
        "properties": {
          "userId": {
            "$ref": "#/components/schemas/UserId"
          },
          "password": {
            "$ref": "#/components/schemas/Password"
          },
          "entityId": {
            "$ref": "#/components/schemas/EntityId"
          }
        }
      },
      "RefundPaymentType": {
        "description": "Refund type of the transaction.",
        "type": "string",
        "enum": [
          "RF"
        ],
        "example": "RF"
      },
      "RefundRequest": {
        "type": "object",
        "description": "Refund a successful debit transaction.",
        "required": [
          "authentication",
          "amount",
          "currency",
          "paymentType"
        ],
        "properties": {
          "authentication": {
            "$ref": "#/components/schemas/Authentication"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "paymentType": {
            "$ref": "#/components/schemas/RefundPaymentType"
          }
        }
      },
      "RefundResponse": {
        "type": "object",
        "required": [
          "id",
          "amount",
          "currency",
          "paymentType",
          "result",
          "timestamp"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/UniqueId"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "paymentBrand": {
            "$ref": "#/components/schemas/PaymentBrand"
          },
          "paymentType": {
            "$ref": "#/components/schemas/RefundPaymentType"
          },
          "result": {
            "$ref": "#/components/schemas/Result"
          },
          "resultDetails": {
            "$ref": "#/components/schemas/ResultDetails"
          },
          "connectorTxID1": {
            "$ref": "#/components/schemas/ConnectorTxID1"
          },
          "timestamp": {
            "$ref": "#/components/schemas/Timestamp"
          },
          "customParameters": {
            "$ref": "#/components/schemas/CustomParameters"
          }
        }
      },
      "Refund200ErrorResponse": {
        "description": "Error 200 response.",
        "type": "object",
        "required": [
          "id",
          "amount",
          "currency",
          "paymentType",
          "result",
          "timestamp"
        ],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/UniqueId"
          },
          "amount": {
            "$ref": "#/components/schemas/Amount"
          },
          "currency": {
            "$ref": "#/components/schemas/Currency"
          },
          "paymentType": {
            "$ref": "#/components/schemas/RefundPaymentType"
          },
          "result": {
            "$ref": "#/components/schemas/Result"
          },
          "timestamp": {
            "$ref": "#/components/schemas/Timestamp"
          }
        }
      }
    },
    "responses": {
      "Unauthorized": {
        "description": "Unauthorised.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "NotFound": {
        "description": "Not found.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            }
          }
        }
      },
      "RefundErrorResponse": {
        "description": "Bad gateway.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "required": [
                "id",
                "amount",
                "currency",
                "paymentType",
                "result",
                "timestamp"
              ],
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/UniqueId"
                },
                "amount": {
                  "$ref": "#/components/schemas/Amount"
                },
                "currency": {
                  "$ref": "#/components/schemas/Currency"
                },
                "paymentType": {
                  "$ref": "#/components/schemas/RefundPaymentType"
                },
                "result": {
                  "$ref": "#/components/schemas/Result"
                },
                "timestamp": {
                  "$ref": "#/components/schemas/Timestamp"
                }
              }
            }
          }
        }
      }
    }
  }
}
```