Passer au contenu principal
GET
/
balance
Obtenir le Solde du Service
curl --request GET \
  --url https://sandbox.fapshi.com/balance \
  --header 'apikey: <api-key>' \
  --header 'apiuser: <api-key>'
const options = {method: 'GET', headers: {apiuser: '<api-key>', apikey: '<api-key>'}};

fetch('https://sandbox.fapshi.com/balance', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.fapshi.com/balance",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"apikey: <api-key>",
"apiuser: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
import requests

url = "https://sandbox.fapshi.com/balance"

headers = {
"apiuser": "<api-key>",
"apikey": "<api-key>"
}

response = requests.get(url, headers=headers)

print(response.text)
HttpResponse<String> response = Unirest.get("https://sandbox.fapshi.com/balance")
.header("apiuser", "<api-key>")
.header("apikey", "<api-key>")
.asString();
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://sandbox.fapshi.com/balance"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("apiuser", "<api-key>")
req.Header.Add("apikey", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "service": "<string>",
  "balance": 123,
  "currency": "<string>"
}

Endpoint

GET /balance Retourne le solde actuel du compte du service.
Le solde en environnement sandbox est généré aléatoirement à chaque requête.

Autorisations

apiuser
string
header
requis
apikey
string
header
requis

Réponse

200 - application/json

Solde actuel retourné

service
string

Le service dont vous avez interrogé le solde.

balance
integer

Montant du solde actuel.

currency
string

Devise.