Get invoice
curl --request GET \
--url https://api.sandbox.cheqpay.mx/lps/invoices/{id}import requests
url = "https://api.sandbox.cheqpay.mx/lps/invoices/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sandbox.cheqpay.mx/lps/invoices/{id}', 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/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/lps/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/lps/invoices/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"paymentOrderId": "<string>",
"paymentLinkId": "<string>",
"reference": "<string>",
"externalId": "<string>",
"orderNumber": "<string>",
"invoiceNumber": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"totals": {
"total": 123,
"subtotal": 123,
"taxes": 123,
"shipping": 123,
"fees": 123,
"discounts": 123,
"surcharge": 123,
"surchargeRate": 123
},
"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>"
},
"paymentMethod": {
"type": "card",
"card": {
"bin": "<string>",
"brand": "<string>",
"country": "<string>",
"expiryMonth": "<string>",
"expiryYear": "<string>",
"issuerBank": "<string>",
"last4": "<string>",
"type": "<string>"
},
"spei": {
"clabe": "<string>"
},
"cieCashNet": {
"reference": "CIE0000000001",
"convenio": "0123456789",
"clabe": "012345678901234567"
}
},
"status": "pending",
"customFields": [
{
"label": "<string>",
"type": "text",
"value": "<string>"
}
],
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Resource not found"
}{
"message": "Internal server error"
}Invoices
Get invoice
Retrieve an invoice by ID
GET
/
invoices
/
{id}
Get invoice
curl --request GET \
--url https://api.sandbox.cheqpay.mx/lps/invoices/{id}import requests
url = "https://api.sandbox.cheqpay.mx/lps/invoices/{id}"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.sandbox.cheqpay.mx/lps/invoices/{id}', 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/invoices/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$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/lps/invoices/{id}"
req, _ := http.NewRequest("GET", url, nil)
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/lps/invoices/{id}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/lps/invoices/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"_id": "<string>",
"customerId": "<string>",
"merchantId": "<string>",
"paymentOrderId": "<string>",
"paymentLinkId": "<string>",
"reference": "<string>",
"externalId": "<string>",
"orderNumber": "<string>",
"invoiceNumber": "<string>",
"products": [
{
"name": "<string>",
"qty": 2,
"price": 1,
"total": 1,
"id": "<string>",
"description": "<string>",
"imageUrl": "<string>",
"isQtyAdjustable": true,
"minQty": 123,
"maxQty": 123
}
],
"totals": {
"total": 123,
"subtotal": 123,
"taxes": 123,
"shipping": 123,
"fees": 123,
"discounts": 123,
"surcharge": 123,
"surchargeRate": 123
},
"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>"
},
"paymentMethod": {
"type": "card",
"card": {
"bin": "<string>",
"brand": "<string>",
"country": "<string>",
"expiryMonth": "<string>",
"expiryYear": "<string>",
"issuerBank": "<string>",
"last4": "<string>",
"type": "<string>"
},
"spei": {
"clabe": "<string>"
},
"cieCashNet": {
"reference": "CIE0000000001",
"convenio": "0123456789",
"clabe": "012345678901234567"
}
},
"status": "pending",
"customFields": [
{
"label": "<string>",
"type": "text",
"value": "<string>"
}
],
"metadata": {},
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z"
}{
"message": "Resource not found"
}{
"message": "Internal server error"
}Path Parameters
Invoice ID (MongoDB ObjectId)
Pattern:
^[a-f\d]{24}$Response
Invoice retrieved successfully
Invoice details
Invoice ID
Customer ID
Merchant ID
Pattern:
^[a-f\d]{24}$Payment order ID
Payment link ID
Merchant reference
Merchant reference
Order number
Merchant-provided invoice number; shown to customers instead of orderNumber when present
Products in the invoice
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Address information
Show child attributes
Show child attributes
Address information
Show child attributes
Show child attributes
Payment method details
Show child attributes
Show child attributes
Invoice status
Available options:
pending, paid, cancelled, refunded, failed, abandoned Snapshot of the customer-submitted answers for the payment link's custom fields
Show child attributes
Show child attributes
Additional metadata
Creation timestamp
Last update timestamp