curl --request GET \
--url https://api.sandbox.cheqpay.mx/pos/v2/customers/{customerId}/payment-methods \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v2/customers/{customerId}/payment-methods"
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/v2/customers/{customerId}/payment-methods', 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/v2/customers/{customerId}/payment-methods",
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/v2/customers/{customerId}/payment-methods"
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/v2/customers/{customerId}/payment-methods")
.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/v2/customers/{customerId}/payment-methods")
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[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "CARD",
"isDefault": false,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z",
"nickname": "My Visa Card",
"billingFirstName": "John",
"billingLastName": "Doe",
"billingPhoneNumber": "+525512345678",
"billingEmail": "john.doe@example.com",
"billingAddressLine1": "123 Main St",
"billingAddressLine2": "Apt 4B",
"billingCity": "Mexico City",
"billingState": "CDMX",
"billingPostalCode": "12345",
"billingCountry": "MX",
"cardDetails": {
"last4": "1111",
"bin": "411111",
"expMonth": 12,
"expYear": 25,
"type": "credit",
"brand": "VISA",
"country": "US",
"issuerBank": "Chase Bank"
}
}
]{
"message": "Invalid api key"
}{
"message": "Error message"
}List payment methods for a customer
Retrieves all payment methods associated with a specific customer. Returns an array of payment methods with masked card information.
curl --request GET \
--url https://api.sandbox.cheqpay.mx/pos/v2/customers/{customerId}/payment-methods \
--header 'x-api-key: <api-key>' \
--header 'x-merchant-id: <api-key>'import requests
url = "https://api.sandbox.cheqpay.mx/pos/v2/customers/{customerId}/payment-methods"
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/v2/customers/{customerId}/payment-methods', 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/v2/customers/{customerId}/payment-methods",
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/v2/customers/{customerId}/payment-methods"
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/v2/customers/{customerId}/payment-methods")
.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/v2/customers/{customerId}/payment-methods")
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[
{
"id": "123e4567-e89b-12d3-a456-426614174000",
"type": "CARD",
"isDefault": false,
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z",
"nickname": "My Visa Card",
"billingFirstName": "John",
"billingLastName": "Doe",
"billingPhoneNumber": "+525512345678",
"billingEmail": "john.doe@example.com",
"billingAddressLine1": "123 Main St",
"billingAddressLine2": "Apt 4B",
"billingCity": "Mexico City",
"billingState": "CDMX",
"billingPostalCode": "12345",
"billingCountry": "MX",
"cardDetails": {
"last4": "1111",
"bin": "411111",
"expMonth": 12,
"expYear": 25,
"type": "credit",
"brand": "VISA",
"country": "US",
"issuerBank": "Chase Bank"
}
}
]{
"message": "Invalid api key"
}{
"message": "Error message"
}Authorizations
API key for authentication (required)
Merchant ID for identifying the merchant (required)
Path Parameters
Customer ID
"123e4567-e89b-12d3-a456-426614174000"
Response
Payment methods retrieved successfully
Payment method ID
"123e4567-e89b-12d3-a456-426614174000"
Payment method type
"CARD"
Whether this is the default payment method
false
Creation timestamp
"2025-01-15T10:00:00.000Z"
Last update timestamp
"2025-01-15T10:00:00.000Z"
Payment method nickname
"My Visa Card"
Billing first name
"John"
Billing last name
"Doe"
Billing phone number
"+525512345678"
Billing email address
"john.doe@example.com"
Billing address line 1
"123 Main St"
Billing address line 2
"Apt 4B"
Billing city
"Mexico City"
Billing state
"CDMX"
Billing postal code
"12345"
Billing country code
"MX"
Show child attributes
Show child attributes