# Cika asusu da crypto

> API na AfricaProxies: cika crypto, adadi daidai, sanar da aika kuɗi (TXID na zaɓi) da matsayi. Misalan amsa da curl, Python da Node.js.

- URL: https://africaproxies.com/ha/docs/api/top-ups/
- An sabunta ƙarshe: 2026-10-15
- Mai wallafa: AfricaProxies (https://africaproxies.com)

Cika saura da crypto: karɓi adireshin ajiya da adadi daidai, aika wannan adadin, sanar cewa an aika kuɗi (ID na ciniki zaɓi ne), sannan bibiyi cika asusun har sai an ƙara kuɗin. Ana biyan kowane tsarinmu daga wannan saura.

**Wuraren kira a wannan shafin**

- `GET /v1/catalog/coins`: Crypto da hanyoyin sadarwar da ake karɓa (da tabbataccen adireshin ajiyarsu)
- `POST /v1/topups`: Fara cika saura da crypto (adireshi tabbatacce, adadi daidai)
- `POST /v1/topups/{topUpId}/txid`: Sanar da cewa an aika kuɗi (TXID na zaɓi)
- `GET /v1/topups/{topUpId}`: Duba cika asusu (maimaita kira don matsayinsa na yanzu)
- `GET /v1/topups`: Jera cika asusu da crypto

URL na asali `https://africaproxies.com/api/v1`. Tabbatar da shiga, kurakurai da iyaka: duba [bayanin API](/ha/docs/api/).

## Crypto da hanyoyin sadarwar da ake karɓa (da tabbataccen adireshin ajiyarsu)

`GET /v1/catalog/coins`

Baiwa: ba a buƙatar mabuɗin API.

**Amsa** `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());
```

## Fara cika saura da crypto (adireshi tabbatacce, adadi daidai)

`POST /v1/topups`

- `amountUsd` ≥ 25.00 USD kuma ≤ iyaka (10,000.00 a tsohon saiti): in ba haka ba `422` a kan `amountUsd`.
- `coin` + `network` dole su kasance cikin `GET /v1/catalog/coins` (in ba haka ba `409 coin_unavailable`).
- Yana mayar da **tabbataccen** `address` na hanyar sadarwa da ainihin `amountCrypto` = `amountUsd` / `rate`, an zagaye shi **sama** zuwa daidaiton tsabar (BTC/LTC/ETH/SOL wuraren goma 8, USDT/USDC 6), tare da ɗan ƙarin adadi na musamman a lambobin ƙarshe domin cika asusu biyu da suke buɗe a hanyar ɗaya kada su nemi adadi ɗaya. Ana kulle `rate` har zuwa `expiresAt` (mintuna 30); `txidDeadline` = `expiresAt` + 72 h.
- `purchase` na zaɓi (jiki ɗaya da `POST /v1/orders`): ana tabbatarwa da ƙayyade farashi yanzu (`422` da sunayen filaye masu farkon `purchase.`, `409 plan_unavailable`…). Dole `amountUsd` ya rufe jimillar `purchase` − saura na yanzu (`422 too_small` a kan `amountUsd`). Da zarar an ƙara kuɗin cika asusu, ana yin odar daga saura cikin ciniki ɗaya; `purchase.status` yana zama `completed` (da `orderId`) ko `failed` (`failureReason`; kuɗin suna nan cikin saura).

Authentication: API madaidaiciya a cikin `Authorization: Bearer API_KEY` taken.

**Ma'aunin aiki**

| Suna | A cikin | Nau'i | Abin bukata | Bayani |
| --- | --- | --- | --- | --- |
| `Idempotency-Key` | header | string | A'a | Maɓalli na musamman (misali UUID) don sake gwada POST cikin aminci. Ana riƙe shi 24 h. — iyakar haruffa 128 |

**Sashin buƙata**

| Fasali | Nau'i | Abin bukata | Bayani |
| --- | --- | --- | --- |
| `amountUsd` | string (USD, 2 decimals) | I | USD da za a ƙara: ≥ 25.00, ≤ 10,000.00 a tsohon saiti. |
| `coin` | string | I | — |
| `network` | string | I | — |
| `purchase` | object | A'a | Tsarin da za a saya daga saura idan an ƙara kuɗin cika asusu (jiki ɗaya da `POST /v1/orders`). |

*Misali: Saura*

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

*Misali: Biyan saye*

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

**Amsa** `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());
```

## Sanar da cewa an aika kuɗi (TXID na zaɓi)

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

Ka sanar cewa an aika kuɗi da zarar sun fita daga wallet ko dandalin musayarka: wannan shi ne nau'in API na maɓallin “Na aika kuɗin”. ID na ciniki (TXID) zaɓi ne: aika jiki marar komai (`{}`), ko ƙara `txid` idan kana da shi. Ana danganta kuɗinka da wannan cika asusu ta ainihin adadinsa (`amountCrypto`) a hanyar sadarwa da adireshin cika asusun, don haka aika wannan adadin daidai.

Ana karɓa yayin da cika asusu yake `awaiting_payment`, `expired` ko `rejected`, kuma kafin `txidDeadline` (`expiresAt` + 72 h): sanarwa da ta makara ba ta sa kuɗi su ɓacewa. Idan an bayar da `txid`, ana bincika tsarin hanyar sadarwarsa (`422` a kan `txid`), kuma wani cika asusu bai kamata ya riga ya yi amfani da shi ba (`409 txid_already_used`). Cika asusu da aka rufe yana mayar da `409 topup_closed`. Daga nan cika asusun yana zama `verifying` yayin binciken blockchain, sannan ya ƙare da `credited` idan hanyar sadarwa ta tabbatar da cinikin, ko `rejected` (tare da `rejection`).

Authentication: API madaidaiciya a cikin `Authorization: Bearer API_KEY` taken.

**Ma'aunin aiki**

| Suna | A cikin | Nau'i | Abin bukata | Bayani |
| --- | --- | --- | --- | --- |
| `topUpId` | path | string | I | — |

**Sashin buƙata**

| Fasali | Nau'i | Abin bukata | Bayani |
| --- | --- | --- | --- |
| `txid` | string | A'a | Na zaɓi. Hash na ciniki: 64 hex (bitcoin, litecoin, tron), 0x + 64 hex (ethereum), sa hannun base58 (solana). Idan babu ko yana fanko: ana daidaita kuɗi ta ainihin adadinsu. — iyakar haruffa 128 |

*Misali: An aika kuɗi*

```json
{}
```

*Misali: Da TXID (na zaɓi)*

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

**Amsa** `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());
```

## Duba cika asusu (maimaita kira don matsayinsa na yanzu)

`GET /v1/topups/{topUpId}`

Maimaita kiran wannan hanya don bin cika asusu: kowane 10 s yayin `status = verifying`, kowane 30 s yayin jiran kuɗi, ka tsaya idan `final = true`. Cika asusu yana zama `expired` idan ba a sanar da aika kuɗin ba kafin `expiresAt`; ana iya sanarwa har zuwa `txidDeadline`.

Authentication: API madaidaiciya a cikin `Authorization: Bearer API_KEY` taken.

**Ma'aunin aiki**

| Suna | A cikin | Nau'i | Abin bukata | Bayani |
| --- | --- | --- | --- | --- |
| `topUpId` | path | string | I | — |

**Amsa** `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());
```

## Jera cika asusu da crypto

`GET /v1/topups`

Authentication: API madaidaiciya a cikin `Authorization: Bearer API_KEY` taken.

**Ma'aunin aiki**

| Suna | A cikin | Nau'i | Abin bukata | Bayani |
| --- | --- | --- | --- | --- |
| `page` | query | integer | A'a | ≥ 1, tsohon saiti `1` |
| `perPage` | query | integer | A'a | 1–100, tsohon saiti `20` |
| `status` | query | `awaiting_payment` · `verifying` · `credited` · `rejected` · `expired` | A'a | `final` = an ƙara kuɗi, ko ya ƙare / an ƙi shi bayan `txidDeadline`. |

**Amsa** `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 mai samar da proxy na IP na gida ne ga Afirka kudu da Sahara; ana biya da kirifto ba tare da loda katin shaida ba.
