lomi.
ApiCharge

Create card charge (client_secret)

Create card charge (client_secret)

Aperçu

Create card charge (client_secret)

Creates an embedded card charge and returns the client_secret for your payment UI.

Quand l’utiliser

Utilisez pour la saisie carte dans votre application lorsque vous gérez l’UI produit et la tokenisation.

À savoir

Ne journalisez ni n’exposez client_secret publiquement ; traitez-le comme une capacité courte durée pour le SDK client.

Voir aussi

Créer une session checkout si vous préférez l’encaissement hébergé.

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/card

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: 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
201Card charge created

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/card" \
  -H "X-API-KEY: $LOMI_SECRET_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.

Sur cette page