List invoices for a subscription
curl --request GET \
--url https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices"
headers = {
"x-api-key": "<api-key>",
"x-merchant-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'x-merchant-id': '<api-key>'}
};
fetch('https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices', 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/pos/v1/subscriptions/{id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-merchant-id: <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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-merchant-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices")
.header("x-api-key", "<api-key>")
.header("x-merchant-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-merchant-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"subscriptionId": "123e4567-e89b-12d3-a456-426614174001",
"amount": "9900",
"currency": "MXN",
"status": "PAID",
"periodStart": "2025-01-01T00:00:00.000Z",
"periodEnd": "2025-02-01T00:00:00.000Z",
"dueDate": "2025-01-01T00:00:00.000Z",
"attemptCount": 1,
"maxRetries": 3,
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T12:00:00.000Z",
"paymentOrderId": "123e4567-e89b-12d3-a456-426614174002",
"paidAt": "2025-01-01T12:00:00.000Z",
"nextRetryAt": null,
"lastFailureReason": null,
"metadata": {},
"subscription": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
}
],
"pagination": {
"total": 50,
"limit": 20,
"page": 1,
"hasMore": true
}
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"message": "Invalid api key"
}{
"message": "Merchant not found"
}{
"message": "Error message"
}Subscription Invoice
List invoices for a subscription
Retrieves a paginated list of invoices for a specific subscription with optional filtering by status.
GET
/
v1
/
subscriptions
/
{id}
/
invoices
List invoices for a subscription
curl --request GET \
--url https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices"
headers = {
"x-api-key": "<api-key>",
"x-merchant-id": "<api-key>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'x-api-key': '<api-key>', 'x-merchant-id': '<api-key>'}
};
fetch('https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices', 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/pos/v1/subscriptions/{id}/invoices",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>",
"x-merchant-id: <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"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-merchant-id", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices")
.header("x-api-key", "<api-key>")
.header("x-merchant-id", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v1/subscriptions/{id}/invoices")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
request["x-merchant-id"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"subscriptionId": "123e4567-e89b-12d3-a456-426614174001",
"amount": "9900",
"currency": "MXN",
"status": "PAID",
"periodStart": "2025-01-01T00:00:00.000Z",
"periodEnd": "2025-02-01T00:00:00.000Z",
"dueDate": "2025-01-01T00:00:00.000Z",
"attemptCount": 1,
"maxRetries": 3,
"createdAt": "2025-01-01T00:00:00.000Z",
"updatedAt": "2025-01-01T12:00:00.000Z",
"paymentOrderId": "123e4567-e89b-12d3-a456-426614174002",
"paidAt": "2025-01-01T12:00:00.000Z",
"nextRetryAt": null,
"lastFailureReason": null,
"metadata": {},
"subscription": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"customerId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"planId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "<string>",
"plan": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>"
}
}
}
],
"pagination": {
"total": 50,
"limit": 20,
"page": 1,
"hasMore": true
}
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"message": "Invalid api key"
}{
"message": "Merchant not found"
}{
"message": "Error message"
}Authorizations
API key for authentication (required)
Merchant ID for identifying the merchant (required)
Path Parameters
Subscription unique identifier
Query Parameters
Number of invoices to return per page (max 100)
Required range:
1 <= x <= 100Page number (starts from 1)
Required range:
x >= 1Filter by invoice status
Available options:
DRAFT, OPEN, PAID, VOID, UNCOLLECTIBLE