Get All Payment Links API
Overview
Retrieve a list of payment links with optional filters, pagination, date range, and search. Results are scoped by company.
API Details
- Method: GET
- URL: https://api.gafapay.com/gafapay/v3/user/payment_link
- Content-Type: application/json
- companyid: b760d21412dd473999e374053fb95031
- requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
- Authorization: Token required
Endpoint
GET https://api.gafapay.com/gafapay/v3/user/payment_link
Headers
authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJlNDk0Njg3N2YxODk0NmIyOTlmZGRmMGYyMTMzZGNiYSIsInJvbGVzIjpbIlJPTEVfQURNSU4iXSwiZXhwIjoxNzU3MDA3NDEyfQ.ph7qKBEzuHxgljV3141L9iOrWmHI4TnyoknBSNoVYYU
companyid: b760d21412dd473999e374053fb95031
requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b
Query Parameters
Required
- company_id (string, required): Company identifier (typically set via
companyidheader; may also be passed as query param depending on backend)
Pagination
- skip (integer, optional): Number of records to skip (pagination). Default: 0
- limit (integer, optional): Maximum number of records to return. Default: 10
Filters
- user_id (string, optional): Filter by creator user ID
- user_type (integer, optional): Filter by user type (2=Customer, 3=Merchant, 5=Agent)
- business_id (string, optional): Filter by business ID
- target_user_id (string, optional): Filter by target user ID
- target_user_type (integer, optional): Filter by target user type
- payment_link (string, optional): Filter by payment link URL/identifier
- status (integer, optional): Filter by status (1=Created, 2=Expired, 3=Completed, 4=Cancelled)
- is_active (boolean, optional): Filter by active status (true = only active links)
- link_number (string, optional): Filter by link number
Date & Sort
- start_date (long, optional): Start date filter (epoch timestamp)
- end_date (long, optional): End date filter (epoch timestamp)
- sorting (string, optional): Sort specification (e.g. JSON string like
{"created_date": "DESC"}) - search_keyword (string, optional): Search in link name (case-insensitive regex)
Response (Success)
{
"success": 1,
"error": [],
"data": {
"payment_link": [
{
"id": "a1b2c3d4e5f6g7h8i9j0",
"link_number": "PL_123456",
"user_id": "fb8f09210e0f46b7b4262d77f5b6c273",
"user_type": 2,
"business_id": "biz_abc123",
"payment_link": "https://pay.gafapay.com/link/xyz",
"target_user_id": null,
"target_user_type": null,
"target_user_info": null,
"amount": 100.50,
"note": "Payment for services",
"expiry_date": 1756656000,
"status": 1,
"link_name": "Invoice #001",
"link_description": "Payment link for invoice",
"charges_info": null,
"created_by": "fb8f09210e0f46b7b4262d77f5b6c273",
"created_date": 1756551924,
"updated_by": null,
"updated_date": 1756551924,
"is_active": true
}
]
}
}
Response Fields
- success (integer): Response status indicator (1 = Success, 0 = Failure)
- error (array): Array of error messages (empty on success)
- data (object): Response data object
- payment_link (array): List of payment link detail objects (same structure as in Get Payment Link)
Response (No Data / Validation Error)
{
"success": 0,
"error": [],
"data": {
"check_validation_failed": true,
"validation_message": "USER_PAYMENT_LINK_DATA_NOT_FOUND"
}
}
Example Usage
Basic request with pagination
curl --location 'https://api.gafapay.com/gafapay/v3/user/payment_link?skip=0&limit=10' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...' \
--header 'companyid: b760d21412dd473999e374053fb95031' \
--header 'requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b'
With filters
curl --location 'https://api.gafapay.com/gafapay/v3/user/payment_link?user_id=fb8f09210e0f46b7b4262d77f5b6c273&status=1&skip=0&limit=20' \
--header 'authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9...' \
--header 'companyid: b760d21412dd473999e374053fb95031' \
--header 'requestid: be08f79e-7eac-40e1-acbe-00f6ae7b8f7b'
Notes
- Results are always filtered by company (from
companyidheader).company_idis required. - Payment link status values: 1=Created, 2=Expired, 3=Completed, 4=Cancelled. See Constants.
- Use
search_keywordto search inlink_name(case-insensitive). - Pagination uses
skipandlimit; ensure consistent values for stable paging.