curl --request POST \
--url https://sandbox.mx.ntxpay.com/api/spei/cash-in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountCentavos": 50000,
"customerName": "Juan Perez",
"customerEmail": "juan@example.com",
"externalId": "order-abc-123",
"description": "Pedido #123",
"customerTaxId": "PEPJ800101ABC"
}
'import requests
url = "https://sandbox.mx.ntxpay.com/api/spei/cash-in"
payload = {
"amountCentavos": 50000,
"customerName": "Juan Perez",
"customerEmail": "juan@example.com",
"externalId": "order-abc-123",
"description": "Pedido #123",
"customerTaxId": "PEPJ800101ABC"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amountCentavos: 50000,
customerName: 'Juan Perez',
customerEmail: 'juan@example.com',
externalId: 'order-abc-123',
description: 'Pedido #123',
customerTaxId: 'PEPJ800101ABC'
})
};
fetch('https://sandbox.mx.ntxpay.com/api/spei/cash-in', 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://sandbox.mx.ntxpay.com/api/spei/cash-in",
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([
'amountCentavos' => 50000,
'customerName' => 'Juan Perez',
'customerEmail' => 'juan@example.com',
'externalId' => 'order-abc-123',
'description' => 'Pedido #123',
'customerTaxId' => 'PEPJ800101ABC'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://sandbox.mx.ntxpay.com/api/spei/cash-in"
payload := strings.NewReader("{\n \"amountCentavos\": 50000,\n \"customerName\": \"Juan Perez\",\n \"customerEmail\": \"juan@example.com\",\n \"externalId\": \"order-abc-123\",\n \"description\": \"Pedido #123\",\n \"customerTaxId\": \"PEPJ800101ABC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://sandbox.mx.ntxpay.com/api/spei/cash-in")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountCentavos\": 50000,\n \"customerName\": \"Juan Perez\",\n \"customerEmail\": \"juan@example.com\",\n \"externalId\": \"order-abc-123\",\n \"description\": \"Pedido #123\",\n \"customerTaxId\": \"PEPJ800101ABC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.mx.ntxpay.com/api/spei/cash-in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCentavos\": 50000,\n \"customerName\": \"Juan Perez\",\n \"customerEmail\": \"juan@example.com\",\n \"externalId\": \"order-abc-123\",\n \"description\": \"Pedido #123\",\n \"customerTaxId\": \"PEPJ800101ABC\"\n}"
response = http.request(request)
puts response.read_body{
"transactionId": "3f2a1c34-9d1e-4c7b-8a5e-2b6f0d9c4e71",
"status": "PENDING",
"destinationClabe": "012180001234567890",
"beneficiary": {
"name": "NTX Pay MX",
"taxId": "NTX800101ABC"
},
"referenceNumerical": "1234567",
"checkoutUrl": "https://pay.ntxpay.com/checkout/xyz",
"expiresAt": "2026-05-14T23:59:59.000Z",
"amountCentavos": 50000
}Criar cobrança SPEI (cash-in)
Requer Bearer JWT. Gera uma CLABE descartável de destino que o pagador deve usar em uma transferência SPEI. Confirmação assíncrona via webhook cash_in.
curl --request POST \
--url https://sandbox.mx.ntxpay.com/api/spei/cash-in \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amountCentavos": 50000,
"customerName": "Juan Perez",
"customerEmail": "juan@example.com",
"externalId": "order-abc-123",
"description": "Pedido #123",
"customerTaxId": "PEPJ800101ABC"
}
'import requests
url = "https://sandbox.mx.ntxpay.com/api/spei/cash-in"
payload = {
"amountCentavos": 50000,
"customerName": "Juan Perez",
"customerEmail": "juan@example.com",
"externalId": "order-abc-123",
"description": "Pedido #123",
"customerTaxId": "PEPJ800101ABC"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amountCentavos: 50000,
customerName: 'Juan Perez',
customerEmail: 'juan@example.com',
externalId: 'order-abc-123',
description: 'Pedido #123',
customerTaxId: 'PEPJ800101ABC'
})
};
fetch('https://sandbox.mx.ntxpay.com/api/spei/cash-in', 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://sandbox.mx.ntxpay.com/api/spei/cash-in",
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([
'amountCentavos' => 50000,
'customerName' => 'Juan Perez',
'customerEmail' => 'juan@example.com',
'externalId' => 'order-abc-123',
'description' => 'Pedido #123',
'customerTaxId' => 'PEPJ800101ABC'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"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://sandbox.mx.ntxpay.com/api/spei/cash-in"
payload := strings.NewReader("{\n \"amountCentavos\": 50000,\n \"customerName\": \"Juan Perez\",\n \"customerEmail\": \"juan@example.com\",\n \"externalId\": \"order-abc-123\",\n \"description\": \"Pedido #123\",\n \"customerTaxId\": \"PEPJ800101ABC\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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://sandbox.mx.ntxpay.com/api/spei/cash-in")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amountCentavos\": 50000,\n \"customerName\": \"Juan Perez\",\n \"customerEmail\": \"juan@example.com\",\n \"externalId\": \"order-abc-123\",\n \"description\": \"Pedido #123\",\n \"customerTaxId\": \"PEPJ800101ABC\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://sandbox.mx.ntxpay.com/api/spei/cash-in")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amountCentavos\": 50000,\n \"customerName\": \"Juan Perez\",\n \"customerEmail\": \"juan@example.com\",\n \"externalId\": \"order-abc-123\",\n \"description\": \"Pedido #123\",\n \"customerTaxId\": \"PEPJ800101ABC\"\n}"
response = http.request(request)
puts response.read_body{
"transactionId": "3f2a1c34-9d1e-4c7b-8a5e-2b6f0d9c4e71",
"status": "PENDING",
"destinationClabe": "012180001234567890",
"beneficiary": {
"name": "NTX Pay MX",
"taxId": "NTX800101ABC"
},
"referenceNumerical": "1234567",
"checkoutUrl": "https://pay.ntxpay.com/checkout/xyz",
"expiresAt": "2026-05-14T23:59:59.000Z",
"amountCentavos": 50000
}Autorizações
JWT obtido em POST /api/auth/token
Corpo
Amount in MXN centavos. Minimum 1000 centavos (10.00 MXN) — partner bank floor.
x >= 100050000
Nome do pagador (mostrado no checkout SPEI)
1 - 255"Juan Perez"
Email do pagador
"juan@example.com"
Identificador externo / referência do cliente.
1 - 100"order-abc-123"
1 - 255"Pedido #123"
RFC/CURP do pagador
10 - 20"PEPJ800101ABC"
Resposta
Cobrança SPEI criada (PENDING)
Identificador publico da transacao (UUID). E o mesmo transactionId entregue nos webhooks — use-o para correlacionar e consultar a transacao.
"3f2a1c34-9d1e-4c7b-8a5e-2b6f0d9c4e71"
PENDING, CONFIRMED, FAILED, EXPIRED "PENDING"
CLABE descartável de destino para o pagador transferir
"012180001234567890"
Show child attributes
Show child attributes
"1234567"
"https://pay.ntxpay.com/checkout/xyz"
"2026-05-14T23:59:59.000Z"
50000