POST

getBalance

Consulta el saldo disponible de tu cuenta Magic Pay en tiempo real.

Endpoint

POSThttps://magicpay.b4a.io/functions/getBalance

Headers

HeaderValor
Content-Typeapplication/json
x-parse-application-idYOUR_APP_ID
x-parse-rest-api-keyYOUR_REST_KEY

Parámetros

NombreTipoRequeridoDescripción
apiKeystringTu 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
  }
}