Paiement de Factures de Services Publics en Algérie
Payez vos factures de services publics algériens (Sonelgaz, Algérie Télécom, ADE, SEAAL) rapidement et en toute sécurité via notre API unifiée
Flux Standard de Paiement en 3 Étapes
Vérifier le montant dû, les détails de la facture et le jeton crypté avant le paiement.
POST /api/operations/fetch/{service}/Enregistrer les métadonnées clés (clé EBB Sonelgaz, code de paiement ADE, numéro AT, réf SEAAL).
POST /api/operations/facture-data/Exécuter l'opération financière avec votre clé secrète chiffrée (encrypted_sk).
POST /services/operation_postChiffrement RSA et Authentification SofizPay (RSA-OAEP)
Chiffrement de la Clé Secrète SofizPay (encrypted_sk)
Pour sécuriser la clé secrète SofizPay et éviter sa transmission en clair, toutes les requêtes de consultation et de paiement de factures exigent le chiffrement de la clé secrète via la clé publique RSA officielle SofizPay (RSA-OAEP SHA-256), transmise en Base64 dans le corps JSON sous encrypted_sk.
Clé Publique RSA 2048-bit Officielle
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv9toBr7vZ4XIkVzlzdGR
vNVaKw7A9Z3/Vnq3bK8fLaaUTmoweL3CEKSbz1lxYUjzuRzY/nmDuCpPS/7t0i5c
kWRifPaPgIoiUFr1fGLzjN+cttxtvbPQof2Zuxllbq5ox+XyZpc1eo8PjwhRobCB
djDZ1iSV1VkhOWanrnNXeXFzUnRYHQUZmQ8FWOFQ8D9vUZanmq/ZJ6nJ4SZoj2lV
dKrLBbh/MWtn9MmyrPrywoJYCnc7c+ylJIWnAhNv4jTafB5bqDTd6oSElV9lQqPf
diO93j+Q/uBoAZQZ2EqWY0E4Ooz4Dd9dHl7EiNiAh19G9VTcBFN/QfXOdyCGajwC
WwIDAQAB
-----END PUBLIC KEY-----Exemples de code de chiffrement
1import base64
2from cryptography.hazmat.primitives.asymmetric import padding
3from cryptography.hazmat.primitives import serialization, hashes
4from cryptography.hazmat.backends import default_backend
5
6SOFIZ_PUBLIC_KEY_PEM = """-----BEGIN PUBLIC KEY-----
7MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv9toBr7vZ4XIkVzlzdGR
8vNVaKw7A9Z3/Vnq3bK8fLaaUTmoweL3CEKSbz1lxYUjzuRzY/nmDuCpPS/7t0i5c
9kWRifPaPgIoiUFr1fGLzjN+cttxtvbPQof2Zuxllbq5ox+XyZpc1eo8PjwhRobCB
10djDZ1iSV1VkhOWanrnNXeXFzUnRYHQUZmQ8FWOFQ8D9vUZanmq/ZJ6nJ4SZoj2lV
11dKrLBbh/MWtn9MmyrPrywoJYCnc7c+ylJIWnAhNv4jTafB5bqDTd6oSElV9lQqPf
12diO93j+Q/uBoAZQZ2EqWY0E4Ooz4Dd9dHl7EiNiAh19G9VTcBFN/QfXOdyCGajwC
13WwIDAQAB
14-----END PUBLIC KEY-----"""
15
16def encrypt_sofizpay_sk(secret_key: str, public_key_pem: str = SOFIZ_PUBLIC_KEY_PEM) -> str:
17 """Encrypts SofizPay Secret Key (S...) using RSA-OAEP SHA-256 for encrypted_sk"""
18 pub_key = serialization.load_pem_public_key(
19 public_key_pem.strip().encode('utf-8'),
20 backend=default_backend()
21 )
22 ciphertext = pub_key.encrypt(
23 secret_key.strip().encode('utf-8'),
24 padding.OAEP(
25 mgf=padding.MGF1(algorithm=hashes.SHA256()),
26 algorithm=hashes.SHA256(),
27 label=None
28 )
29 )
30 return base64.b64encode(ciphertext).decode('utf-8')
31
32# Example usage in API request body:
33# payload = {"encrypted_sk": encrypt_sofizpay_sk("S..."), "customer_num": "00000000000"}Phase 1 : API d'interrogation des factures (Fetch Bills)
POST https://epay.sofizpay.com/api/operations/fetch/{service}/
Ce point de terminaison permet d'interroger en temps réel les factures impayées directement auprès des organismes publics algériens, garantissant la vérification du montant exact avant le règlement.
https://epay.sofizpay.com/api/operations/fetch/sonelgaz/Requête d'interrogation (Fetch Request)
cURLcurl --location 'https://epay.sofizpay.com/api/operations/fetch/sonelgaz/' --header 'Content-Type: application/json' --data '{
"encrypted_sk": "YOUR_ENCRYPTED_SECRET_KEY",
"customer_num": "00000000000"
}'Exemple de réponse (Factures impayées)
200 OK{
"bills": [
{
"value": "000000000000",
"label": "[1500.00 DZD] [000000000000]",
"amount": 1500.00,
"bill_number": "000000000000",
"customer_num": "00000000000",
"ebb": "000",
"isIdoom": false
}
],
"customer_num": "00000000000"
}Paramètres de l'API Fetch
| Paramètre | Emplacement | Type | Description | Requis Pour |
|---|---|---|---|---|
encrypted_sk | Corps (Body) | string | Clé secrète chiffrée pour l'authentification et l'exécution | Tous les services |
customer_num | Corps (Body) | string | Numéro client Sonelgaz à 11 caractères (ex. 00000000000) extrait de la facture ou du code Data Matrix | Sonelgaz |
bill_number | Corps (Body) | string | Numéro de facture Sonelgaz (optionnel pour vérification ciblée) | Sonelgaz (Optionnel) |
ebb | Corps (Body) | string | Clé de vérification EBB extraite du code-barres Sonelgaz (optionnel) | Sonelgaz (Optionnel) |
nd | Corps (Body) | string | Numéro de désignation de la ligne fixe / Idoom Algérie Télécom (ND ex. 021000000) | Algérie Télécom |
c_paiement | Corps (Body) | string | Code de paiement électronique (Code Paiement) figurant sur la facture d'eau ADE | ADE |
customer_num | Corps (Body) | string | Numéro client ou référence de contrat pour la SEAAL (Alger et Tipaza) | SEAAL |
Étape 2: Pré-Sauvegarde des Métadonnées de Suivi — POST /api/operations/facture-data/
Enregistrer les métadonnées clés (clé EBB Sonelgaz, code de paiement ADE, numéro AT, réf SEAAL).
curl --location 'https://epay.sofizpay.com/api/operations/facture-data/' --header 'Content-Type: application/json' --data '{
"encrypted_sk": "YOUR_ENCRYPTED_SECRET_KEY",
"facture_number": "000000000000",
"bill_number": "000000000000",
"ebb": "000",
"customer_number": "00000000000"
}'Étape 3: Soumission du Règlement Financier — POST /services/operation_post

Sonelgaz
Société Nationale de l'Électricité et du Gaz
Exemple de Requête de Paiement
curl --location 'https://sofizpay.com/services/operation_post' --header 'Content-Type: application/json' --data '{
"encrypted_sk": "YOUR_ENCRYPTED_SECRET_KEY",
"amount": 1500.00,
"operator": "sonelgaz",
"offer": "sonelgaz",
"bill": "000000000000",
"customerId": "",
"customernumber": " ",
"ebb": " "
}'Opérateur de Service
"sonelgaz"Champs Requis

Algérie Télécom
Algérie Télécom (Idoom Fixe & Fibre)
Exemple de Requête de Paiement
curl --location 'https://sofizpay.com/services/operation_post' --header 'Content-Type: application/json' --data '{
"encrypted_sk": "YOUR_ENCRYPTED_SECRET_KEY",
"amount": 645.00,
"montant": 645.00,
"operator": "AT",
"offer": "AT",
"phone": "021000000",
"bill": "021000000",
"bill_number": "021000000",
"memo": "00:021000000"
}'Opérateur de Service
"AT"Champs Requis

ADE
Algérienne Des Eaux
Exemple de Requête de Paiement
curl --location 'https://sofizpay.com/services/operation_post' --header 'Content-Type: application/json' --data '{
"encrypted_sk": "YOUR_ENCRYPTED_SECRET_KEY",
"amount": 2500,
"operator": "ade",
"offer": "ade",
"bill": "0000000000",
"c_paiement": "0000000000",
"customerId": "0000000000"
}'Opérateur de Service
"ade"Champs Requis

SEAAL
Société des Eaux et de l'Assainissement d'Alger
Exemple de Requête de Paiement
curl --location 'https://sofizpay.com/services/operation_post' --header 'Content-Type: application/json' --data '{
"encrypted_sk": "YOUR_ENCRYPTED_SECRET_KEY",
"amount": 1800,
"operator": "seaal",
"offer": "SEAAL",
"phone": "00000000",
"bill": "00000000",
"memo": "00:00000000"
}'Opérateur de Service
"seaal"Champs Requis
Paramètres de la Requête
| Paramètre | Type | Description | Requis Pour |
|---|---|---|---|
encrypted_sk | string | Clé secrète chiffrée pour l'authentification et l'exécution | Tous les services |
amount | number | Montant du paiement en DZD | Tous les services |
operator | string | Fournisseur de service: sonelgaz, AT, ade, ou seaal | Tous les services |
offer | string | Type d'offre de service: sonelgaz, AT, ade, ou SEAAL | Tous les services |
bill | string | Numéro de facture ou référence de paiement | Tous les services |
ebb | string | Clé de vérification EBB extraite du code-barres Sonelgaz | Sonelgaz |
c_paiement | string | Code de paiement électronique de la facture d'eau ADE | ADE |
phone | string | Numéro de téléphone fixe ou identifiant (Algérie Télécom, SEAAL) | AT / SEAAL |
memo | string | Mémo de suivi au format 00:{numéro} (Algérie Télécom, SEAAL) | AT / SEAAL |
montant | number | Montant en DZD spécifiquement transmis pour Algérie Télécom / Idoom | Algérie Télécom |
Réponse de Confirmation de Paiement (200)
{
"status": "success",
"message": "Bill payment completed successfully",
"operation_id": "OP_DZ_000000000000",
"transaction_id": "TXN_000000000",
"transaction_status": "confirmed"
}Note: Le paiement est traité via la passerelle SofizPay et un accusé de confirmation est généré immédiatement.