> ## Documentation Index
> Fetch the complete documentation index at: https://docs.umeme.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Recharger et suivre son portefeuille

> Le portefeuille finance chaque vente. Suivez son solde, lisez son relevé ligne par ligne, et rechargez-le avant qu'il ne bloque vos ventes.

## 1. Lire le solde

```bash cURL icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/bash.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=c7cc496df6d82b1c6cdaa5c132b8d4bc" theme={"dark"}
curl "$UMEME_BASE_URL/portefeuille" \
  -H "Authorization: Bearer $UMEME_CLE"
```

```javascript Node.js · fetch icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/nodejs.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=60e7eb54ba25d5cb5e9d62e0896b99c7" theme={"dark"}
// Node.js 18 et plus : fetch est intégré.
const baseUrl = process.env.UMEME_BASE_URL;

const reponse = await fetch(`${baseUrl}/portefeuille`, {
  headers: {
    Authorization: `Bearer ${process.env.UMEME_CLE}`,
  },
});
const donnees = await reponse.json();
```

```javascript Node.js · Axios icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/axios.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=7e8bd7e79f903d3d1bffc290e52fcdc9" theme={"dark"}
// npm install axios
import axios from "axios";

const umeme = axios.create({
  baseURL: process.env.UMEME_BASE_URL,
  headers: { Authorization: `Bearer ${process.env.UMEME_CLE}` },
  timeout: 30000,
});

const { data } = await umeme.get("/portefeuille");
```

```python Python icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/python.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=41e570f5c5c97d07c3c878a6704f2bed" theme={"dark"}
import os

import requests

BASE_URL = os.environ["UMEME_BASE_URL"]
ENTETES = {"Authorization": f"Bearer {os.environ['UMEME_CLE']}"}

reponse = requests.get(
    f"{BASE_URL}/portefeuille",
    headers=ENTETES,
    timeout=30,
)
donnees = reponse.json()
```

```php PHP icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/php.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=706823b5881c1d4e78720e369520cc78" theme={"dark"}
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client([
    'base_uri' => getenv('UMEME_BASE_URL') . '/',
    'headers' => ['Authorization' => 'Bearer ' . getenv('UMEME_CLE')],
    'timeout' => 30,
]);

$reponse = $client->get('portefeuille');
$donnees = json_decode($reponse->getBody(), true);
```

```java Java icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/java.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=a99792afd2b2bcd5b3c64f5157b8469e" theme={"dark"}
// Java 15 et plus : java.net.http et blocs de texte.
var baseUrl = System.getenv("UMEME_BASE_URL");
var client = HttpClient.newHttpClient();

var requete = HttpRequest.newBuilder(URI.create(baseUrl + "/portefeuille"))
    .header("Authorization", "Bearer " + System.getenv("UMEME_CLE"))
    .GET()
    .build();

var reponse = client.send(requete, HttpResponse.BodyHandlers.ofString());
```

## 2. Lire le relevé

`GET /v1/portefeuille/mouvements?du=…&au=…` rend chaque mouvement, dans l'ordre, avec le solde après lui. Ajoutez `format=csv` pour un fichier.

```bash cURL icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/bash.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=c7cc496df6d82b1c6cdaa5c132b8d4bc" theme={"dark"}
curl -G "$UMEME_BASE_URL/portefeuille/mouvements" \
  -H "Authorization: Bearer $UMEME_CLE" \
  --data-urlencode "du=2026-11-01" \
  --data-urlencode "au=2026-11-07"
```

```javascript Node.js · fetch icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/nodejs.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=60e7eb54ba25d5cb5e9d62e0896b99c7" theme={"dark"}
// Node.js 18 et plus : fetch est intégré.
const baseUrl = process.env.UMEME_BASE_URL;

const params = new URLSearchParams({
  du: "2026-11-01",
  au: "2026-11-07",
});

const reponse = await fetch(`${baseUrl}/portefeuille/mouvements?${params}`, {
  headers: {
    Authorization: `Bearer ${process.env.UMEME_CLE}`,
  },
});
const donnees = await reponse.json();
```

```javascript Node.js · Axios icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/axios.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=7e8bd7e79f903d3d1bffc290e52fcdc9" theme={"dark"}
// npm install axios
import axios from "axios";

const umeme = axios.create({
  baseURL: process.env.UMEME_BASE_URL,
  headers: { Authorization: `Bearer ${process.env.UMEME_CLE}` },
  timeout: 30000,
});

const { data } = await umeme.get("/portefeuille/mouvements", {
  params: {
    du: "2026-11-01",
    au: "2026-11-07",
  },
});
```

```python Python icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/python.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=41e570f5c5c97d07c3c878a6704f2bed" theme={"dark"}
import os

import requests

BASE_URL = os.environ["UMEME_BASE_URL"]
ENTETES = {"Authorization": f"Bearer {os.environ['UMEME_CLE']}"}

reponse = requests.get(
    f"{BASE_URL}/portefeuille/mouvements",
    headers=ENTETES,
    params={
        "du": "2026-11-01",
        "au": "2026-11-07",
    },
    timeout=30,
)
donnees = reponse.json()
```

```php PHP icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/php.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=706823b5881c1d4e78720e369520cc78" theme={"dark"}
// composer require guzzlehttp/guzzle
$client = new GuzzleHttp\Client([
    'base_uri' => getenv('UMEME_BASE_URL') . '/',
    'headers' => ['Authorization' => 'Bearer ' . getenv('UMEME_CLE')],
    'timeout' => 30,
]);

$reponse = $client->get('portefeuille/mouvements', [
    'query' => [
        'du' => '2026-11-01',
        'au' => '2026-11-07',
    ],
]);
$donnees = json_decode($reponse->getBody(), true);
```

```java Java icon="https://mintcdn.com/dommi10/MMGXqk_5twdsE4Rl/logos/langages/java.svg?fit=max&auto=format&n=MMGXqk_5twdsE4Rl&q=85&s=a99792afd2b2bcd5b3c64f5157b8469e" theme={"dark"}
// Java 15 et plus : java.net.http et blocs de texte.
var baseUrl = System.getenv("UMEME_BASE_URL");
var client = HttpClient.newHttpClient();

var params = Map.of("du", "2026-11-01", "au", "2026-11-07").entrySet().stream()
    .map(p -> p.getKey() + "=" + URLEncoder.encode(p.getValue(), StandardCharsets.UTF_8))
    .collect(Collectors.joining("&"));

var requete = HttpRequest.newBuilder(URI.create(baseUrl + "/portefeuille/mouvements" + "?" + params))
    .header("Authorization", "Bearer " + System.getenv("UMEME_CLE"))
    .GET()
    .build();

var reponse = client.send(requete, HttpResponse.BodyHandlers.ofString());
```

```json 200 OK {3,4} theme={"dark"}
{
  "mouvements": [
    { "rang": 41, "date": "2026-11-07T08:26:44Z", "type": "VENTE", "montant": -5, "soldeApres": 995 },
    { "rang": 42, "date": "2026-11-07T08:31:10Z", "type": "REMBOURSEMENT", "montant": 5, "soldeApres": 1000 }
  ]
}
```

Chaque `soldeApres` part du précédent : le relevé se rapproche ligne par ligne.

## 3. Recharger

Le portefeuille se recharge auprès d'Umeme, pas par l'API. Surveillez le solde, et rechargez avant zéro : une vente sans solde est rejetée (`SOLDE_INSUFFISANT`).

> [!TIP]
>
> Dans la sandbox, `POST /sandbox/portefeuille/recharge` crédite jusqu'à `5 000 $` fictifs.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.