List payment links
curl --request POST \
--url https://api.sandbox.cheqpay.mx/lps/payment-links/list \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"page": 1,
"limit": 10,
"filter": {
"search": "Premium",
"isEnabled": true
},
"sort": {
"field": "createdAt",
"order": "desc"
}
}
'import requests
url = "https://api.sandbox.cheqpay.mx/lps/payment-links/list"
payload = {
"page": 1,
"limit": 10,
"filter": {
"search": "Premium",
"isEnabled": True
},
"sort": {
"field": "createdAt",
"order": "desc"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
page: 1,
limit: 10,
filter: {search: 'Premium', isEnabled: true},
sort: {field: 'createdAt', order: 'desc'}
})
};
fetch('https://api.sandbox.cheqpay.mx/lps/payment-links/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.cheqpay.mx/lps/payment-links/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'page' => 1,
'limit' => 10,
'filter' => [
'search' => 'Premium',
'isEnabled' => true
],
'sort' => [
'field' => 'createdAt',
'order' => 'desc'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/lps/payment-links/list"
payload := strings.NewReader("{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\",\n \"isEnabled\": true\n },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.cheqpay.mx/lps/payment-links/list")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\",\n \"isEnabled\": true\n },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/payment-links/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\",\n \"isEnabled\": true\n },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"merchantId": "<string>",
"type": "products_subscriptions",
"currency": "<string>",
"totals": {
"total": 1,
"taxes": 1,
"shipping": 1,
"fees": 1,
"discounts": 1
},
"paymentMethods": [
"card"
],
"isDraft": true,
"isEnabled": true,
"_id": "<string>",
"name": "<string>",
"url": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"plans": [
{
"id": "<string>",
"merchantId": "<string>",
"externalId": "<string>",
"name": "<string>",
"description": "<string>",
"amount": 123,
"currency": "MXN",
"interval": "DAY",
"intervalCount": 123,
"trialDays": 123,
"active": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"options": {
"collectShippingAddress": false,
"taxIdCollection": {
"enabled": true,
"required": false
}
},
"customFields": [
{
"type": "text",
"label": "<string>",
"required": false,
"options": [
"<string>"
]
}
],
"numberOfPayments": 2,
"redirectUrl": "<string>",
"cancelUrl": "<string>",
"reference": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"externalId": "<string>",
"defaults": {
"persistPaymentMethod": false,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": true
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"currentPage": 1,
"totalPages": 5,
"totalCount": 47,
"limit": 10
}{
"message": "Validation failed"
}{
"message": "Unauthorized"
}{
"message": "Internal server error"
}Payment Links
List payment links
List payment links with pagination, filtering, and sorting. Results are automatically filtered by the authenticated merchant unless a different merchantId is provided in the filter.
POST
/
payment-links
/
list
List payment links
curl --request POST \
--url https://api.sandbox.cheqpay.mx/lps/payment-links/list \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"page": 1,
"limit": 10,
"filter": {
"search": "Premium",
"isEnabled": true
},
"sort": {
"field": "createdAt",
"order": "desc"
}
}
'import requests
url = "https://api.sandbox.cheqpay.mx/lps/payment-links/list"
payload = {
"page": 1,
"limit": 10,
"filter": {
"search": "Premium",
"isEnabled": True
},
"sort": {
"field": "createdAt",
"order": "desc"
}
}
headers = {
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
page: 1,
limit: 10,
filter: {search: 'Premium', isEnabled: true},
sort: {field: 'createdAt', order: 'desc'}
})
};
fetch('https://api.sandbox.cheqpay.mx/lps/payment-links/list', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.sandbox.cheqpay.mx/lps/payment-links/list",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'page' => 1,
'limit' => 10,
'filter' => [
'search' => 'Premium',
'isEnabled' => true
],
'sort' => [
'field' => 'createdAt',
'order' => 'desc'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/lps/payment-links/list"
payload := strings.NewReader("{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\",\n \"isEnabled\": true\n },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.sandbox.cheqpay.mx/lps/payment-links/list")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\",\n \"isEnabled\": true\n },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/payment-links/list")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\",\n \"isEnabled\": true\n },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"merchantId": "<string>",
"type": "products_subscriptions",
"currency": "<string>",
"totals": {
"total": 1,
"taxes": 1,
"shipping": 1,
"fees": 1,
"discounts": 1
},
"paymentMethods": [
"card"
],
"isDraft": true,
"isEnabled": true,
"_id": "<string>",
"name": "<string>",
"url": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"plans": [
{
"id": "<string>",
"merchantId": "<string>",
"externalId": "<string>",
"name": "<string>",
"description": "<string>",
"amount": 123,
"currency": "MXN",
"interval": "DAY",
"intervalCount": 123,
"trialDays": 123,
"active": true,
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"options": {
"collectShippingAddress": false,
"taxIdCollection": {
"enabled": true,
"required": false
}
},
"customFields": [
{
"type": "text",
"label": "<string>",
"required": false,
"options": [
"<string>"
]
}
],
"numberOfPayments": 2,
"redirectUrl": "<string>",
"cancelUrl": "<string>",
"reference": "<string>",
"invoiceNumber": "<string>",
"description": "<string>",
"externalId": "<string>",
"defaults": {
"persistPaymentMethod": false,
"billingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>",
"isSameAsShipping": true
},
"shippingAddress": {
"firstName": "<string>",
"lastName": "<string>",
"organizationName": "<string>",
"email": "jsmith@example.com",
"phone": "<string>",
"addressLine1": "<string>",
"addressLine2": "<string>",
"city": "<string>",
"state": "<string>",
"postalCode": "<string>",
"country": "<string>"
}
},
"metadata": {},
"expiresAt": "2023-11-07T05:31:56Z",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}
],
"currentPage": 1,
"totalPages": 5,
"totalCount": 47,
"limit": 10
}{
"message": "Validation failed"
}{
"message": "Unauthorized"
}{
"message": "Internal server error"
}Authorizations
API key for merchant authentication
Body
application/json
Response
Payment links retrieved successfully
Paginated response containing payment links
Array of payment links
Show child attributes
Show child attributes
Current page number
Example:
1
Total number of pages
Example:
5
Total number of payment links matching the filter
Example:
47
Number of items per page
Example:
10