Skip to main content

Refunds

This page describes the complete lifecycle of a Refund: its status flow, what each status means, the notifications you receive, the structure of the callback payload, and how to query updates.

Status Map

The following diagram covers the possible status flow for Refunds. For every status change a webhook notification is sent to the merchant's API.

Status Description

Refund StatusTriggerChanges in linked transaction
REQUESTEDMerchant requests a refund successfullynone
PROCESSINGWe request a refund successfully to the PSPnone
COMPLETEDWe get a response from the PSP that the refund was completedStatus Change: REFUNDED, PARTIALLY_REFUNDEDUpdate Refunded Amount
FAILEDWe tried to process the refund but an error occurred and it will not proceednone

Notification

A webhook notification is sent to your notification_url for every Refund status change. The notification is a lightweight signal — after receiving it, query the Update Endpoint for the current refund status and details.

ScenarioWhen it happensEffect on the linked payment
Refund requestedYou successfully request a refund (REQUESTED).None yet.
Refund processingWe forward the refund request to the PSP (PROCESSING).None yet.
Refund completedThe PSP confirms the refund (COMPLETED).The linked payment moves to REFUNDED or PARTIALLY_REFUNDED and its refunded amount is updated.
Refund failedThe refund could not be processed (FAILED).None.

The callback for a refund references the refund record and the original payment so you can reconcile it:

Callback body
{
"refund_id": 123,
"payment_token": "PAYMENT_ID"
}

Update Endpoint

Retrieve the current status and details of a refund on demand. Identify the refund by its refund_id.

GET https://api-sandbox.letpay.io/refund/REFUND_ID

Possible statuses: REQUESTED, PROCESSING, COMPLETED, FAILED.

AUTHORIZATIONAPI Key
KeyX-Auth-Token
ValueMY_ACCESS_TOKEN

Example Request

200 - Success
    curl --location 'https://api-sandbox.letpay.io/refund/REFUND_ID' \
--header 'X-Auth-Token: MY_ACCESS_TOKEN'

Example Response

Header
  Content-Type: application/json
Body
    {
"refund_id": 1,
"payment_token": "fa5ec5cc-d4d5-439e-8fb5-0368d409dc9b",
"created_at": "2019-06-25",
"refund_status": "PROCESSING",
"refresh_token": "MY_ACCESS_TOKEN"
}

You can also list all refunds for a payment via Get Refund Requests for a Payment.