# Recharges en crypto

> API AfricaProxies : recharges crypto, montant exact, paiement envoyé, TXID facultatif et statut. Exemples de code curl, Python et Node.js.

- URL: https://africaproxies.com/fr/docs/api/top-ups/
- Dernière mise à jour: 2026-10-15
- Éditeur: AfricaProxies (https://africaproxies.com)

Rechargez le solde en crypto : obtenez l’adresse et le montant exact, envoyez exactement ce montant, puis signalez le paiement envoyé. L’ID de transaction est facultatif. Suivez le rechargement jusqu’au crédit du solde, qui permet d’acheter n’importe lequel de nos forfaits.

**Points d’accès de cette page**

- `GET /v1/catalog/coins`: Cryptomonnaies et réseaux acceptés, avec leur adresse de dépôt fixe
- `POST /v1/topups`: Créer un rechargement crypto du solde : adresse fixe et montant exact
- `POST /v1/topups/{topUpId}/txid`: Signaler le paiement envoyé, avec TXID facultatif
- `GET /v1/topups/{topUpId}`: Consulter un rechargement et suivre son statut
- `GET /v1/topups`: Lister les rechargements crypto

URL de base `https://africaproxies.com/api/v1`. Authentification, erreurs et limites : voir la [présentation de l’API](/fr/docs/api/).

## Cryptomonnaies et réseaux acceptés (avec leur adresse de dépôt fixe)

`GET /v1/catalog/coins`

Public : aucune clé API requise.

**Réponse** `200 OK`

```json
{
  "data": [
    {
      "code": "BTC",
      "name": "Bitcoin",
      "networks": [
        {
          "id": "bitcoin",
          "name": "Bitcoin",
          "confirmationsRequired": 2,
          "estimatedMinutes": null,
          "memoRequired": false,
          "address": "DEPOSIT_ADDRESS"
        }
      ]
    }
  ]
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/catalog/coins"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"

r = requests.get(f"{API}/catalog/coins", timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/catalog/coins`);
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Démarrer une recharge du compte en crypto (adresse fixe, montant exact)

`POST /v1/topups`

- `amountUsd` doit être ≥ 25.00 USD et ≤ au maximum (10,000.00 par défaut), sinon `422` sur `amountUsd`.
- La combinaison `coin` + `network` doit figurer dans `GET /v1/catalog/coins`, sinon `409 coin_unavailable`.
- La réponse fournit l’`address` **fixe** du réseau et le montant exact `amountCrypto` = `amountUsd` / `rate`, arrondi **vers le haut** à la précision de la monnaie (BTC/LTC/ETH/SOL : 8 décimales, USDT/USDC : 6). Un petit décalage unique dans les derniers chiffres distingue les montants de deux rechargements ouverts sur le même réseau. Le `rate` reste fixé jusqu’à `expiresAt` (30 minutes) ; `txidDeadline` = `expiresAt` + 72 h.
- Le champ facultatif `purchase` utilise le même corps que `POST /v1/orders`. Il est validé et chiffré immédiatement (`422` avec des noms de champs préfixés par `purchase.`, `409 plan_unavailable`…). Le `amountUsd` doit couvrir le total `purchase` moins le solde actuel, sinon `422 too_small` sur `amountUsd`. Quand le rechargement est crédité, la commande utilise le solde dans la même transaction ; `purchase.status` devient `completed` avec `orderId`, ou `failed` avec `failureReason`, les fonds restant alors sur le solde.

Authentification : clé API dans l'en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Requis | Description |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | Non | Clé unique, par exemple un UUID, pour renouveler une requête POST sans doublon. Conservée 24 h. — 128 caractères max. |

**Corps de la requête**

| Champ | Type | Requis | Description |
| --- | --- | --- | --- |
| `amountUsd` | string (USD, 2 decimals) | Oui | USD à ajouter : ≥ 25.00, ≤ 10,000.00 par défaut. |
| `coin` | string | Oui | — |
| `network` | string | Oui | — |
| `purchase` | object | Non | Forfait à acheter sur le solde une fois le rechargement crédité ; même corps que `POST /v1/orders`. |

*Exemple: Solde*

```json
{
  "amountUsd": "50.00",
  "coin": "USDT",
  "network": "tron"
}
```

*Exemple: Paiement*

```json
{
  "amountUsd": "25.00",
  "coin": "BTC",
  "network": "bitcoin",
  "purchase": {
    "planId": "res-10",
    "quantity": 1
  }
}
```

**Réponse** `201 Created`

```json
{
  "id": "top_7d2kq9x1",
  "status": "verifying",
  "final": false,
  "amountUsd": "25.00",
  "coin": "USDT",
  "network": "tron",
  "address": "DEPOSIT_ADDRESS",
  "amountCrypto": "25.000137",
  "rate": "1.00",
  "paymentUri": "PAYMENT_URI",
  "expiresAt": "2026-10-05T14:33:11Z",
  "txidDeadline": "2026-10-08T14:33:11Z",
  "confirmationsRequired": 20,
  "confirmations": 7,
  "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "txidSubmittedAt": "2026-10-05T14:09:42Z",
  "amountReceivedCrypto": "25.000137",
  "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "creditedUsd": null,
  "creditedAt": null,
  "rejection": null,
  "purchase": {
    "planId": "res-10",
    "planName": "Team",
    "quantity": 1,
    "options": {},
    "promoCode": null,
    "total": "5.94",
    "status": "pending",
    "orderId": null,
    "failureReason": null
  },
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://africaproxies.com/api/v1/topups" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{"amountUsd":"50.00","coin":"USDT","network":"tron"}'
```

*Python*

```python
import os, uuid
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}", "Idempotency-Key": str(uuid.uuid4())}

r = requests.post(f"{API}/topups", headers=HEADERS, json={"amountUsd": "50.00", "coin": "USDT", "network": "tron"}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
import { randomUUID } from 'node:crypto';

const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/topups`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Idempotency-Key': randomUUID(), 'Content-Type': 'application/json' },
  body: JSON.stringify({ amountUsd: '50.00', coin: 'USDT', network: 'tron' }),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Signaler le paiement envoyé (TXID facultatif)

`POST /v1/topups/{topUpId}/txid`

Signalez le paiement comme envoyé après son départ de votre portefeuille ou plateforme d’échange : c’est l’équivalent API du bouton « J’ai envoyé le paiement ». L’ID de transaction (TXID) est facultatif : envoyez un corps vide (`{}`) ou ajoutez `txid` si vous le connaissez. Le paiement est rapproché de ce rechargement grâce à son montant exact (`amountCrypto`), sur le réseau et à l’adresse de la facture : envoyez donc exactement ce montant.

Le signalement est accepté lorsque le rechargement est `awaiting_payment`, `expired` ou `rejected`, avant `txidDeadline` (`expiresAt` + 72 h) : un signalement tardif ne fait pas perdre le paiement. Si un `txid` est fourni, son format est vérifié selon le réseau (`422` sur `txid`) et il ne doit pas être déjà associé à un autre rechargement (`409 txid_already_used`). Un rechargement clos renvoie `409 topup_closed`. Le statut passe ensuite à `verifying` pendant la vérification du paiement sur la blockchain, puis à `credited` après confirmation de la transaction par le réseau, ou à `rejected` avec `rejection`.

Authentification : clé API dans l'en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Requis | Description |
| --- | --- | --- | --- | --- |
| `topUpId` | path | string | Oui | — |

**Corps de la requête**

| Champ | Type | Requis | Description |
| --- | --- | --- | --- |
| `txid` | string | Non | Facultatif. Empreinte de transaction : 64 caractères hexadécimaux (bitcoin, litecoin, tron), 0x + 64 caractères hexadécimaux (ethereum), signature base58 (solana). Si le champ est vide ou absent, le paiement est rapproché grâce à son montant exact. — 128 caractères max. |

*Exemple: Paiement envoyé*

```json
{}
```

*Exemple: Avec le TXID facultatif*

```json
{
  "txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
}
```

**Réponse** `200 OK`

```json
{
  "id": "top_7d2kq9x1",
  "status": "verifying",
  "final": false,
  "amountUsd": "25.00",
  "coin": "USDT",
  "network": "tron",
  "address": "DEPOSIT_ADDRESS",
  "amountCrypto": "25.000137",
  "rate": "1.00",
  "paymentUri": "PAYMENT_URI",
  "expiresAt": "2026-10-05T14:33:11Z",
  "txidDeadline": "2026-10-08T14:33:11Z",
  "confirmationsRequired": 20,
  "confirmations": 7,
  "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "txidSubmittedAt": "2026-10-05T14:09:42Z",
  "amountReceivedCrypto": "25.000137",
  "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "creditedUsd": null,
  "creditedAt": null,
  "rejection": null,
  "purchase": {
    "planId": "res-10",
    "planName": "Team",
    "quantity": 1,
    "options": {},
    "promoCode": null,
    "total": "5.94",
    "status": "pending",
    "orderId": null,
    "failureReason": null
  },
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s -X POST "https://africaproxies.com/api/v1/topups/top_7d2kq9x1/txid" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.post(f"{API}/topups/top_7d2kq9x1/txid", headers=HEADERS, json={}, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/topups/top_7d2kq9x1/txid`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.API_KEY}`, 'Content-Type': 'application/json' },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Consulter un rechargement et suivre son statut

`GET /v1/topups/{topUpId}`

Interrogez cette route pour suivre une recharge : toutes les 10 s pendant `status = verifying`, toutes les 30 s pendant qu'elle attend le paiement, et arrêtez-vous quand `final = true`. Une recharge devient `expired` lorsque le paiement n'a pas été signalé comme envoyé avant `expiresAt` ; elle peut encore être signalée jusqu'à `txidDeadline`.

Authentification : clé API dans l'en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Requis | Description |
| --- | --- | --- | --- | --- |
| `topUpId` | path | string | Oui | — |

**Réponse** `200 OK`

```json
{
  "id": "top_7d2kq9x1",
  "status": "verifying",
  "final": false,
  "amountUsd": "25.00",
  "coin": "USDT",
  "network": "tron",
  "address": "DEPOSIT_ADDRESS",
  "amountCrypto": "25.000137",
  "rate": "1.00",
  "paymentUri": "PAYMENT_URI",
  "expiresAt": "2026-10-05T14:33:11Z",
  "txidDeadline": "2026-10-08T14:33:11Z",
  "confirmationsRequired": 20,
  "confirmations": 7,
  "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "txidSubmittedAt": "2026-10-05T14:09:42Z",
  "amountReceivedCrypto": "25.000137",
  "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
  "creditedUsd": null,
  "creditedAt": null,
  "rejection": null,
  "purchase": {
    "planId": "res-10",
    "planName": "Team",
    "quantity": 1,
    "options": {},
    "promoCode": null,
    "total": "5.94",
    "status": "pending",
    "orderId": null,
    "failureReason": null
  },
  "createdAt": "2026-10-05T14:03:11Z"
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/topups/top_7d2kq9x1" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/topups/top_7d2kq9x1", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/topups/top_7d2kq9x1`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

## Lister les recharges crypto

`GET /v1/topups`

Authentification : clé API dans l'en-tête `Authorization: Bearer API_KEY`.

**Paramètres**

| Nom | Dans | Type | Requis | Description |
| --- | --- | --- | --- | --- |
| `page` | query | integer | Non | ≥ 1, par défaut `1` |
| `perPage` | query | integer | Non | 1–100, par défaut `20` |
| `status` | query | `awaiting_payment` · `verifying` · `credited` · `rejected` · `expired` | Non | `final` = crédité, ou expiré / rejeté après `txidDeadline`. |

**Réponse** `200 OK`

```json
{
  "data": [
    {
      "id": "top_7d2kq9x1",
      "status": "verifying",
      "final": false,
      "amountUsd": "25.00",
      "coin": "USDT",
      "network": "tron",
      "address": "DEPOSIT_ADDRESS",
      "amountCrypto": "25.000137",
      "rate": "1.00",
      "paymentUri": "PAYMENT_URI",
      "expiresAt": "2026-10-05T14:33:11Z",
      "txidDeadline": "2026-10-08T14:33:11Z",
      "confirmationsRequired": 20,
      "confirmations": 7,
      "txid": "9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
      "txidSubmittedAt": "2026-10-05T14:09:42Z",
      "amountReceivedCrypto": "25.000137",
      "explorerUrl": "https://tronscan.org/#/transaction/9d2e5c0b1f7a4e3d8c6b2a1f0e9d8c7b6a5f4e3d2c1b0a9f8e7d6c5b4a3f41c7",
      "creditedUsd": null,
      "creditedAt": null,
      "rejection": null,
      "purchase": {
        "planId": "res-10",
        "planName": "Team",
        "quantity": 1,
        "options": {},
        "promoCode": null,
        "total": "5.94",
        "status": "pending",
        "orderId": null,
        "failureReason": null
      },
      "createdAt": "2026-10-05T14:03:11Z"
    }
  ],
  "pagination": {
    "page": 1,
    "perPage": 20,
    "total": 1,
    "totalPages": 1
  }
}
```

*curl*

```bash
curl -s "https://africaproxies.com/api/v1/topups" \
  -H "Authorization: Bearer $API_KEY"
```

*Python*

```python
import os
import requests

API = "https://africaproxies.com/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['API_KEY']}"}

r = requests.get(f"{API}/topups", headers=HEADERS, timeout=30)
r.raise_for_status()
print(r.json())
```

*Node.js*

```javascript
// Node.js 18+ (built-in fetch), ES module
const API = 'https://africaproxies.com/api/v1';

const res = await fetch(`${API}/topups`, {
  headers: { Authorization: `Bearer ${process.env.API_KEY}` },
});
if (!res.ok) throw new Error((await res.json()).error?.message ?? `HTTP ${res.status}`);
console.log(await res.json());
```

---

AfricaProxies: AfricaProxies est un fournisseur de proxies résidentiels pour l’Afrique subsaharienne, avec paiement en crypto et sans transmettre de pièce d’identité.
