Bill Payment API
Pay your Algerian public utility bills (Sonelgaz, Algérie Télécom, ADE, SEAAL) quickly and securely through our unified API
Standard 3-Phase Bill Payment Workflow
Retrieve pending bill amounts, customer verification, and server identifiers before proceeding.
POST /api/operations/fetch/{service}/Save essential metadata into the server (Sonelgaz EBB key, ADE payment code, AT number, SEAAL ref).
POST /api/operations/facture-data/Execute the final financial settlement using your encrypted secret key (encrypted_sk).
POST /services/operation_postRSA Encryption & SofizPay Authentication (RSA-OAEP)
SofizPay Secret Key Encryption (encrypted_sk)
To protect the SofizPay Secret Key and prevent transmitting plain secrets across the network, all bill fetching and payment endpoints strictly require the secret key to be encrypted using the official SofizPay RSA Public Key (RSA-OAEP SHA-256) and provided as Base64 in the request body as encrypted_sk.
Official RSA 2048-bit Public Key
-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv9toBr7vZ4XIkVzlzdGR
vNVaKw7A9Z3/Vnq3bK8fLaaUTmoweL3CEKSbz1lxYUjzuRzY/nmDuCpPS/7t0i5c
kWRifPaPgIoiUFr1fGLzjN+cttxtvbPQof2Zuxllbq5ox+XyZpc1eo8PjwhRobCB
djDZ1iSV1VkhOWanrnNXeXFzUnRYHQUZmQ8FWOFQ8D9vUZanmq/ZJ6nJ4SZoj2lV
dKrLBbh/MWtn9MmyrPrywoJYCnc7c+ylJIWnAhNv4jTafB5bqDTd6oSElV9lQqPf
diO93j+Q/uBoAZQZ2EqWY0E4Ooz4Dd9dHl7EiNiAh19G9VTcBFN/QfXOdyCGajwC
WwIDAQAB
-----END PUBLIC KEY-----Encryption Code Examples
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: Fetch Live Bills API
POST https://epay.sofizpay.com/api/operations/fetch/{service}/
This endpoint allows real-time querying of outstanding unpaid bills directly from Algerian public utility systems, verifying the exact due amount and metadata before proceeding to settlement.
https://epay.sofizpay.com/api/operations/fetch/sonelgaz/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"
}'Fetch Response (Live Bills)
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"
}Fetch API Parameters
| Parameter | Location | Type | Description | Required For |
|---|---|---|---|---|
encrypted_sk | Body | string | Encrypted SofizPay/merchant secret key for authentication | All Services |
customer_num | Body | string | Sonelgaz 11-character customer ID (e.g. 00000000000) from bill or Data Matrix code | Sonelgaz |
bill_number | Body | string | Sonelgaz bill number (optional for direct bill matching) | Sonelgaz (Optional) |
ebb | Body | string | EBB verification key from Sonelgaz bill barcode (optional) | Sonelgaz (Optional) |
nd | Body | string | Landline phone number / Idoom designation number (ND e.g. 021000000) | Algérie Télécom |
c_paiement | Body | string | Electronic payment code (Code de Paiement) printed on the ADE water invoice | ADE |
customer_num | Body | string | Customer or contract reference number for SEAAL (Algiers & Tipaza water) | SEAAL |
Phase 2: Pre-Save Tracking Metadata — POST /api/operations/facture-data/
Save essential metadata into the server (Sonelgaz EBB key, ADE payment code, AT number, SEAAL ref).
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"
}'Phase 3: Submit Payment Settlement — POST /services/operation_post

Sonelgaz
Société Nationale de l'Électricité et du Gaz
Payment Request Example
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": " "
}'Service Operator
"sonelgaz"Required Fields

Algérie Télécom
Algérie Télécom (Idoom Fixe & 4G)
Payment Request Example
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"
}'Service Operator
"AT"Required Fields

ADE
Algérienne Des Eaux
Payment Request Example
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"
}'Service Operator
"ade"Required Fields

SEAAL
Société des Eaux et de l'Assainissement d'Alger
Payment Request Example
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"
}'Service Operator
"seaal"Required Fields
Payment Request Parameters
| Parameter | Type | Description | Required For |
|---|---|---|---|
encrypted_sk | string | Encrypted SofizPay/merchant secret key for authentication | All Services |
amount | number | Payment amount in DZD | All Services |
operator | string | Service provider: sonelgaz, AT, ade, or seaal | All Services |
offer | string | Service offer type: sonelgaz, AT, ade, or SEAAL | All Services |
bill | string | Bill number, customer ID, or payment reference | All Services |
ebb | string | EBB verification key (Clé EBB) from Sonelgaz paper bill barcode | Sonelgaz |
c_paiement | string | Electronic payment code from ADE water bill (c_paiement) | ADE |
phone | string | Customer phone number or landline (Algérie Télécom, SEAAL) | AT / SEAAL |
memo | string | Payment memo in format 00:{number} (Algérie Télécom, SEAAL) | AT / SEAAL |
montant | number | Amount in DZD specifically passed for Algérie Télécom / Idoom | Algérie Télécom |
Success Response (200)
{
"status": "success",
"message": "Bill payment completed successfully",
"operation_id": "OP_DZ_000000000000",
"transaction_id": "TXN_000000000",
"transaction_status": "confirmed"
}Note: The bill payment will be processed through SofizPay gateway and confirmation will be issued immediately.