Documentation API
Documentation de l’API client et de l’API revendeur
Client API Documentation
Manage your own SIP accounts, balance, vouchers, tariff plan, Caller ID, call history, refill history and account password through a clean JSON API.
Authorization
Every request must include your API key in the HTTP header.
X-API-Key: YOUR_API_KEY
Account status
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=me"
{
"success": true,
"data": {
"id": 1001,
"username": "1234567801",
"balance": "1.0000",
"active": 1,
"id_plan": 101,
"plan_name": "STANDARD-PLAN"
}
}
Balance
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=balance"
Available plans
Returns only tariff plans available to your account.
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=plans"
Change plan
Change your tariff plan to one of the available plans.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id_plan":8}' \
"https://magnusbilling.net/client-api/index.php?endpoint=change-plan"
SIP accounts
List your SIP accounts, including SIP login and SIP password.
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=sip"
Create additional SIP account
Create an additional SIP account under your own account.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://magnusbilling.net/client-api/index.php?endpoint=create-sip"
You can also provide your own SIP password:
{
"password": "StrongSipPass123"
}
Change SIP password
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"1234567802","password":"NewSipPass456"}' \
"https://magnusbilling.net/client-api/index.php?endpoint=update-sip-password"
Delete SIP account
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name":"1234567802"}' \
"https://magnusbilling.net/client-api/index.php?endpoint=delete-sip"
IP Authentication
Manage IP-based SIP authentication for your own SIP accounts. Your regular SIP login/password continues working.
List IP authorizations
List your SIP accounts and active/inactive IP-auth records.
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=ip-auth-list"
Create IP authorization
Add a public static PBX IP address to one of your SIP accounts.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"sip_login":"1234567801","ip":"203.0.113.10"}' \
"https://magnusbilling.net/client-api/index.php?endpoint=ip-auth-create"
{
"success": true,
"message": "IP authentication created",
"data": {
"id": 6,
"sip_login": "1234567801",
"peer_name": "1234567801_ipa1",
"ip": "203.0.113.10",
"port": 5060,
"status": 1
}
}
Disable IP authorization
The IP-auth record stays in your account but becomes inactive. The SIP peer is removed from Asterisk.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":6}' \
"https://magnusbilling.net/client-api/index.php?endpoint=ip-auth-disable"
Enable IP authorization
Re-enable a previously disabled IP-auth record.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":6}' \
"https://magnusbilling.net/client-api/index.php?endpoint=ip-auth-enable"
Delete IP authorization
Delete the IP-auth record permanently.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":6}' \
"https://magnusbilling.net/client-api/index.php?endpoint=ip-auth-delete"
Caller ID
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=callerids"
Add Caller ID
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"cid":"+1234567890","name":"Main Caller ID","set_active":true}' \
"https://magnusbilling.net/client-api/index.php?endpoint=add-callerid"
Set existing Caller ID as active
{
"cid": "+1234567890"
}
Delete Caller ID
{
"id": 80
}
Clear active SIP Caller ID
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}' \
"https://magnusbilling.net/client-api/index.php?endpoint=clear-callerid"
Call history
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=calls&limit=50&offset=0"
Refill history
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/client-api/index.php?endpoint=refills&limit=50&offset=0"
Redeem voucher
Redeem an existing voucher code and add its value to your balance.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"voucher":"123456"}' \
"https://magnusbilling.net/client-api/index.php?endpoint=redeem-voucher"
Change account password
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"current_password":"OldPassword","new_password":"NewPassword987"}' \
"https://magnusbilling.net/client-api/index.php?endpoint=change-password"
API SMS / CryptoSMS
Envoyez des SMS depuis votre compte MagnusBilling avec le même X-API-Key. Le coût est débité du solde du compte.
Autorisation
Utilisez la même clé API que pour Client API ou Reseller API.
X-API-Key: YOUR_API_KEY
Le Sender ID / Caller ID n’est pas garanti. L’expéditeur affiché dépend du fournisseur, du pays de destination et des règles de l’opérateur mobile.
Le SMS est facturé pour la tentative d’envoi. La livraison finale dépend de l’opérateur mobile destinataire.
Endpoints
- GET
?endpoint=providers— Liste des fournisseurs - GET
?endpoint=rates— Tarifs SMS - GET
?endpoint=quota&provider=cryptosms— Estimation SMS disponible - POST
?endpoint=send— Envoyer un SMS - POST
?endpoint=schedule— Planifier un SMS - GET
?endpoint=scheduled&limit=20— Liste des SMS planifiés - POST
?endpoint=cancel-scheduled— Annuler un SMS planifié - POST
?endpoint=bulk— Campagne SMS groupée - GET
?endpoint=campaigns&limit=20— Liste des campagnes groupées - POST
?endpoint=cancel-campaign— Annuler une campagne groupée - GET
?endpoint=status&id=SMS_ID— Vérifier le statut SMS - GET
?endpoint=history&limit=20— Historique SMS
Envoyer un SMS
curl -k -sS \
-X POST "https://magnusbilling.net/sms-api/index.php?endpoint=send" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+447575396991",
"provider": "cryptosms",
"sender_id": "MyBrand",
"message": "MyBrand: Your code is 123456"
}'
{
"success": true,
"sms_id": 1,
"provider": "cryptosms",
"provider_name": "CryptoSMS",
"status": "SENT_TO_PROVIDER",
"balance_after": "49.6500",
"sender_id": {
"requested": "MyBrand",
"guaranteed": false,
"warning": "Sender ID / Caller ID is not guaranteed."
}
}
Planifier un SMS
curl -k -sS \
-X POST "https://magnusbilling.net/sms-api/index.php?endpoint=schedule" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1234567890",
"provider": "cryptosms",
"sender_id": "MyBrand",
"message": "API scheduled test",
"scheduled_at": "2026-05-09 23:00:00"
}'
{
"success": true,
"scheduled_sms_id": 10,
"provider": "cryptosms",
"status": "SCHEDULED",
"server_utc_offset": "+03:00"
}
Annuler un SMS planifié
curl -k -sS \
-X POST "https://magnusbilling.net/sms-api/index.php?endpoint=cancel-scheduled" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"scheduled_sms_id":10}'
Campagne SMS groupée
curl -k -sS \
-X POST "https://magnusbilling.net/sms-api/index.php?endpoint=bulk" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"provider": "cryptosms",
"sender_id": "MyBrand",
"message": "API bulk test",
"scheduled_at": "2026-05-09 23:00:00",
"phones": ["+1234567890", "+1234567891"]
}'
{
"success": true,
"campaign_id": 20,
"recipients_queued": 2,
"status": "QUEUED"
}
Liste des campagnes groupées
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/sms-api/index.php?endpoint=campaigns&limit=20"
Annuler une campagne groupée
curl -k -sS \
-X POST "https://magnusbilling.net/sms-api/index.php?endpoint=cancel-campaign" \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"campaign_id":20}'
Vérifier le statut SMS
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/sms-api/index.php?endpoint=status&id=1"
Historique SMS
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/sms-api/index.php?endpoint=history&limit=20"
API eSIM / Forfaits data mondiaux
Vendez des forfaits data eSIM depuis votre compte MagnusBilling.net avec le même X-API-Key.
Authorization
Use the same API key that is already used for Client API or Reseller API.
Endpoints
- GET
?endpoint=packages&q=Europe&limit=20— List packages and current prices - GET
?endpoint=coverage&package_code=PACKAGE_CODE— Package coverage by country and network - GET
?endpoint=balance— Account balance - POST
?endpoint=buy— Buy eSIM package - GET
?endpoint=orders— Order history, QR/activation data and usage - GET
?endpoint=sync-order&order_id=ORDER_ID— Refresh order, QR and data usage
List packages
curl -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/esim-api/index.php?endpoint=packages&q=Europe&limit=5"
Buy eSIM
curl -sS -X POST "https://magnusbilling.net/esim-api/index.php?endpoint=buy" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_API_KEY" \
-d '{"package_code":"P2CYMUS93"}'
Orders and usage
curl -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/esim-api/index.php?endpoint=orders"
Security rules
- The client can access only their own account.
- The client can access only their own SIP accounts.
- The client can manage IP authentication only for their own SIP accounts.
- The client can add, change and delete only their own Caller IDs.
- The client can choose tariff plan only from the available plan list.
- The client cannot create, edit or delete tariff plans.
- The client can redeem only existing voucher codes.
- The client cannot delete the main SIP account.
- The client cannot manage other clients, resellers or admin data.
Reseller API Documentation
Create SIP clients, manage balances, view reseller plans, check client status, and control customers through a clean JSON API.
Authorization
Every request must include your API key in the HTTP header.
X-API-Key: YOUR_API_KEY
Account status
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/reseller-api/index.php?endpoint=me"
{
"ok": true,
"reseller": {
"id": 1001,
"username": "1234567890",
"group": "Agent",
"balance": 1,
"active": true
}
}
Plans
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/reseller-api/index.php?endpoint=plans"
{
"ok": true,
"plans": [
{
"id": 33,
"name": "TEST-RESELLER-PLAN",
"signup": true,
"initial_credit": 0,
"tariff_limit": 3,
"agent_rates": 66875
}
]
}
Create client
Create a new SIP client under your reseller account.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan_id":101}' \
"https://magnusbilling.net/reseller-api/index.php?endpoint=create-client"
You can also provide your own login and password:
{
"login": "1234567891",
"password": "StrongPass123",
"plan_id": 101
}
Get client
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/reseller-api/index.php?endpoint=client&login=1234567892"
Client list
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/reseller-api/index.php?endpoint=clients&limit=10&offset=0"
Modèle de facturation revendeur réel
L’endpoint transfer crédite le solde retail du client propre au revendeur. Il ne débite pas immédiatement le revendeur.
Par défaut, les tarifs des clients revendeur sont créés avec une marge de +20%. Le revendeur peut modifier la marge et les prix retail de ses clients.
Lorsque le client passe des appels, son solde est débité au tarif retail revendeur/client, et le solde revendeur est débité au tarif wholesale.
Si le solde wholesale du revendeur est épuisé ou insuffisant pour le bloc minimum, ses clients ne peuvent pas appeler même s’ils ont encore du crédit retail.
Créditer le solde client
Crédite le solde retail d’un client propre au revendeur. Cela ne débite pas immédiatement le revendeur; le solde wholesale est débité lorsque le client passe des appels.
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"login":"1234567892","amount":1,"external_id":"ORDER-DEMO-10001"}' \
"https://magnusbilling.net/reseller-api/index.php?endpoint=transfer"
Transactions
curl -k -sS \
-H "X-API-Key: YOUR_API_KEY" \
"https://magnusbilling.net/reseller-api/index.php?endpoint=transactions&limit=10&offset=0"
Filter only successful transactions:
https://magnusbilling.net/reseller-api/index.php?endpoint=transactions&status=success&limit=10&offset=0
Set client status
Deactivate client:
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"login":"1234567892","active":false}' \
"https://magnusbilling.net/reseller-api/index.php?endpoint=set-client-status"
Activate client:
{
"login": "1234567892",
"active": true
}
Change client plan
curl -k -sS \
-X POST \
-H "X-API-Key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"login":"1234567892","plan_id":101}' \
"https://magnusbilling.net/reseller-api/index.php?endpoint=change-plan"
API portail agent white-label
Endpoints pour portail PHP hébergé par l’agent: connexion client, tableau de bord, SIP, appels, paiements, tarifs, marge et token Web Phone.
Endpoints du portail client
- GET
?endpoint=portal-bootstrap— Vérification API/installation - POST
?endpoint=client-auth— Connexion client du portail agent - GET
?endpoint=client-dashboard&login=CLIENT_LOGIN— Tableau de bord client et solde visible - GET
?endpoint=client-sip&login=CLIENT_LOGIN— Comptes SIP client; comptes service masqués par défaut - GET
?endpoint=client-calls&login=CLIENT_LOGIN&limit=50— Appels réussis - GET
?endpoint=client-failed-calls&login=CLIENT_LOGIN&limit=50— Appels échoués - GET
?endpoint=client-refills&login=CLIENT_LOGIN&limit=50— Historique des recharges client - GET
?endpoint=client-callerids&login=CLIENT_LOGIN— Caller ID client - GET
?endpoint=client-rates&login=CLIENT_LOGIN&limit=100— Tarifs retail client
Paiement/recharge
Les paiements client sont reçus par le portail via Plisio, Heleket ou méthodes personnalisées. Après confirmation, le portail appelle register-agent-payment.
curl -sS -X POST "https://magnusbilling.net/reseller-api/index.php?endpoint=register-agent-payment" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"login": "CLIENT_LOGIN",
"amount": "20.00",
"currency": "EUR",
"provider": "plisio",
"external_id": "plisio_order_123",
"provider_txid": "tx_or_invoice_id",
"status": "paid"
}'
Endpoints de marge tarifaire
set-agent-markup utilise le plan retail existant. Si la marge demandée est déjà appliquée, les lignes de tarifs ne sont pas réécrites.
- GET
?endpoint=agent-markup— Marge actuelle et tarif retail - POST
?endpoint=preview-agent-markup— Aperçu des prix avec nouvelle marge - POST
?endpoint=set-agent-markup— Appliquer une nouvelle marge au tarif retail
curl -sS -X POST "https://magnusbilling.net/reseller-api/index.php?endpoint=set-agent-markup" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"markup_percent":50}'
Token Janus Web Phone
Le portail affiche un bouton Web Phone. Les comptes service comme _web1 sont internes à Janus et non affichés dans la liste SIP normale sauf include_service=1.
curl -sS -X POST "https://magnusbilling.net/reseller-api/index.php?endpoint=client-softphone-token" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{"login":"CLIENT_LOGIN"}'
API SMS revendeur / CryptoSMS
Les revendeurs peuvent envoyer des SMS pour leurs propres clients avec le même Reseller X-API-Key. Le paramètre client_login est obligatoire.
Endpoints disponibles
- POST
?endpoint=send— Envoyer un SMS - POST
?endpoint=schedule— Programmer un SMS - GET
?endpoint=scheduled&client_login=CLIENT_LOGIN&limit=20— SMS programmés - POST
?endpoint=cancel-scheduled— Annuler un SMS programmé - POST
?endpoint=bulk— Créer une campagne SMS - GET
?endpoint=campaigns&client_login=CLIENT_LOGIN&limit=20— Liste des campagnes - POST
?endpoint=cancel-campaign— Annuler une campagne - GET
?endpoint=quota&provider=cryptosms&client_login=CLIENT_LOGIN— Estimation SMS du client - GET
?endpoint=history&client_login=CLIENT_LOGIN&limit=20— Historique SMS du client - GET
?endpoint=status&id=SMS_ID&client_login=CLIENT_LOGIN— Statut SMS du client
Example: send SMS for your client
curl -sS -X POST "https://magnusbilling.net/sms-api/index.php?endpoint=send" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_login": "CLIENT_LOGIN",
"phone": "+1234567890",
"message": "Your SMS text",
"provider": "cryptosms",
"sender_id": "MyBrand"
}'
Example: bulk SMS campaign
curl -sS -X POST "https://magnusbilling.net/sms-api/index.php?endpoint=bulk" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"client_login": "CLIENT_LOGIN",
"phones": ["+1234567890", "+1234567891"],
"message": "Bulk SMS text",
"provider": "cryptosms",
"sender_id": "MyBrand",
"scheduled_at": "2026-05-10 16:30:00"
}'
API eSIM revendeur
Les revendeurs peuvent vendre des forfaits data eSIM avec la même clé X-API-Key revendeur. Les achats eSIM sont débités du solde revendeur.
Endpoints disponibles
- GET
?endpoint=packages&q=Europe&limit=20— Liste des forfaits eSIM et prix revendeur actuels - GET
?endpoint=coverage&package_code=PACKAGE_CODE— Pays et réseaux inclus dans un forfait - GET
?endpoint=balance— Vérifier le solde revendeur - POST
?endpoint=buy— Acheter un forfait eSIM - GET
?endpoint=orders— Commandes eSIM revendeur, données d’activation et usage - GET
?endpoint=sync-order&order_id=ORDER_ID— Actualiser les détails d’activation et les données restantes
Liste des forfaits eSIM
curl -sS \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
"https://magnusbilling.net/esim-api/index.php?endpoint=packages&q=Europe&limit=5"
Acheter un forfait eSIM
curl -sS -X POST "https://magnusbilling.net/esim-api/index.php?endpoint=buy" \
-H "Content-Type: application/json" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-d '{"package_code":"P2CYMUS93"}'
Commandes eSIM revendeur et usage
curl -sS \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
"https://magnusbilling.net/esim-api/index.php?endpoint=orders"
La réponse de commande inclut le nom du forfait, le prix, le statut, l’ICCID, les données d’activation, le volume total, utilisé, restant et la date d’expiration lorsque disponibles. L’usage peut être mis à jour avec un léger délai réseau.
Security rules
- The reseller can access only clients created under their Agent account.
- The reseller can use only their own plans.
- The reseller cannot access admin clients or other resellers' clients.
- Le revendeur ne peut créditer que ses propres clients. Les appels nécessitent toujours un solde wholesale revendeur disponible.
- SIP passwords are returned only once during client creation.
- Existing SIP passwords and secrets are not returned by client endpoints.
- White-label portal clients must never see reseller balance, wholesale rates, markup percentage or internal reseller credit logic.
- Service SIP accounts such as _webN and _ipaN are hidden from normal client SIP lists; Web Phone must use client-softphone-token.
API de gestion de compte pour portail agent
Endpoints supplémentaires pour les portails agent en marque blanche : réinitialisation du mot de passe, réinitialisation du mot de passe SIP et mise à jour du profil client.
Endpoints
- GET/POST
?endpoint=check-client-login- Vérifier si un identifiant existe ou est disponible - POST
?endpoint=reset-client-password- Générer un nouveau mot de passe temporaire pour le client - POST
?endpoint=set-client-password- Définir un mot de passe client choisi par le portail ou l’administrateur - POST
?endpoint=client-change-password- Changer le mot de passe client après vérification du mot de passe actuel - POST
?endpoint=reset-client-sip-password- Générer un nouveau mot de passe SIP temporaire pour un compte SIP normal - POST
?endpoint=client-profile-update- Mettre à jour le profil client : nom, email, téléphone et langue
curl -sS -X POST "https://magnusbilling.net/reseller-api/index.php?endpoint=reset-client-password" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"login":"6307210"}'
curl -sS -X POST "https://magnusbilling.net/reseller-api/index.php?endpoint=reset-client-sip-password" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"login":"6307210"}'
curl -sS -X POST "https://magnusbilling.net/reseller-api/index.php?endpoint=client-profile-update" \
-H "X-API-Key: YOUR_RESELLER_API_KEY" \
-H "Content-Type: application/json" \
--data '{"login":"6307210","email":"client@example.com","phone":"+123456789","language":"en"}'
Les comptes de service tels que _webN et _ipaN sont exclus de la réinitialisation du mot de passe SIP.