# 3. Refund

## Payment Refund Process

<mark style="color:green;">`POST`</mark> `{{Base Adres}}/api/paywall/apm/refund`

{% hint style="info" %}
**Important**: To use the APM Payment Refund service, you need to include '**apikeypublic**' and '**apiclientpublic**' parameters in the 'Header' field.

\
[<mark style="color:green;">**PaymentAPI Address**</mark>](/payment-orchestration-integration-document/environment.md)
{% endhint %}

**The header parameters that need to be sent to the service are as follows:**

<table><thead><tr><th width="221">Parameter (Headers)</th><th width="93">Type</th><th width="135">Compulsory</th><th width="403">Description</th></tr></thead><tbody><tr><td>apikeypublic</td><td>string</td><td>Yes</td><td>The Public Key obtained from the merchant panel.</td></tr><tr><td>apiclientpublic</td><td>string</td><td>Yes</td><td>The Public Client obtained from the merchant panel.</td></tr></tbody></table>

**The parameters that need to be sent to the service in the (BODY) are as follows:**

<table><thead><tr><th width="164.20703125">Parameter</th><th width="92">Type</th><th width="150">Compulsory</th><th width="336">Description</th></tr></thead><tbody><tr><td>UniqueCode</td><td>string</td><td>Yes</td><td>The UniqueCode parameter for the APM payment. It is included in the response returned by the API at the time of creation.</td></tr></tbody></table>

**The parameters returned from the service are as follows:**

<table><thead><tr><th width="189">Parameter</th><th width="100.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td>ErrorCode</td><td>int</td><td>Error code. Returns a value of '0' if the operation is successful.</td></tr><tr><td>Result</td><td>bool</td><td>Returns a value of true or false. Returns true if the operation is successful.</td></tr><tr><td>Message</td><td>string</td><td>If the operation fails, this message specifies the error and provides language support according to the locale parameter.</td></tr><tr><td>Body</td><td>object</td><td>If the operation fails, this is the detailed object regarding the error.</td></tr></tbody></table>

{% tabs %}
{% tab title="JSON" %}
{% code lineNumbers="true" %}

```json
{
    "ErrorCode": 0,
    "Result": true,
    "Message": "",
    "Body": {
        "ApmKey": "FoodCardProvider",
        "ApmConnectionId": 19,
        "ApmTransactionId": 4292,
        "UniqueCode": "cda31a20-5089-40c6-9fb*********",
        "MerchantUniqueCode": "A1s2d3F774G5H6J7K8L9",
        "Amount": 1.00,
        "ProviderDummyResponse": {
            "ErrorCode": 0,
            "Body": {
                "ResponseCode": 0,
                "ResponseMessage": "İptal işlemi başarılı bir şekilde gerçekleştirilmiştir.",
                "MerchantCode": "*********",
                "TerminalCode": "*********",
                "SaleRefCode": "cda31a20-5089-40c6*********",
                "TransactionId": 111111111111,
                "ReturnType": 1
            },
            "HttpCode": 200
        }
    }
}
```

{% endcode %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.paywall.one/payment-orchestration-integration-document/alternative-methods-apm/3.-refund.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
