SPEI(墨西哥电子银行转账)
Quick Reference
WhatSPEI 实时银行转账
Why墨西哥银行间转账系统——7×24 实时结算,无拒付
Reading Time8 分钟
Difficulty初级
Prerequisites身份验证 → 环境配置
什么是 SPEI
SPEI(Sistema de Pagos Electrónicos Interbancarios,墨西哥电子银行转账系统)是由 Banco de México(墨西哥央行)运营的实时银行间转账系统。它支持 7×24 全天候即时转账,使用 CLABE(Clave Bancaria Estandarizada,墨西哥标准银行账号)作为付款引用。
| 特性 | 详情 |
|---|---|
| 市场 | 墨西哥 |
| 币种 | MXN |
| 结算 | 准实时(当日) |
| 可用性 | 7×24×365 |
| 拒付 | 无——不可撤销的 Push 支付 |
| 默认过期时间 | 24 小时(可配置) |
运作方式
1
商户创建收费
您的服务器调用 POST /api/v1/bank/wallet/charge/,设置 type_charge: "spei" 和 currency: "MXN"。
2
A55 生成 CLABE 引用
API(应用程序编程接口)返回 CLABE 号码和付款引用,供客户使用。
3
客户通过 SPEI 转账
客户从银行 App 向提供的 CLABE 发起 SPEI 转账。
4
实时确认
Banco de México 处理转账。A55 收到确认后发送 webhook(网络钩子),状态为 paid。
支付流程
SPEI 生命周期
| 状态 | 说明 |
|---|---|
| issued | CLABE 已生成;等待转账 |
| pending | 已登记;等待 SPEI 转账 |
| paid | SPEI 转账已确认 |
| expired | 截止前未收到转账 |
| failed | 生成或处理错误 |
创建 SPEI 收费
POST
/api/v1/bank/wallet/charge/Bearer Token创建 SPEI 支付- cURL
- Python
- JavaScript
curl -X POST https://core-manager.a55.tech/api/v1/bank/wallet/charge/ \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"wallet_uuid": "00000000-0000-0000-0000-000000000000",
"merchant_id": "11111111-1111-1111-1111-111111111111",
"payer_name": "李明",
"payer_email": "liming@example.com",
"payer_tax_id": "GARC850101HDFRRL09",
"payer_cell_phone": "+5215512345678",
"installment_value": 1500,
"installment_count": 1,
"items": [{"name":"高级套餐","quantity":1,"total_amount":1500,"unit_amount":1500,"sku":"PLAN-MX-001","code":"PM001"}],
"payer_address": {"street":"Av. Reforma","address_number":"222","complement":"Piso 5","neighborhood":"Juárez","city":"Ciudad de México","state":"CDMX","postal_code":"06600","country":"MX"},
"currency": "MXN",
"due_date": "2026-04-05T23:59:59Z",
"description": "高级订阅",
"type_charge": "spei",
"webhook_url": "https://yoursite.com/webhook",
"redirect_url": "https://yoursite.com/confirmation"
}'
import requests
try:
response = requests.post(
"https://core-manager.a55.tech/api/v1/bank/wallet/charge/",
headers={"Authorization": f"Bearer {access_token}", "Content-Type": "application/json"},
json={
"wallet_uuid": "00000000-0000-0000-0000-000000000000",
"merchant_id": "11111111-1111-1111-1111-111111111111",
"payer_name": "李明",
"payer_email": "liming@example.com",
"payer_tax_id": "GARC850101HDFRRL09",
"payer_cell_phone": "+5215512345678",
"installment_value": 1500,
"installment_count": 1,
"items": [{"name": "高级套餐", "quantity": 1, "total_amount": 1500, "unit_amount": 1500, "sku": "PLAN-MX-001", "code": "PM001"}],
"payer_address": {"street": "Av. Reforma", "address_number": "222", "complement": "Piso 5", "neighborhood": "Juárez", "city": "Ciudad de México", "state": "CDMX", "postal_code": "06600", "country": "MX"},
"currency": "MXN",
"due_date": "2026-04-05T23:59:59Z",
"description": "高级订阅",
"type_charge": "spei",
"webhook_url": "https://yoursite.com/webhook",
"redirect_url": "https://yoursite.com/confirmation",
},
)
response.raise_for_status()
data = response.json()
print(f"CLABE:{data['clabe']}")
print(f"付款引用:{data['payment_reference']}")
except requests.exceptions.HTTPError as e:
print(f"请求失败(HTTP {e.response.status_code}):{e.response.text}")
try {
const response = await fetch(
"https://core-manager.a55.tech/api/v1/bank/wallet/charge/",
{
method: "POST",
headers: {
Authorization: `Bearer ${accessToken}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
wallet_uuid: "00000000-0000-0000-0000-000000000000",
merchant_id: "11111111-1111-1111-1111-111111111111",
payer_name: "李明",
payer_email: "liming@example.com",
payer_tax_id: "GARC850101HDFRRL09",
payer_cell_phone: "+5215512345678",
installment_value: 1500,
installment_count: 1,
items: [{ name: "高级套餐", quantity: 1, total_amount: 1500, unit_amount: 1500, sku: "PLAN-MX-001", code: "PM001" }],
payer_address: { street: "Av. Reforma", address_number: "222", complement: "Piso 5", neighborhood: "Juárez", city: "Ciudad de México", state: "CDMX", postal_code: "06600", country: "MX" },
currency: "MXN",
due_date: "2026-04-05T23:59:59Z",
description: "高级订阅",
type_charge: "spei",
webhook_url: "https://yoursite.com/webhook",
redirect_url: "https://yoursite.com/confirmation",
}),
}
);
if (!response.ok) throw new Error(`请求失败(HTTP ${response.status}):${await response.text()}`);
const { clabe, payment_reference } = await response.json();
console.log("CLABE:", clabe);
} catch (err) {
console.error("创建 SPEI 收费失败:", err.message);
}
响应示例
{
"charge_uuid": "b4c2d5e6-7890-abcd-ef12-3456789abcde",
"currency": "MXN",
"type": "spei",
"status": "issued",
"clabe": "646180157042875632",
"payment_reference": "A55-SPE-20261231-001",
"beneficiary_name": "A55 Pagamentos",
"due_date": "2026-04-05T23:59:59Z",
"charge_payment_url": "https://pay.a55.tech/charge/b4c2d5e6-7890-abcd-ef12-3456789abcde"
}
| 字段 | 说明 |
|---|---|
clabe | 18 位 CLABE,SPEI 转账目标账号 |
payment_reference | 客户转账时需填写的引用号 |
beneficiary_name | 显示为转账收款方的名称 |
due_date | 到期时间,过期后收费失效 |
过期
SPEI 默认过期时间为 24 小时。可通过 due_date 配置。过期后,收费标记为 expired 并发送 webhook。
SPEI 转账字段
请突出展示 CLABE、收款方名称、金额和引用号。大多数墨西哥银行 App 需要这四个字段才能完成 SPEI 转账。
结算时间
SPEI 结算为准实时。Banco de México 确认转账后,资金当日可用。
| 场景 | 结算 |
|---|---|
| 工作时间(CST 6:00–17:30) | 数分钟 |
| 非工作时间 / 周末 | 下一个 Banxico 处理周期(通常当日) |
SPEI 处理周期
Banxico 全天以准实时周期处理 SPEI 转账。虽然系统 7×24 运行,非工作时间的转账确认可能稍有延迟,因为它们排队等待下一个处理周期。A55 持续监控结算通知,确认到达后立即触发 webhook。
常见错误
| 错误 | 原因 | 解决方案 |
|---|---|---|
invalid_currency | 币种非 MXN | SPEI 仅支持墨西哥比索 |
invalid_tax_id | RFC/CURP 格式无效 | 确认付款人的墨西哥税号 |
amount_below_minimum | 金额低于服务商最低限额 | 查看 SPEI 最低金额 |
spei_generation_failed | CLABE 生成失败 | 重试;持续失败请联系支持团队 |