# Partial Refund

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

## Endpoint

### Sandbox

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

### Production

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

## Headers

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

## Query Parameters

| Parameter            | Type   | Required | Description       |
| -------------------- | ------ | -------- | ----------------- |
| merchantId           | String | ✅        | Your merchant ID  |
| transactionReference | String | ✅        | PayLater Order ID |

## Request Body

<table data-header-hidden><thead><tr><th>Parameter</th><th>Type</th><th width="156">Required</th><th>Description</th></tr></thead><tbody><tr><td>amount</td><td>String</td><td>✅</td><td>Partial amount. Should be less than total order value</td></tr></tbody></table>

## Sample cURL

## Success Response

```
{
  "message": "Partial Refund request accepted for reference Id: 0-4756"
}
```

## Error Responses

```
{
  "error": "Transaction Reference 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/partial-refund.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.
