curl --request POST \
--url https://api.sandbox.cheqpay.mx/pos/v2/customers \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"firstName": "John",
"email": "john.doe@example.com",
"lastName": "Doe",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"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"
payload = {
"firstName": "John",
"email": "john.doe@example.com",
"lastName": "Doe",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
email: 'john.doe@example.com',
lastName: 'Doe',
phoneNumber: '+1234567890',
displayName: 'Johnny',
accountName: 'John Doe\'s Account',
notes: 'VIP customer',
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', 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",
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([
'firstName' => 'John',
'email' => 'john.doe@example.com',
'lastName' => 'Doe',
'phoneNumber' => '+1234567890',
'displayName' => 'Johnny',
'accountName' => 'John Doe\'s Account',
'notes' => 'VIP customer',
'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"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"email\": \"john.doe@example.com\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\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("POST", 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.post("https://api.sandbox.cheqpay.mx/pos/v2/customers")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"email\": \"john.doe@example.com\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"email\": \"john.doe@example.com\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\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"
}
]
}{
"message": "Error message"
}Create a new customer (v2)
Creates a new customer for the authenticated merchant. Does not require an external ID.
curl --request POST \
--url https://api.sandbox.cheqpay.mx/pos/v2/customers \
--header 'Content-Type: application/json' \
--data @- <<EOF
{
"firstName": "John",
"email": "john.doe@example.com",
"lastName": "Doe",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"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"
payload = {
"firstName": "John",
"email": "john.doe@example.com",
"lastName": "Doe",
"phoneNumber": "+1234567890",
"displayName": "Johnny",
"accountName": "John Doe's Account",
"notes": "VIP customer",
"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.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
firstName: 'John',
email: 'john.doe@example.com',
lastName: 'Doe',
phoneNumber: '+1234567890',
displayName: 'Johnny',
accountName: 'John Doe\'s Account',
notes: 'VIP customer',
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', 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",
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([
'firstName' => 'John',
'email' => 'john.doe@example.com',
'lastName' => 'Doe',
'phoneNumber' => '+1234567890',
'displayName' => 'Johnny',
'accountName' => 'John Doe\'s Account',
'notes' => 'VIP customer',
'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"
payload := strings.NewReader("{\n \"firstName\": \"John\",\n \"email\": \"john.doe@example.com\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\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("POST", 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.post("https://api.sandbox.cheqpay.mx/pos/v2/customers")
.header("Content-Type", "application/json")
.body("{\n \"firstName\": \"John\",\n \"email\": \"john.doe@example.com\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\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")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"firstName\": \"John\",\n \"email\": \"john.doe@example.com\",\n \"lastName\": \"Doe\",\n \"phoneNumber\": \"+1234567890\",\n \"displayName\": \"Johnny\",\n \"accountName\": \"John Doe's Account\",\n \"notes\": \"VIP customer\",\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"
}
]
}{
"message": "Error message"
}Body
Customer's first name
"John"
Customer's email address
"john.doe@example.com"
Customer's last name
"Doe"
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"
Customer notification preferences
Show child attributes
Show child attributes
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
Response
Customer created 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