> For the complete documentation index, see [llms.txt](https://developers.hyp.co.il/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.hyp.co.il/pay/common-use-cases/refunds.md).

# Performing Refunds

Sometimes you'll need to send money back to a customer after a purchase has already been completed and settled. While both cancellations and refunds result in the customer getting their money back, they work differently behind the scenes.

A [cancellation](/pay/common-use-cases/cancellations.md) is like "undoing" a charge before it's finalized (transmitted) to the credit card company. A refund, on the other hand, is for transactions that have **already been settled**. Unlike a cancellation, a **refund creates a brand-new transaction** in the system that credits the customer's card.

A refund is also different from a [payout](/pay/advanced-features/payouts.md), which is a proactive credit to a customer that isn't linked to a previous purchase.

The great thing about refunds is their flexibility: you can choose to refund the **entire amount or just a portion of it**. Just keep in mind that you can't refund more than the original transaction's value.

## How to make a refund

To make a refund, send a GET request to `https://pay.hyp.co.il/p/` with these parameters:

* `action`: Set this to `zikoyAPI`.
* `Masof`: Your terminal number.
* `PassP`: Your API password.
* `TransId`: The unique ID of the original transaction you want to refund. You'll find this in the [payment completion redirect](/pay/getting-started/creating-a-payment-page.md#handle-the-redirect-back-to-your-website) as the `Id` parameter.
* `Amount`: The amount you want to refund. This can be equal to or less than the original transaction's amount.

Here's an example of an API request to perform a refund:

{% code overflow="wrap" %}

```http
https://pay.hyp.co.il/p/?action=zikoyAPI&Masof=0010131918&PassP=your-api-password&TransId=12290620&Amount=10
```

{% endcode %}

When a refund is successful, you'll get a response that looks like this:

```
Id=405577499&CCode=0&ACode=0476241&HeshASM=EZ
```

The response includes a new `Id`, which is the unique identifier for the refund itself.

If everything goes according to plan, the system returns `CCode=0`. If there's an issue, you'll see a different [error code](/pay/reference/response-status-codes.md) that indicates what went wrong. For example, code `33` means you're trying to refund more than the original transaction was worth.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://developers.hyp.co.il/pay/common-use-cases/refunds.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
