GET
/
api
/
refund
/
{paymentRequestId}
curl --request GET \
  --url https://api.atoa.me/api/refund/{paymentRequestId} \
  --header 'Authorization: Bearer <token>'
[
  {
    "refundId": "a7c82e45-9f31-42b6-8d15-7e63f1b92c4d",
    "paymentRequestId": "5e8b2c73-1f64-4a97-9c38-d2f6ae15b8c2",
    "paymentIdempotencyId": "ATOA1234567890123",
    "status": "INITIATED",
    "paidAmount": "250.75",
    "refundAmount": "25.50",
    "currency": "GBP",
    "refundNotes": "Customer requested refund",
    "orderId": "987654321",
    "refundType": "PARTIAL",
    "createdAt": "2023-11-15T14:32:45.789Z",
    "updatedAt": "2023-11-15T14:32:45.789Z"
}
]

This API is used to get the refund details for a given payment request id. It returns information about the refund transaction including the amount, status, and related payment details.

Authorization

Bearer <token>

Using a sandbox token with a production payment request ID, or a production token with a sandbox payment request ID, will result in an error.

Request Body Schema

paymentRequestId
string
required

The payment request id is required for this step, which you’ll receive it from the process-payment API when generating a payment request.

Response

The API returns a refund payment object with the following fields:

refundId
string

A unique UUID for the refund transaction.

paymentRequestId
string

The ID of the original payment request. Refer to process-payment

paymentIdempotencyId
string

The unique identifier for the payment transaction.

status
string

The current status of the refund payment
(e.g., INITIATED,PENDING,COMPLETED,FAILED) - INITIATED : The refund request has been raised - PENDING : The refund is being ready to be processed - COMPLETED : The refund payment has been completed - FAILED : The refund payment has failed - CANCELLED : The refund payment has been cancelled

paidAmount
number

The original amount that was paid.

refundAmount
number

The amount that was refunded.

currency
string

The three-letter currency code (e.g., GBP).

refundNotes
string

The notes associated with the refund.

orderId
string

The ID of the order associated with this refund.

refundType
string

The type of refund (e.g., PARTIAL, FULL).

createdAt
string

The timestamp when the refund was created.

updatedAt
string

The timestamp when the refund was last updated.