# Refund

&#x20;A refund is performed against a previous payment, referencing its `payment.id` by sending a POST request over HTTPS to the /payments/{id} endpoint. A refund can be performed against debit (DB) or captured preauthorization (PA->CP) payment types. Where supported, the amount field can be used to process a partial or full amount.

Example:

```
curl https://test.oppwa.com/v1/payments/{Payment ID} \
 -d "entityId=8ac7a4ca6db97ef1016dbe9214e70aac" \
 -d "amount=10.00" \
 -d "currency=BRL" \
 -d "paymentType=RF" \
 -d "testMode=EXTERNAL" \ Test Evroment Only
 -H "Authorization: Bearer OGFjN2E0Y2E2ZGI5N2VmMTAxNmRiZTkwZTMxZDBhYTh8WENkRUs0NHJubQ=="
```

{% file src="/files/-MGhgzLe5sje0i-KSDQs" %}
Refund Json Request
{% endfile %}


---

# 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://developers.primeiropay.com/getting-started/server-to-server-api/refund-1.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.
