> For the complete documentation index, see [llms.txt](https://docs.coda.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.coda.co/codapay/additional-features/refund-a-payment.md).

# Refund a payment

## <mark style="color:purple;">Overview</mark>

<figure><img src="/files/JvcgFupC3BEYfQE48hXv" alt=""><figcaption><p>How Refund API works</p></figcaption></figure>

1. Initiating the Refund Process: Merchants can initiate the refund process by sending a refund request through the API, specifying the transaction ID for the completed transaction.
2. Reviewing Refund Status: Merchants can check the status of a refund request through the API. This allows them to monitor the progress and current status of refund transactions.
3. Monitoring Refund Status: Merchants can also monitor the status of refund requests in real-time by subscribing to webhook events. This provides automated notifications of status changes, ensuring merchants stay informed about the progress of refund requests.  Refer to [Webhook Notification](/codapay/additional-features/refund-a-payment/get-notified-about-refund-status-changes.md) for further details.

## <mark style="color:purple;">APIKEY</mark>

Please contact publisher support team to obtain an API key to use the Refund API.

## <mark style="color:purple;">Endpoint Base URLs</mark>

The only way for the publisher to integrate with Coda Direct API for cards endpoints is to send the requests to the following Base URL:

Refer to our sample messages for examples.

<table><thead><tr><th width="180">Environment</th><th>Endpoint Base URL</th></tr></thead><tbody><tr><td>Sandbox</td><td>Coming soon</td></tr><tr><td>Production</td><td><a href="https://api-tc.codapayments.com/v1/direct/charges">https://api-tc.codapayments.com/v1/</a></td></tr></tbody></table>

{% hint style="warning" %}
🚧 <mark style="color:orange;">**Please ensure that requests to Codapay API must be sent over**</mark>

1. HTTPS
2. TLS 1.2 or higher
3. Include an Authorization header, API Key, and Partner ID
   {% endhint %}


---

# 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 dynamically by asking a question.

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

```
GET https://docs.coda.co/codapay/additional-features/refund-a-payment.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
