> ## Documentation Index
> Fetch the complete documentation index at: https://help-plum.xoxoday.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund API

## ⚠️ Important:

1. This API must be implemented and hosted by the client.
2. Xoxoday will consume this API to get the balance whenever required.
3. The request/response format below is provided only as a sample to illustrate the structure that Xoxoday expects.
4. Please ensure that your response is always in JSON format only, as our system does not support any other data types.

## Sample Request and Response

### Headers

1. `Content-Type: application/json`

### Sample Request

```json JSON (POST) theme={null}
{
  "auth_token": "123xyz", 
  "unique_id": "22816281",
  "order_id": "AB1890082790",
  "redemption_amount": "200"
}
```

### Sample Request Schema

| Parameters         | Description                                                                                                                                         |
| ------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| auth\_token        | An authorisation value to successfully allow the request from Xoxoday to your system. This value is to be sent by the client during SSO redirection |
| unique\_id         | Unique identifier of the user                                                                                                                       |
| order\_id          | Order ID of the order                                                                                                                               |
| redemption\_amount | Points/Amount used by the user                                                                                                                      |

### Sample Response Schema

```json theme={null}
{
  "status": "1",
  "message": "Successfully updated",
  "data": {
    "order_id": "AB1890082790",
    "points": "200"
  }
}

```

### Sample Response Schema

| Parameters           | Description                         |
| -------------------- | ----------------------------------- |
| status               | 1 = Successful / 0 = Failure        |
| message              | Indicates the API's success/failure |
| data.transaction\_id | Order ID of the voucher             |
| data.points          | Points refunded                     |

## Implementation Notes

1. Xoxoday will only consume this API — the client must build and expose it.
2. The `auth_token` must be provided by you under `tpd` object when SSO Redirection API is called .
3. Make sure the API response includes accurate response status.

> Note: Refunds must be initiated against an existing Order ID. The refund amount cannot exceed the original order value associated with that Order ID.
