# Refund API

Initiate a full refund for a completed transaction using the Refund API. This endpoint allows you to seamlessly return funds to the shopper while keeping records updated for reconciliation and reporting purposes.

## Endpoint

### Sandbox

`GET https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/web-checkout/refund`

### Production

`GET https://connect.paylaterapp.com/api/paylater/merchant-portal/web-checkout/refund`

## Headers

* `x-api-key`: Your API key (Required)

## Query Parameters

<table data-header-hidden><thead><tr><th></th><th></th><th width="160.8203125"></th><th></th></tr></thead><tbody><tr><td>Parameter</td><td>Type</td><td>Required</td><td>Description</td></tr><tr><td>merchantId</td><td>String</td><td>✅</td><td>Your merchant ID</td></tr><tr><td>transactionReference</td><td>String</td><td>✅</td><td>Merchant Order ID</td></tr><tr><td>transactionType</td><td>String</td><td>✅</td><td>Must be <code>DOWN_PAYMENT</code></td></tr></tbody></table>

## Success Response

```
{
  "message": "Refund request accepted for reference Id: PL1740851963584963"
}
```

## Error Responses

```
{
  "error": "Transaction Reference is required"
}

{
  "error": "Transaction Type is required"
}

{
  "error": "Invalid API Key"
}

{
  "error": "Refund Error",
  "message": "Order cannot be refunded as it happened more than 29 days ago."
}

{
  "error": "Refund Error",
  "message": "Order contains transactions other than down payment and cannot be refunded."
}

{
  "error": "Refund Error",
  "message": "Transaction happened less than 10 minutes ago. Please try again later."
}

{
  "error": "Refund Error",
  "message": "Invalid Transaction Reference."
}

{
  "error": "Refund Error",
  "message": "Invalid Transaction type."
}
```

***

For questions, support, or sandbox access — reach out to your PayLater account manager.

Ready to go? Start coding. 🛠️


---

# 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://paylater.gitbook.io/paylater-docs/getting-started/quickstart/refund-api.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.
