lomi.
Encaissements directs avancés

Create MTN MoMo charge

Create MTN MoMo charge

Aperçu

Create MTN MoMo charge

Initiates an MTN Mobile Money RequestToPay. With a test API key the transaction completes in the ledger without calling the MTN sandbox.

Quand l’utiliser

Utilisez cet endpoint quand vous devez exécuter POST /charge/mtn (Create MTN MoMo charge).

Authentification

Les routes marchandes nécessitent une clé API dans l’en-tête X-API-KEY (voir Vue d’ensemble). Utilisez une clé test avec https://sandbox.api.lomi.africa et une clé live avec https://api.lomi.africa.

Endpoint

POST /charge/mtn

URLs de base :

  • https://sandbox.api.lomi.africa
  • https://api.lomi.africa

Requête

Paramètres d’URL

Pas d’autre paramètre dans l’URL.

Paramètres de requête

Aucun paramètre de requête.

En-têtes

NomEmplacementObligatoireSchémaDescription
Lomi-AccountheaderNon-Optional lomi. Network account id (acct_...). When present, the API key acts as the Operator and the request targets the connected Member Account.

Corps de la requête

Corps JSON.

Schéma: CreateMtnChargeDto

ChampObligatoireTypeDescription
amountOuinumber-
currencyOuistring-
organizationIdNonstring-
merchantIdNonstring-
customerOuiCustomerDto-
descriptionNonstring-
countryCodeNonstring-
productIdNonstring-
subscriptionIdNonstring-
quantityNonnumber-

Exemple de corps :

{
  "amount": 1000,
  "currency": "XOF",
  "customer": {
    "name": "...",
    "phoneNumber": "..."
  }
}

Réponses

StatutDescription
201MTN charge initiated

Erreurs

Les erreurs suivent un format JSON standard. 401 : clé manquante ou invalide. 404 : ressource introuvable. 429 : trop de requêtes. Pour les créations, envoyez une clé d’idempotence si votre flux le permet.

Exemple

curl -sS -X POST "https://sandbox.api.lomi.africa/charge/mtn" \
  -H "X-API-KEY: $LOMI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":1000,"currency":"XOF","customer":{"name":"...","phoneNumber":"..."}}'

OpenAPI

  • operationId: ChargesController_createMtnCharge
  • Operation: POST /charge/mtn

Schémas complets et Try it : référence API.

Sur cette page