lomi.
Encaissements directs avancés

Créer un encaissement carte (client_secret)

Créer un encaissement carte (client_secret)

Aperçu

Créer un encaissement carte (client_secret)

Crée un encaissement carte embarqué et renvoie le client_secret pour votre interface de paiement.

Quand utiliser cet endpoint

Utilisez cet endpoint quand vous devez exécuter POST /charge/card (Créer un encaissement carte (client_secret)).

Authentification

Les routes marchandes nécessitent une clé API dans l’en-tête X-API-KEY (voir Aperçu de l’intégration). Utilisez une clé test avec https://sandbox.api.lomi.africa et une clé live avec https://api.lomi.africa.

Point de terminaison

POST /charge/card

URLs de base :

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

Requête

Paramètres de chemin

Aucun paramètre de chemin au-delà du motif d’URL.

Paramètres de requête

Aucun paramètre de requête.

Corps de la requête

Charge utile JSON.

Schéma: CreateCardChargeDto

ChampObligatoireTypeDescription
amountOuinumberAmount to charge in the original currency
currency_codeNonenum ("XOF", "USD", "EUR")Currency code
currencyNonenum ("XOF", "USD", "EUR")Backward-compatible alias for currency_code. Use currency_code in new integrations.
customer_idNonstringInternal customer UUID (v4). Alternative: send customer_email + customer_name to create/find a customer.
customer_emailNonstringCustomer email — required together with customer_name when customer_id is omitted.
customer_nameNonstringCustomer display name — required together with customer_email when customer_id is omitted.
customer_phoneNonstringCustomer phone number
descriptionNonstringDescription shown in payment providers and logs
payment_referenceNonstringReference included in metadata for reconciliation
product_idNonstringOptional product UUID for metadata and reconciliation
subscription_idNonstringOptional subscription UUID for metadata and reconciliation
quantityNonnumberOptional quantity for internal reconciliation
metadataNonobjectCustom metadata merged into provider metadata
appearance_themeNonenum ("light", "dark", "flat")Optional Payment Element theme for client-side card UI: light, dark, or flat.
appearance_border_radiusNonnumberOptional Payment Element border radius (px) returned for client-side rendering.
appearance_billing_addressNonenum ("auto", "never")Optional Payment Element billing address collection mode. Use never to hide country/address selector in Payment Element UI.

Exemple de corps :

{
  "amount": 10000
}

Réponses

StatutDescription
201Encaissement carte créé

Schéma de réponse : CardChargeResponseDtosuccess et data avec client_secret, id (ex. pi_…), montants, status, et appearance optionnel pour l’UI Payment Element.

Erreurs

Les erreurs suivent le format JSON standard (code de statut et message lisible par machine). Validez les entrées avant appel ; 401 indique une clé manquante/invalide, 404 une ressource introuvable pour cette organisation, 429 une limitation de débit. Pour les retries sûrs sur les créations, envoyez une clé d’idempotence quand votre flux le permet.

Exemple

curl -sS -X POST "https://sandbox.api.lomi.africa/charge/card" \
  -H "X-API-KEY: $LOMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":10000}'

OpenAPI

  • operationId: ChargesController_createCardCharge
  • Operation: POST /charge/card

Schémas complets et Try it : référence API. Contrat machine : openapi.json à la racine des docs.

Sur cette page