Get All Payment Links API

Resource: payment-links

The** Get All Payment Links** API is used to get all the payment links generated for a given date range, and you can specify how many records are to be displayed per page in the response.

HTTP Method: GET

Environment

📘

Note:

The access token with the scope as read_payment_links is required on the header. For more information on getting the access token, refer to Get Token API - Payment Links.

Request headers

Parameter Description

mid
mandatory

String This contains the merchant identifier.

Authorization
mandatory

Bearer String This contains the client_token. For getting a token, refer to Get Token API - Payment Links .

Query parameters

Parameters Description Example

pageOffset

The parameter needs to include the page offset in terms of the rows.

2

pageSize

The parameter needs to include the number of rows to be displayed per page in the response.

20

orderBy

This parameter can contain any of the following column names by which the rows in the API response are sorted:
addedOn

addedOn

order

This parameter can contain any of the following values:

  • asc-The payment links are arranged in ascending order in the API response.
  • des-The payment links are arranged in descending order in the API response.

asc

dateFrom mandatory

StringThis parameter must contain the date from which the payment links are required. This must be in "yyyy-MM-dd" format.

2022-01-22

searchText

String This parameter contains the description of payment link that must be searched for.

Insurance Premium Payment

dateTo mandatory

StringThis parameter must contain the date to which the payment links are required. This must be in "yyyy-MM-dd" format.

2022-01-28

active

StringThis parameter can include any of the following status as the value:
- active

  • inactive
  • expired

active

Sample request

curl --location -g --request GET 'https://uatoneapi.payu.in/payment-links?pageSize=20&pageOffset=0&orderBy=amount&order=desc&dateFrom=2022-03-21&dateTo=2022-03-22' \
--header 'merchantId: {{merchantId}}' \
--header 'Authorization: Bearer {{access_token}}'
import http.client

conn = http.client.HTTPSConnection("{{stagingurl}}")
payload = ''
headers = {
  'merchantId': '{{merchantId}}',
  'Authorization': 'Bearer {{access_token}}'
}
conn.request("GET", "/payment-links?pageSize=20&pageOffset=0&orderBy=amount&order=desc&dateFrom=2022-03-21&dateTo=2022-03-22", payload, headers)
res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
require "uri"
require "net/http"

url = URI("{{stagingurl}}/payment-links?pageSize=20&pageOffset=0&orderBy=amount&order=desc&dateFrom=2022-03-21&dateTo=2022-03-22")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Get.new(url)
request["merchantId"] = "{{merchantId}}"
request["Authorization"] = "Bearer {{access_token}}"

response = http.request(request)
puts response.read_body
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
Request request = new Request.Builder()
  .url("{{stagingurl}}/payment-links?pageSize=20&pageOffset=0&orderBy=amount&order=desc&dateFrom=2022-03-21&dateTo=2022-03-22")
  .method("GET", null)
  .addHeader("merchantId", "{{merchantId}}")
  .addHeader("Authorization", "Bearer {{access_token}}")
  .build();
Response response = client.newCall(request).execute();

Sample response

{
  "status": 0,
  "message": null,
  "result": {
    "pageSize": 20,
    "pages": 1,
    "rows": 1,
    "pageOffset": 0,
    "paymentLinksList": [
      {
        "invoiceNumber": "INV8446471886220",
        "description": "paymentLink for testing",
        "createDate": "2022-03-21T14:53:53.000+0530",
        "paymentLinkURL": "http://pp72.pmny.in/4IwlctBtwp2V",
        "customerName": null,
        "amount": 2,
        "active": true,
        "expiry": "2022-03-21T16:12:12.000+0530",
        "isAmountFilledByCustomer": false,
        "status": "active",
        "isScheduled": 0,
        "reminderCount": 0
      }
    ]
  },
  "errorCode": null,
  "guid": null
}