Skip to main content

[GET] Show Refund by Payment Reference (Single)

Description

If you want to show the details of a single Refund by the Payment Reference, you need to follow the next steps howver, if you want to retrieve the full list of Payments, please visit here.

Requirements

ℹ️ Before launching a payment, you need to have a Location created, as each payment will be related to a Location (location_id).

Authentication

In all your requests you need to add, as a Header, your Authorization Token-ID:

"Name": "Authorization"
"Value": "Bearer YOUR-TOKEN-ID"

Environments

Staging environment

GET https://staging.sylq.io/remote_api/v1/remote_payments/{payment_reference}/refunds

Production/Live environment

GET https://app.sylq.io/remote_api/v1/remote_payments/{payment_reference}/refunds

Examples of Request

As a "Header" we need to specify the "Authorization" (Bearer value). If we want to make a simple Request, we can use this cURL example:

curl -i -H "Accept: application/json" -H "Authorization: Bearer YOUR-TOKEN-ID" -X GET "https://staging.sylq.io/remote_api/v1/remote_payments/0NYJNVM06T/refunds"

Managing Pagination, Limits and Filters to the Requests

Pagination, Limits and Payment reference (Parameters)

Example of the Requests with Parameters:

  • Page (integer), the pagination of the results.
  • Limit (integer), the maximum number of results.
  • payment_reference (string), the Payment Reference.
curl -i -H "Accept: application/json" -H "Authorization: Bearer YOUR-TOKEN-ID" -X GET "https://staging.sylq.io/remote_api/v1/remote_payments/0NYJNVM06T?limit=1&page=1"

Filters (JSON Request body)

If we wish, we can specify filters to our return of the request, so we have the option of attaching a JSON Body to the query, example:

{
"q": {
"reference_eq": "string",
"payment_refund_refund_method_eq": "bank",
"amount_lt": 0,
"amount_gt": 0
}
}
  • external_reference_eq (string), we can filter by the External Reference.
  • payment_payment_method_eq (string), we can filter by Payment types, e.g. "card", "crypto" or "bank".
  • payment_status_eq (string), we can filter by the Payment Status types, e.g. "Confirmed", "Pending", etc... ℹ️ If you want to see the Payments status code, please, read the section of "[GET] Retrieve Status".
  • status_eq (string), we can filter by the Refund Status, types, e.g. "New", "Completed" or "Failed", etc...
  • today (boolean), we can specify that only today's Transactions are shown.
  • yesterday (boolean), we can specify that only yesterday's Transactions are shown.
  • 1_month_ago (boolean), we can specify that only Transactions from one month ago are shown.
  • 1_year_ago (boolean), we can specify that only Transactions from one year ago are shown.

Examples of Returns

Success response (200)

{
"success": true,
"message": "Success",
"data": {
"total_refunds": 1,
"total_of_pages": 1,
"current_page": 1,
"refunds": [
{
"id": 243,
"payment_refund_id": 241,
"refund_method": "card",
"amount_refunded": "1.0",
"amount_refundable": "0.0",
"amount": "1.0",
"currency": "EUR",
"type": "total",
"refund_reference": "UUUNBTE9ZH",
"payment_reference": "TTVXMAB1J7",
"external_reference": null,
"notes": null,
"status": "completed",
"device": {
"id": 489,
"name": "PAX A50",
"os_system": "Android 8.1.0",
"sylq_app_version": "3.2.0",
"place_id": 19,
"created_at": "2024-03-15T14:15:45.884Z"
},
"created_at": "2024-03-15T14:30:20.304Z"
}
]
}
}

Error responses

Unauthorized (401)

This error appears it is because the credential is incorrect or does not exist.

{
"message": "Unauthorized"
}

Not Found (404)

This error appears when the Payment Reference does not exist.

{
"success": false,
"message": "Record not found"
}