---
title: "MakeRefund"
method: POST
path: "/v2/MakeRefund"
tags: ["Refund"]
---

# MakeRefund

`POST /v2/MakeRefund`

Cancels a payment and returns the funds to the customer. This endpoint can be used for full or partial refunds. The refund can be processed using either InvoiceId or PaymentId.

## Request body

- object
  - `KeyType` 'InvoiceId' | 'PaymentId', required — State either it's 'InvoiceId' or 'PaymentId' to identify the transaction to be refunded.
  - `Key` string, required — Value of the key type mentioned. If KeyType is 'InvoiceId', provide the invoice ID. If KeyType is 'PaymentId', provide the payment ID.
  - `ServiceChargeOnCustomer` boolean — Determine whether the customer will be charged for the service fees or not. Service fees are charged by MyFatoorah.
  - `Amount` number, required — The amount to be refunded.
  - `Comment` string — Extra comments for your reference.
  - `ExternalIdentifier` string — External data associated with the refund, which will be received in the webhook.
  - `AmountDeductedFromSupplier` number — This is the amount that will be deducted from the supplier in the refund process. It will be part of the total amount. For example: If the total amount is 100 and the AmountDeductedFromSupplier is 70, the vendor will pay 30 and the supplier will pay 70. This parameter is optional.

## Response `200`

Refund processed successfully

- object
  - `IsSuccess` boolean — Indicates if the request was successful.
  - `Message` string — Response message associated with the request.
  - `ValidationErrors` object[] — List of validation errors, if any.
    - `Name` string — Name of the field with validation error.
    - `Error` string — Description of the validation error.
  - `Data` object, nullable
    - `Key` string — The key value you have passed for the Request Transaction.
    - `RefundId` number — The unique identifier for this refund transaction.
    - `RefundReference` string — The refund reference generated by MyFatoorah for following up with the finance team.
    - `RefundInvoiceId` string — The InvoiceId of the refunded amount.
    - `Amount` number — The amount that was refunded.
    - `Comment` string — The comments that you have passed in the request.
    - `ExternalIdentifier` string — The External Identifier you provided in the request.

---

[API](https://skmtc.net/myfatoorah/apis/myfatoorah-api-v3.md) · [All operations](https://skmtc.net/myfatoorah/apis/myfatoorah-api-v3/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myfatoorah/myfatoorah-api-v3/revisions/994a74287a16/schema)
