SDK Python officiel pour l’API IzichangePay. Zéro dépendance (librairie standard uniquement), Python ≥ 3.8.
pip install izichangepay

Démarrage

import os
from izichangepay import Client, SANDBOX_BASE_URL

izipay = Client(api_key=os.environ["IZIPAY_API_KEY"])
# Sandbox : Client(api_key=..., base_url=SANDBOX_BASE_URL)

intent = izipay.payment_intents.create({
    "requestedCurrencyType": "fiat",
    "currencyRequested": "XOF",
    "amountRequested": "10000",
    "acceptedCoins": ["USDT.TRC20"],
})
print(intent["paymentUrl"])
Les montants sont des chaînes décimales (ex. "10000"), jamais des number. La clé API détermine l’environnement : sk_test_… (sandbox) ou sk_live_… (production).

Pagination

Les endpoints de listing renvoient {"data": [...], "nextCursor": ...}. L’itérateur iterate parcourt toutes les pages via le curseur :
for intent in izipay.payment_intents.iterate({"limit": 50}):
    print(intent["id"])

Vérification d’un webhook

validate_webhook attend le corps brut (bytes/str), pas un dict re-sérialisé. Signature X-IziPay-Signature: sha256=<hex> (HMAC-SHA256), tolérance anti-replay 300 s.
from izichangepay import validate_webhook, WebhookError

try:
    event = validate_webhook(
        raw_body,
        request.headers.get("X-IziPay-Signature"),
        os.environ["IZIPAY_WEBHOOK_SECRET"],
    )
    # traiter event["type"] / event["data"]
except WebhookError as err:
    ...  # rejeter : err.reason

Erreurs

Toutes les erreurs héritent de IzichangepayError. Branchez sur le type :
TypeQuand
AuthError401 / 403
NotFoundError404
ValidationError422 (.fields)
RateLimitError429 (.retry_after)
ServerError5xx
NetworkErrorpas de réponse (DNS, timeout)
WebhookErrorsignature / timestamp invalides (.reason)
from izichangepay import ValidationError

try:
    izipay.payouts.create({...})
except ValidationError as e:
    print(e.fields)   # {champ: message}

Ressources disponibles

payment_intents, payouts, invoices, products, settlements, settlement_accounts, wallet, merchant_assets, payins, assets, merchants, webhook_endpoints, whitelist_addresses.

Référence complète

Référence API pour le détail des paramètres et schémas de chaque endpoint.