curl --request POST \
--url https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>' \
--data '{
"force": false
}'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay"
payload = { "force": False }
headers = {
"x-api-key": "<api-key>",
"x-merchant-id": "<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>',
'x-merchant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({force: false})
};
fetch('https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay', 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/subscription-invoices/{id}/pay",
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([
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay"
payload := strings.NewReader("{\n \"force\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-merchant-id", "<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/pos/v1/subscription-invoices/{id}/pay")
.header("x-api-key", "<api-key>")
.header("x-merchant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay")
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["x-merchant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"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>"
}
}
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"message": "Invalid api key"
}{
"message": "Merchant not found"
}{
"message": "Error message"
}Process payment for an invoice
Manually triggers payment processing for a subscription invoice. This is useful for retrying failed payments or processing invoices manually.
curl --request POST \
--url https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>' \
--data '{
"force": false
}'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay"
payload = { "force": False }
headers = {
"x-api-key": "<api-key>",
"x-merchant-id": "<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>',
'x-merchant-id': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({force: false})
};
fetch('https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay', 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/subscription-invoices/{id}/pay",
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([
'force' => false
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay"
payload := strings.NewReader("{\n \"force\": false\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("x-api-key", "<api-key>")
req.Header.Add("x-merchant-id", "<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/pos/v1/subscription-invoices/{id}/pay")
.header("x-api-key", "<api-key>")
.header("x-merchant-id", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"force\": false\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v1/subscription-invoices/{id}/pay")
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["x-merchant-id"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"force\": false\n}"
response = http.request(request)
puts response.read_body{
"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>"
}
}
}{
"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
Invoice unique identifier
Body
Force payment processing even if conditions are not met
false
Response
Payment processed successfully
Unique invoice identifier
"123e4567-e89b-12d3-a456-426614174000"
Associated subscription ID
"123e4567-e89b-12d3-a456-426614174001"
Invoice amount in smallest currency unit
"9900"
Currency code
"MXN"
Invoice status
DRAFT, OPEN, PAID, VOID, UNCOLLECTIBLE "PAID"
Billing period start
"2025-01-01T00:00:00.000Z"
Billing period end
"2025-02-01T00:00:00.000Z"
Payment due date
"2025-01-01T00:00:00.000Z"
Number of payment attempts
1
Maximum number of retry attempts
3
Creation timestamp
"2025-01-01T00:00:00.000Z"
Last update timestamp
"2025-01-01T12:00:00.000Z"
Associated payment order ID
"123e4567-e89b-12d3-a456-426614174002"
When the invoice was paid
"2025-01-01T12:00:00.000Z"
Next retry attempt date
null
Reason for the last failed payment attempt
null
Additional metadata
Associated subscription details
Show child attributes
Show child attributes