Skip to main content

[GET] Show Refunds List (All)

Description

If you want to list all Refunds, all their details and their status, you can use this enpoint and you will get what you need.

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/refunds

Production/Live environment

GET https://app.sylq.io/remote_api/v1/remote_payments/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"

If we want to make more complex Requests, we can see below how to use the Parameters or the JSON Body to apply Filters.

Managing Pagination, Limits and Filters to the Requests

Pagination and Limits (Parameters)

Example of the Requests with Parameters:

  • Page (integer), the pagination of the results.
  • Limit (integer), the maximum number of results
curl -i -H "Accept: application/json" -H "Authorization: Bearer YOUR-TOKEN-ID" -X GET "https://staging.sylq.io/remote_api/v1/remote_payments/refunds?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": {
"external_reference_eq": "string",
"payment_payment_method_eq": "string",
"payment_status_eq": "string",
"status_eq": "string",
"today": true,
"yesterday": true,
"1_month_ago": true,
"1_year_ago": true
}
}
  • 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.

However, it can also be reported as a Parameter, e.g. cURL:

curl -i -H "Accept: application/json" -H "Authorization: Bearer YOUR-TOKEN-ID" -X GET "https://staging.sylq.io/remote_api/v1/remote_payments/refunds?page=1&limit=10&q[payment_status_eq]=expired&q[payment_payment_method_eq]=card&q[yesterday]=true"

Examples of Returns

Success response (200)

{
"success": true,
"message": "Success",
"data": {
"total_payments": 1,
"total_of_pages": 1,
"current_page": 1,
"refunds": [
{
"id": 51,
"payment_refund_id": 53,
"refund_method": "crypto",
"amount_refunded": "0.0",
"amount_refundable": "77.09",
"amount": "43.01",
"currency": "EUR",
"type": "partial",
"refund_reference": "CDOZI2OAOT",
"payment_reference": "KAVBKUAPD5",
"external_reference": "XFYQQHZ82N",
"notes": "Tenetur aut dignissimos iure.",
"status": "new",
"device": {
"id": 97,
"name": "Galaxy S8 Plus",
"os_system": "Ubuntu Touch",
"sylq_app_version": "837",
"place_id": 700,
"created_at": "2024-03-14T15:41:21.959Z"
},
"created_at": "2024-03-14T15:41:22.065Z"
}
]
}
}

Error responses

Unauthorized (401)

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

{
"message": "Unauthorized"
}