curl --request PUT \
--url https://api.sandbox.cheqpay.mx/pos/v2/customers/{id} \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"active": true,
"notificationOptions": {
"notifyEmail": false,
"notifyPhone": false
},
"taxId": "VTH981105F90",
"billingAddress": {
"countryCode": "MX",
"line1": "Av. Reforma 123",
"line2": "Piso 4",
"city": "CDMX",
"state": "Ciudad de México",
"postalCode": "06600"
}
}
EOFimport requests
url = "https://api.sandbox.cheqpay.mx/pos/v2/customers/{id}"
payload = {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"active": True,
"notificationOptions": {
"notifyEmail": False,
"notifyPhone": False
},
"taxId": "VTH981105F90",
"billingAddress": {
"countryCode": "MX",
"line1": "Av. Reforma 123",
"line2": "Piso 4",
"city": "CDMX",
"state": "Ciudad de México",
"postalCode": "06600"
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
email: 'john.doe@example.com',
phoneNumber: '+1234567890',
displayName: 'Johnny',
accountName: 'John Doe\'s Account',
notes: 'VIP customer',
active: true,
notificationOptions: {notifyEmail: false, notifyPhone: false},
taxId: 'VTH981105F90',
billingAddress: {
countryCode: 'MX',
line1: 'Av. Reforma 123',
line2: 'Piso 4',
city: 'CDMX',
state: 'Ciudad de México',
postalCode: '06600'
}
})
};
fetch('https://api.sandbox.cheqpay.mx/pos/v2/customers/{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/pos/v2/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'john.doe@example.com',
'phoneNumber' => '+1234567890',
'displayName' => 'Johnny',
'accountName' => 'John Doe\'s Account',
'notes' => 'VIP customer',
'active' => true,
'notificationOptions' => [
'notifyEmail' => false,
'notifyPhone' => false
],
'taxId' => 'VTH981105F90',
'billingAddress' => [
'countryCode' => 'MX',
'line1' => 'Av. Reforma 123',
'line2' => 'Piso 4',
'city' => 'CDMX',
'state' => 'Ciudad de México',
'postalCode' => '06600'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/v2/customers/{id}"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\n \"active\": true,\n \"notificationOptions\": {\n \"notifyEmail\": false,\n \"notifyPhone\": false\n },\n \"taxId\": \"VTH981105F90\",\n \"billingAddress\": {\n \"countryCode\": \"MX\",\n \"line1\": \"Av. Reforma 123\",\n \"line2\": \"Piso 4\",\n \"city\": \"CDMX\",\n \"state\": \"Ciudad de México\",\n \"postalCode\": \"06600\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.sandbox.cheqpay.mx/pos/v2/customers/{id}")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\n \"active\": true,\n \"notificationOptions\": {\n \"notifyEmail\": false,\n \"notifyPhone\": false\n },\n \"taxId\": \"VTH981105F90\",\n \"billingAddress\": {\n \"countryCode\": \"MX\",\n \"line1\": \"Av. Reforma 123\",\n \"line2\": \"Piso 4\",\n \"city\": \"CDMX\",\n \"state\": \"Ciudad de México\",\n \"postalCode\": \"06600\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v2/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\n \"active\": true,\n \"notificationOptions\": {\n \"notifyEmail\": false,\n \"notifyPhone\": false\n },\n \"taxId\": \"VTH981105F90\",\n \"billingAddress\": {\n \"countryCode\": \"MX\",\n \"line1\": \"Av. Reforma 123\",\n \"line2\": \"Piso 4\",\n \"city\": \"CDMX\",\n \"state\": \"Ciudad de México\",\n \"postalCode\": \"06600\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"active": true,
"notificationOptions": {
"notifyEmail": true,
"notifyPhone": false
},
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z"
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"error": {
"code": "NOT_FOUND",
"message": "Customer not found"
}
}{
"message": "Error message"
}Update customer (v2)
Updates an existing customer. All fields are optional - only provided fields will be updated.
curl --request PUT \
--url https://api.sandbox.cheqpay.mx/pos/v2/customers/{id} \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"active": true,
"notificationOptions": {
"notifyEmail": false,
"notifyPhone": false
},
"taxId": "VTH981105F90",
"billingAddress": {
"countryCode": "MX",
"line1": "Av. Reforma 123",
"line2": "Piso 4",
"city": "CDMX",
"state": "Ciudad de México",
"postalCode": "06600"
}
}
EOFimport requests
url = "https://api.sandbox.cheqpay.mx/pos/v2/customers/{id}"
payload = {
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"active": True,
"notificationOptions": {
"notifyEmail": False,
"notifyPhone": False
},
"taxId": "VTH981105F90",
"billingAddress": {
"countryCode": "MX",
"line1": "Av. Reforma 123",
"line2": "Piso 4",
"city": "CDMX",
"state": "Ciudad de México",
"postalCode": "06600"
}
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
lastName: 'Doe',
email: 'john.doe@example.com',
phoneNumber: '+1234567890',
displayName: 'Johnny',
accountName: 'John Doe\'s Account',
notes: 'VIP customer',
active: true,
notificationOptions: {notifyEmail: false, notifyPhone: false},
taxId: 'VTH981105F90',
billingAddress: {
countryCode: 'MX',
line1: 'Av. Reforma 123',
line2: 'Piso 4',
city: 'CDMX',
state: 'Ciudad de México',
postalCode: '06600'
}
})
};
fetch('https://api.sandbox.cheqpay.mx/pos/v2/customers/{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/pos/v2/customers/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'firstName' => 'John',
'lastName' => 'Doe',
'email' => 'john.doe@example.com',
'phoneNumber' => '+1234567890',
'displayName' => 'Johnny',
'accountName' => 'John Doe\'s Account',
'notes' => 'VIP customer',
'active' => true,
'notificationOptions' => [
'notifyEmail' => false,
'notifyPhone' => false
],
'taxId' => 'VTH981105F90',
'billingAddress' => [
'countryCode' => 'MX',
'line1' => 'Av. Reforma 123',
'line2' => 'Piso 4',
'city' => 'CDMX',
'state' => 'Ciudad de México',
'postalCode' => '06600'
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$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/v2/customers/{id}"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\n \"active\": true,\n \"notificationOptions\": {\n \"notifyEmail\": false,\n \"notifyPhone\": false\n },\n \"taxId\": \"VTH981105F90\",\n \"billingAddress\": {\n \"countryCode\": \"MX\",\n \"line1\": \"Av. Reforma 123\",\n \"line2\": \"Piso 4\",\n \"city\": \"CDMX\",\n \"state\": \"Ciudad de México\",\n \"postalCode\": \"06600\"\n }\n}")
req, _ := http.NewRequest("PUT", url, payload)
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.put("https://api.sandbox.cheqpay.mx/pos/v2/customers/{id}")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\n \"active\": true,\n \"notificationOptions\": {\n \"notifyEmail\": false,\n \"notifyPhone\": false\n },\n \"taxId\": \"VTH981105F90\",\n \"billingAddress\": {\n \"countryCode\": \"MX\",\n \"line1\": \"Av. Reforma 123\",\n \"line2\": \"Piso 4\",\n \"city\": \"CDMX\",\n \"state\": \"Ciudad de México\",\n \"postalCode\": \"06600\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.sandbox.cheqpay.mx/pos/v2/customers/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"lastName\": \"Doe\",\n \"email\": \"john.doe@example.com\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\n \"active\": true,\n \"notificationOptions\": {\n \"notifyEmail\": false,\n \"notifyPhone\": false\n },\n \"taxId\": \"VTH981105F90\",\n \"billingAddress\": {\n \"countryCode\": \"MX\",\n \"line1\": \"Av. Reforma 123\",\n \"line2\": \"Piso 4\",\n \"city\": \"CDMX\",\n \"state\": \"Ciudad de México\",\n \"postalCode\": \"06600\"\n }\n}"
response = http.request(request)
puts response.read_body{
"id": "123e4567-e89b-12d3-a456-426614174000",
"firstName": "John",
"lastName": "Doe",
"email": "john.doe@example.com",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"active": true,
"notificationOptions": {
"notifyEmail": true,
"notifyPhone": false
},
"createdAt": "2025-01-15T10:00:00.000Z",
"updatedAt": "2025-01-15T10:00:00.000Z"
}{
"message": "Validation failed",
"errors": [
{
"field": "name",
"message": "Required"
}
]
}{
"error": {
"code": "NOT_FOUND",
"message": "Customer not found"
}
}{
"message": "Error message"
}Path Parameters
Customer unique identifier
Body
Customer's first name
1"John"
Customer's last name
"Doe"
Customer's email address
"john.doe@example.com"
Customer's phone number
"+1234567890"
Display name for the customer
"Johnny"
Account name associated with the customer
"John Doe's Account"
Free-form notes about the customer
"VIP customer"
Whether the customer is active
true
Customer notification preferences
Show child attributes
Show child attributes
Customer tax identifier (e.g. RFC)
50"VTH981105F90"
Object upserts the billing address; null removes it; omitted leaves it unchanged.
Show child attributes
Show child attributes
Response
Customer updated successfully
Unique customer identifier
"123e4567-e89b-12d3-a456-426614174000"
Merchant that owns this customer
"123e4567-e89b-12d3-a456-426614174111"
Legacy copy-on-write source customer id (always null for new customers)
null
Customer's first name
"John"
Customer's last name
"Doe"
Customer's email address
"john.doe@example.com"
Customer's phone number
"+1234567890"
Display name for the customer
"Johnny"
Account name associated with the customer
"John Doe's Account"
Free-form notes about the customer
"VIP customer"
Whether the customer is active
true
Customer notification preferences
Show child attributes
Show child attributes
Customer creation timestamp
"2025-01-15T10:00:00.000Z"
Customer last update timestamp
"2025-01-15T10:00:00.000Z"
Customer tax identifier (e.g. RFC)
50"VTH981105F90"
Billing address managed through the customer endpoints (no standalone address CRUD).
Show child attributes
Show child attributes