POST
getPayments
Lista los pagos SPEI recibidos en tu cuenta, con filtros opcionales.
Endpoint
POST
https://magicpay.b4a.io/functions/getPaymentsHeaders
| 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. |
| skip | number | No | Registros a saltar (paginación). Default: 0. |
| limit | number | No | Cantidad de registros. Default: 200, máximo: 1000. |
| before | date | No | Pagos antes de esta fecha. Formato: "YYYYMMDD" o timestamp. |
| after | date | No | Pagos después de esta fecha. Formato: "YYYYMMDD" o timestamp. |
| receiverAccount | string | No | Filtrar por CLABE receptora (exacta). |
| amount | number | No | Filtrar pagos con monto ≥ a este valor. |
| payerAccount | string | No | Filtrar por cuenta del pagador (exacta). |
| bank | bank | No | Filtrar por banco del pagador (case insensitive). |
| payerName | string | No | Filtrar por nombre del pagador (case insensitive). |
| transferId | string | No | Filtrar por clave de rastreo SPEI (exacta). |
Ejemplo de Request
cURL
curl -X POST 'https://magicpay.b4a.io/functions/getPayments' \
-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",
"limit": 100,
"after": "20240101"
}'JavaScript
const response = await fetch('https://magicpay.b4a.io/functions/getPayments', {
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",
"limit": 100,
"after": "20240101"
}),
});
const data = await response.json();
console.log(data);Ejemplo de Respuesta
JSON
{
"result": [
{
"id": "xyz789abc012",
"transferId": "MXBANORTE20240115123456",
"status": "completed",
"description": "PAGO FACTURA 001",
"account": "072180012345678901",
"numReference": "1234567",
"amount": 5000,
"bank": "BANORTE",
"payerName": "EMPRESA SA DE CV",
"createdAt": 1705286400000,
"receiverAccount": "646180202710010018"
}
]
}Campos del response
| Campo | Tipo | Descripción |
|---|---|---|
| id | string | ID interno de Magic Pay |
| transferId | string | Clave de rastreo SPEI |
| status | string | Estado del pago |
| description | string | Concepto de pago |
| account | string | Cuenta del pagador |
| numReference | string | Referencia numérica |
| amount | number | Monto recibido en MXN |
| bank | string | Banco del pagador |
| payerName | string | Nombre del pagador |
| createdAt | number | Timestamp en milisegundos |
| receiverAccount | string | CLABE donde se recibió el pago |