POST
getTransfer
Consulta el estado y detalles de una transferencia SPEI específica. Puedes buscar por el `id` interno de Magic Pay o por tu `transferId`.
Endpoint
POST
https://magicpay.b4a.io/functions/getTransferHeaders
| Header | Valor |
|---|---|
| Content-Type | application/json |
| x-parse-application-id | YOUR_APP_ID |
| x-parse-rest-api-key | YOUR_REST_KEY |
Parámetros
| Nombre | Tipo | Requerido | Descripción |
|---|---|---|---|
| apiKey | string | Sí | Tu API key de merchant. |
| id | string | No | ID interno de Magic Pay (objectId). Alternativa a `transferId`. |
| transferId | string | No | Tu ID de transferencia (el que enviaste en `speiTransfer`). Al menos uno entre `id` y `transferId` es requerido. |
Ejemplo de Request
cURL
curl -X POST 'https://magicpay.b4a.io/functions/getTransfer' \
-H 'Content-Type: application/json' \
-H 'x-parse-application-id: YOUR_APP_ID' \
-H 'x-parse-rest-api-key: YOUR_REST_KEY' \
-d '{
"apiKey": "pk_live_xxxxxxxxxxxxx",
"transferId": "PAY20240115001"
}'JavaScript
const response = await fetch('https://magicpay.b4a.io/functions/getTransfer', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'x-parse-application-id': 'YOUR_APP_ID',
'x-parse-rest-api-key': 'YOUR_REST_KEY',
},
body: JSON.stringify({
"apiKey": "pk_live_xxxxxxxxxxxxx",
"transferId": "PAY20240115001"
}),
});
const data = await response.json();
console.log(data);Ejemplo de Respuesta
JSON
{
"result": {
"id": "abc123def456",
"transferId": "PAY20240115001",
"trackingId": "PAY20240115001",
"status": "paid",
"description": "Pago de servicio",
"account": "012180015025354012",
"numReference": "1234567",
"amount": 150.5,
"fee": 3.48,
"bank": "BBVA MEXICO",
"owner": "JUAN PEREZ LOPEZ",
"createdAt": 1705286400000,
"balance": 10000,
"ownerFullName": "JUAN PEREZ LOPEZ MARTINEZ",
"ownerRfc": "PELJ900101XXX"
}
}Campos del response
| Campo | Tipo | Descripción |
|---|---|---|
| id | string | ID interno de Magic Pay |
| transferId | string | Tu ID de transferencia |
| trackingId | string | Clave de rastreo SPEI |
| status | string | in_process | paid | returned | failed |
| failureReason | string | Razón del fallo (solo si returned o failed) |
| description | string | Concepto de pago |
| account | string | Cuenta destino |
| numReference | string | Referencia numérica |
| amount | number | Monto en MXN |
| fee | number | Comisión cobrada (MXN + IVA) |
| bank | string | Banco destino |
| owner | string | Nombre del beneficiario |
| createdAt | number | Timestamp en milisegundos (epoch) |
| balance | number | Saldo del merchant al momento de la transferencia |
| ownerFullName | string | Nombre completo del CEP (solo en paid) |
| ownerRfc | string | RFC del beneficiario del CEP (solo en paid) |
| returnedAt | number | Timestamp de devolución (si fue devuelta) |
Estados posibles: in_process (procesándose), paid (exitosa, confirmada), returned (devuelta), failed (fallida). Cuando el status es paid, se incluyen los campos ownerFullName y ownerRfc del CEP (Comprobante Electrónico de Pago).