List products
curl --request POST \
--url https://api.sandbox.cheqpay.mx/lps/products/list \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"page": 1,
"limit": 10,
"filter": {
"search": "Premium"
},
"sort": {
"field": "createdAt",
"order": "desc"
}
}
'import requests
url = "https://api.sandbox.cheqpay.mx/lps/products/list"
payload = {
"page": 1,
"limit": 10,
"filter": { "search": "Premium" },
"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'},
sort: {field: 'createdAt', order: 'desc'}
})
};
fetch('https://api.sandbox.cheqpay.mx/lps/products/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/products/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'
],
'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/products/list"
payload := strings.NewReader("{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\"\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/products/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 },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/products/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 },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"_id": "<string>",
"merchantId": "<string>",
"name": "<string>",
"price": 1,
"id": "<string>",
"description": "<string>",
"status": "active",
"imageUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "2023-11-07T05:31:56Z"
}
],
"currentPage": 1,
"totalPages": 5,
"totalCount": 47,
"limit": 10
}{
"message": "Validation failed"
}{
"message": "Unauthorized"
}{
"message": "Internal server error"
}Products
List products
List products with pagination, filtering, and sorting. Results are automatically filtered by the authenticated merchant unless a different merchantId is provided in the filter.
POST
/
products
/
list
List products
curl --request POST \
--url https://api.sandbox.cheqpay.mx/lps/products/list \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"page": 1,
"limit": 10,
"filter": {
"search": "Premium"
},
"sort": {
"field": "createdAt",
"order": "desc"
}
}
'import requests
url = "https://api.sandbox.cheqpay.mx/lps/products/list"
payload = {
"page": 1,
"limit": 10,
"filter": { "search": "Premium" },
"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'},
sort: {field: 'createdAt', order: 'desc'}
})
};
fetch('https://api.sandbox.cheqpay.mx/lps/products/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/products/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'
],
'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/products/list"
payload := strings.NewReader("{\n \"page\": 1,\n \"limit\": 10,\n \"filter\": {\n \"search\": \"Premium\"\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/products/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 },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/products/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 },\n \"sort\": {\n \"field\": \"createdAt\",\n \"order\": \"desc\"\n }\n}"
response = http.request(request)
puts response.read_body{
"data": [
{
"_id": "<string>",
"merchantId": "<string>",
"name": "<string>",
"price": 1,
"id": "<string>",
"description": "<string>",
"status": "active",
"imageUrl": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"deletedAt": "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
Products retrieved successfully
Paginated response containing products
Array of products
Show child attributes
Show child attributes
Current page number
Example:
1
Total number of pages
Example:
5
Total number of products matching the filter
Example:
47
Number of items per page
Example:
10