---
updatedAt: 2025-06-12T00:06:16.000Z
agentTools:
  projectIndex: https://developers.tap.company/llms.txt
---

# Create a Refund

Creating a refund request

Payment reference will be controlled with "charge\_id: "chg\_xxxxxxxxxxxxx".

API allows to control the amount. Either a full or Partial.

A justified reason should be added in the API call to avoid any future confusion about the refund.

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "refunds.",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.tap.company/v2/refunds"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "in": "header",
        "name": "Authorization",
        "x-bearer-format": "bearer",
        "x-default": "sk_test_XKokBfNWv6FIYuTMg5sLPjhJ"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/": {
      "post": {
        "summary": "Create a Refund",
        "description": "Creating a refund request",
        "operationId": "create-a-refund",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "charge_id",
                  "amount",
                  "currency",
                  "reason"
                ],
                "properties": {
                  "charge_id": {
                    "type": "string",
                    "description": "Original Charge ID, provided in the Charge API request",
                    "default": "chg_TS02A1720241236y4M42101629"
                  },
                  "amount": {
                    "type": "integer",
                    "description": "Refund amount (For currencies BHD, KWD, and OMR, amount should be specified with up to 3 decimal places. For others, amount should be specified with up to 2 decimal places)",
                    "default": 10,
                    "format": "int32"
                  },
                  "currency": {
                    "type": "string",
                    "description": "Currency code, Three digit ISO code (KWD, USD,..)",
                    "default": "KWD"
                  },
                  "reason": {
                    "type": "string",
                    "description": "Reason for refund (possible values are duplicate, fraudulent, and requested_by_customer)",
                    "default": "The product is out of stock"
                  },
                  "destinations": {
                    "type": "object",
                    "description": "If you are marketplace and you want to send refund request by adding the destinations object",
                    "properties": {
                      "destination": {
                        "type": "array",
                        "items": {
                          "properties": {
                            "id": {
                              "type": "string",
                              "default": "480593"
                            },
                            "amount": {
                              "type": "string",
                              "default": "2"
                            },
                            "currency": {
                              "type": "string",
                              "default": "KWD"
                            }
                          },
                          "type": "object"
                        }
                      }
                    }
                  },
                  "post": {
                    "type": "object",
                    "description": "The Webhook URL. After refund is completed, Tap will POST the response payload as a raw data to this URL.",
                    "properties": {
                      "url": {
                        "type": "string",
                        "default": "http://your_website.com/post_url"
                      }
                    }
                  },
                  "metadata": {
                    "type": "object",
                    "description": "The set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format.",
                    "properties": {
                      "key": {
                        "type": "string",
                        "description": "Any key that will help you to identify the value, and the value is the data related to this process and you want to refer to it.",
                        "default": "value"
                      },
                      "": {
                        "type": "string"
                      }
                    }
                  },
                  "reference": {
                    "type": "object",
                    "description": "The reference numbers related to the charge.",
                    "properties": {
                      "merchant": {
                        "type": "string",
                        "description": "The merchant reference associated with this refund.",
                        "default": "1234"
                      },
                      "idempotent": {
                        "type": "string",
                        "description": "The idempotent string to restrict duplicate payments. If the same idempotent string is passed, a new refund will not be initiated, whereas the response of the first refund will be returned."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n    \"id\": \"re_xxxx\",\n    \"object\": \"refund\",\n    \"api_version\": \"V2\",\n    \"live_mode\": false,\n    \"amount\": 3.0,\n    \"charge_id\": \"chg_xxxx\",\n    \"created\": \"1723481040882\",\n    \"date\": \"1723481042085\",\n    \"currency\": \"AED\",\n    \"status\": \"REFUNDED\",\n    \"reference\": {\n        \"id\": \"xxxx\",\n        \"gateway\": \"xxxx\",\n        \"payment\": \"xxxx\",\n        \"acquirer\": \"xxxx\"\n    },\n    \"response\": {\n        \"code\": \"000\",\n        \"message\": \"Refunded\"\n    },\n    \"post\": {\n        \"status\": \"PENDING\",\n        \"url\": \"http://your_website.com/post_url\"\n    },\n    \"acquirer\": {\n        \"response\": {\n            \"code\": \"000\",\n            \"message\": \"Refunded\"\n        }\n    },\n    \"gateway\": {\n        \"response\": {\n            \"code\": \"00\",\n            \"message\": \"Approved\"\n        }\n    },\n    \"method\": \"CREATE\",\n    \"transaction\": {\n        \"timezone\": \"UTC+03:00\",\n        \"asynchronous\": false,\n        \"amount\": 3.00,\n        \"currency\": \"AED\",\n        \"date\": {\n            \"created\": 1723481040882,\n            \"completed\": 1723481042085\n        }\n    },\n    \"wallet\": {\n        \"debit\": false\n    },\n    \"merchant\": {\n        \"id\": \"xxxx\"\n    },\n    \"reverse_destination\": false,\n    \"reason\": \"The product is out of stock\"\n}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "example": "re_xxxx"
                    },
                    "object": {
                      "type": "string",
                      "example": "refund"
                    },
                    "api_version": {
                      "type": "string",
                      "example": "V2"
                    },
                    "live_mode": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "amount": {
                      "type": "integer",
                      "example": 3,
                      "default": 0
                    },
                    "charge_id": {
                      "type": "string",
                      "example": "chg_xxxx"
                    },
                    "created": {
                      "type": "string",
                      "example": "1723481040882"
                    },
                    "date": {
                      "type": "string",
                      "example": "1723481042085"
                    },
                    "currency": {
                      "type": "string",
                      "example": "AED"
                    },
                    "status": {
                      "type": "string",
                      "example": "REFUNDED"
                    },
                    "reference": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "xxxx"
                        },
                        "gateway": {
                          "type": "string",
                          "example": "xxxx"
                        },
                        "payment": {
                          "type": "string",
                          "example": "xxxx"
                        },
                        "acquirer": {
                          "type": "string",
                          "example": "xxxx"
                        }
                      }
                    },
                    "response": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "example": "000"
                        },
                        "message": {
                          "type": "string",
                          "example": "Refunded"
                        }
                      }
                    },
                    "post": {
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "string",
                          "example": "PENDING"
                        },
                        "url": {
                          "type": "string",
                          "example": "http://your_website.com/post_url"
                        }
                      }
                    },
                    "acquirer": {
                      "type": "object",
                      "properties": {
                        "response": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "000"
                            },
                            "message": {
                              "type": "string",
                              "example": "Refunded"
                            }
                          }
                        }
                      }
                    },
                    "gateway": {
                      "type": "object",
                      "properties": {
                        "response": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "example": "00"
                            },
                            "message": {
                              "type": "string",
                              "example": "Approved"
                            }
                          }
                        }
                      }
                    },
                    "method": {
                      "type": "string",
                      "example": "CREATE"
                    },
                    "transaction": {
                      "type": "object",
                      "properties": {
                        "timezone": {
                          "type": "string",
                          "example": "UTC+03:00"
                        },
                        "asynchronous": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        },
                        "amount": {
                          "type": "integer",
                          "example": 3,
                          "default": 0
                        },
                        "currency": {
                          "type": "string",
                          "example": "AED"
                        },
                        "date": {
                          "type": "object",
                          "properties": {
                            "created": {
                              "type": "integer",
                              "example": 1723481040882,
                              "default": 0
                            },
                            "completed": {
                              "type": "integer",
                              "example": 1723481042085,
                              "default": 0
                            }
                          }
                        }
                      }
                    },
                    "wallet": {
                      "type": "object",
                      "properties": {
                        "debit": {
                          "type": "boolean",
                          "example": false,
                          "default": true
                        }
                      }
                    },
                    "merchant": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string",
                          "example": "xxxx"
                        }
                      }
                    },
                    "reverse_destination": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "reason": {
                      "type": "string",
                      "example": "The product is out of stock"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{}"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {}
                }
              }
            }
          }
        },
        "deprecated": false
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```