Fetching Payment Links

Once you have created payment links, you may need to retrieve them to display within your application, update their configuration, or reconcile incoming payments. The Leatherback API provides a suite of GET endpoints that allow you to query your links globally or retrieve detailed data for specific links and their transactions.


Overview of Capabilities

To help you manage your collections effectively, the API supports four primary ways to retrieve link data.


List All Links

Retrieve a paginated list of all payment links created under a merchant's account by calling a GET request to the Get Payment Links API

{
  "items": [
    {
      "id": "fee5708a-894b-45de-04e4-08db31d4b7ea",
      "name": "Test Link",
      "description": "Testing",
      "alias": "0-k2tmbuy",
      "link": null,
      "amountInfo": {
        "currencyCode": "NGN",
        "amount": 100
      },
      "linkType": "Reuseable",
      "status": "New",
      "createdDate": "2023-03-31T10:43:09.1931541",
      "environment": "Test"
    }
  ],
  "pageParams": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalCount": 10
  },
  "isSuccess": true,
  "message": "Request Successful"
}
{
  "type": "https://httpstatuses.io/400",
  "title": "Bad Request",
  "status": 400,
  "traceId": "00-6c8cde6d25f77646deda7230015a88c0-d2be5f7d289728b2-00"
}
{
  "isSuccess": false,
  "title": "Access Denied!",
  "status": 401,
  "detail": "Access Denied! You do not have the necessary permissions to perform this action. Please contact the Leatherback team for assistance.",
  "traceId": "00-b5aa368c66bff0279d7162dbc184a747-c971865180e32372-00"
}

Fetch by ID

Retrieve a specific payment link using its unique ID by calling a GET request to the Get Payment Link By ID API

"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
{
  "value": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "name": "Nike Air",
    "description": "Payment For Nike Air - INV100000000",
    "alias": "0-k2tmbuy",
    "link": "https://app-aaaspaymentlink-stg.azurewebsites.net/0-k2tmbuy",
    "amountInfo": {
      "currencyCode": "NGN",
      "amount": 100
    },
    "linkType": "Reuseable",
    "status": "New",
    "createdDate": "2023-03-31T10:43:09.1931541+00:00",
    "environment": "Test"
  },
  "isSuccess": true,
  "message": "Request Successful"
}

Fetch by Alias

Retrieve link details using the chosen alias by calling a GET request to the Get Payment Link By Alias API

{
    "value": {
      "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "name": "Nike Air",
        "description": "Payment For Nike Air - INV100000000",
        "alias": "0-k2tmbuy",
        "link": "https://app-aaaspaymentlink-stg.azurewebsites.net/0-k2tmbuy",
        "amountInfo": {
            "currencyCode": "NGN",
            "amount": 100
        },
        "linkType": "Reuseable",
        "status": "New",
        "createdDate": "2023-03-31T10:43:09.1931541+00:00",
        "environment": "Test"
    },
    "isSuccess": true,
    "message": "Request Successful"
}
{
  "isSuccess": false,
  "title": "Access Denied!",
  "status": 401,
  "detail": "Access Denied! You do not have the necessary permissions to perform this action. Please contact the Leatherback team for assistance.",
  "traceId": "00-b5aa368c66bff0279d7162dbc184a747-c971865180e32372-00"
}

Link Transactions

Access a detailed ledger of transactions associated with a specific payment link, including successful, pending, and failed payments. Call a GET request to the Get Payment Link Transactions API

{
  "items": [
    {
      "linkAlias": "0-k2tmbuy",
      "customerName": "Oghale-Oghene Etomu",
      "paymentChannel": "Card",
      "currencyCode": "NGN",
      "amount": 100,
      "transactionDate": "2023-03-31T10:59:08.3830937",
      "status": "New"
    }
  ],
  "pageParams": {
    "pageNumber": 1,
    "pageSize": 10,
    "totalCount": 1
  },
  "isSuccess": true,
  "error": "",
  "message": "Request Successful",
  "responseCode": null
}