Full Refund

Refund an entire order.

POST /api/paylater/merchant-portal/v2/web-checkout/refund
Sandbox https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/refund
Production https://connect.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/refund
Refund rules

Orders can be refunded within 29 days, and no sooner than 10 minutes after the transaction. To refund part of an order, see Partial Refund.

Request

Headers

HeaderValue
AuthorizationBearer <ACCESS_TOKEN>
Content-Typeapplication/json
Body parameters
order_idStringrequired
Your merchant Order ID.

Example request

curl --location 'https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/refund' \
  --header 'Authorization: Bearer <ACCESS_TOKEN>' \
  --header 'Content-Type: application/json' \
  --data '{ "order_id": "ORD-TEST-1" }'
const res = await fetch(
  'https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/refund',
  {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${accessToken}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ order_id: 'ORD-TEST-1' }),
  },
);

const data = await res.json();
import requests

resp = requests.post(
    "https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/refund",
    headers={
        "Authorization": f"Bearer {access_token}",
        "Content-Type": "application/json",
    },
    json={"order_id": "ORD-TEST-1"},
)

data = resp.json()
$ch = curl_init('https://connect.uat.paylaterapp.com/api/paylater/merchant-portal/v2/web-checkout/refund');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_POST => true,
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . $accessToken,
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode([
        'order_id' => 'ORD-TEST-1',
    ]),
]);

$response = json_decode(curl_exec($ch), true);

Response

A 200 OK confirms the refund request was accepted.

{
  "message": "Refund request accepted for reference Id: ORD-TEST-1"
}

Errors

Example responseCause
{ "error": "Transaction Reference is required" }Missing order_id.
{ "error": "Invalid API Key" }Bad/missing token.
{ "error": "Refund Error", "message": "Order cannot be refunded as it happened more than 29 days ago." }Outside refund window.
{ "error": "Refund Error", "message": "Order contains transactions other than down payment and cannot be refunded." }Not refundable.
{ "error": "Refund Error", "message": "Transaction happened less than 10 minutes ago. Please try again later." }Too soon.
{ "error": "Refund Error", "message": "Invalid Transaction Reference." }Unknown order.

See Error handling & response codes for the full catalogue.