> For the complete documentation index, see [llms.txt](https://developer.ivvy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.ivvy.com/venues/getoraddbookingdata/add-refund-to-booking.md).

# Add Refund To Booking

<mark style="color:green;">`POST`</mark> `[PlatformAddress]/api/1.0/venue?action=addRefundToBooking`

Add a refund to a booking using this api.

#### Request Body

| Name      | Type    | Description                                                    |
| --------- | ------- | -------------------------------------------------------------- |
| venueId   | integer | The unique id of the venue to which the booking belongs        |
| bookingId | integer | The unique id of the booking to which the refund will be added |
| refund    | object  | The payment details to add to the booking                      |

{% tabs %}
{% tab title="200 " %}

```
{
  "Success": true,
  "refundDetails": [
    {
      "invoiceId": 1736,
      "refundId": 180
    }
  ]
}
```

{% endtab %}
{% endtabs %}

All invoices of the booking will be checked for the refunded amount and if the amount is refundable then only the refund amount will be added to invoice.

### Example Request

`Add refund to booking`

```javascript
{
  "venueId": 2,
  "bookingId": 2,
  "refund": {
    "refundDate": "2015-01-22 00:00:00 UTC",
    "amount": 100,
    "notes": "Note for refund"
  }
}
```

### Payment Details

| Property   | Description                       | Required         |
| ---------- | --------------------------------- | ---------------- |
| refundDate | The date & time of the refund     | timestamp in UTC |
| amount     | The refund amount                 | number           |
| notes      | Additional notes about the refund | string           |

### Returns

| Property      | Description                                        |
| ------------- | -------------------------------------------------- |
| success       | Whether or not the refund was added to the booking |
| refundDetails | A collection of invoiceId and refundId values      |

### Refund Details

| Property  | Description                  |
| --------- | ---------------------------- |
| invoiceId | The unique id of the invoice |
| refundId  | The id of the invoice refund |

### Throws

| Code                 | Description                                                   |
| -------------------- | ------------------------------------------------------------- |
| Specific Code: 24149 | The refund details are invalid                                |
| Specific Code: 24145 | The booking does not have an amount that can be refunded      |
| Specific Code: 24146 | Cannot refund more than the total amount payable on a booking |
| Specific Code: 24147 | The refund amount must be greater than zero                   |
| Specific Code: 24148 | The full refund amount could not be applied to the booking    |


---

# 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://developer.ivvy.com/venues/getoraddbookingdata/add-refund-to-booking.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.
