POST
getBalance
Consulta el saldo disponible de tu cuenta Magic Pay en tiempo real.
Endpoint
POST
https://magicpay.b4a.io/functions/getBalanceHeaders
| 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. |
Ejemplo de Request
cURL
curl -X POST 'https://magicpay.b4a.io/functions/getBalance' \
-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"
}'JavaScript
const response = await fetch('https://magicpay.b4a.io/functions/getBalance', {
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"
}),
});
const data = await response.json();
console.log(data);Ejemplo de Respuesta
JSON
{
"result": {
"available": 15234.56
}
}