> For the complete documentation index, see [llms.txt](https://paymongo.ossph.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://paymongo.ossph.org/reference/api-reference/refunds.md).

# Refunds

Paymongo Refunds

## The Refund Resource

A Refund resource allows you to return full or partial amount of a payment to your customer's original payment method.

[More Details](https://developers.paymongo.com/reference/refund-resource)

## Creating a Refund

```javascript
/**
 * These are the required properties
 * @param {string} secret API private key
 * @param {Object} data Data payload
 * @param {Object} data.attributes Payload attributes
 * @param {number} data.attributes.amount Amount of the refund. A positive integer with minimum amount of 100. See https://developers.paymongo.com/reference/create-a-refund
 * @param {string} data.attributes.notes Notes of the refund. You can use this value to save remarks about the refund. The maximum characters is 255.
 * @param {string} data.attributes.payment_id The ID of a Payment resource to be refunded.
 * @param {string} data.attributes.reason Reason for the refund. Possible values are duplicate, fraudulent, requested_by_customer and others.
 * @param {Object} data.attributes.metadata A set of key-value pairs that you can attach to the resource. This can be useful for storing additional information about the object in a structured format. Only string values are accepted.
 */asc
const result = await paymongo.refunds.create(data);
```

#### **Payload**

```json
{
  "data": {
    "id": "ref_vPSqdAPD2pmtKj6Ac5SRfXjs",
    "type": "refund",
    "attributes": {
      "amount": 10000,
      "currency": "PHP",
      "livemode": true,
      "notes": "Double payment created",
      "payment_id": "pay_qOShdAuD3p8tKa6Ac4SRfbjs",
      "payout_id": null,
      "reason": "requested_by_customer",
      "status": "succeeded",
      "created_at": 1612746914,
      "updated_at": 1612746914
    }
  }
}
```

## **Listing Refunds**

```javascript
const result = await paymongo.refunds.list();
```

## Retrieving a Refund

```javascript
/**
 * @param {string} id ID of a Refund
 */
const result = await paymongo.refunds.retrieve(id);
```


---

# 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://paymongo.ossph.org/reference/api-reference/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.
