lomi.
ApiCharge

Create Switch charge (server-side card authorization)

Create Switch charge (server-side card authorization)

Essayer cette requête dans le sandbox
Chargement des préférences Try-it…

POSThttps://sandbox.api.lomi.africa/charge/switch

Aperçu

Create Switch charge (server-side card authorization)

Authorizes a card from server-supplied credentials and routes it across acquiring rails. May return a redirect URL for 3DS authentication or signal retry_other_rail to fall back to another rail. Requires a PCI-DSS-compliant integration.

Quand l’utiliser

Utilisez lorsque votre intégration est conforme PCI-DSS et soumet les informations de carte côté serveur, plutôt que de collecter les cartes via le checkout hébergé ou Payment Elements.

À savoir

La soumission des informations de carte brutes nécessite une intégration conforme PCI-DSS. Suivez next_action pour la 3DS et retry_other_rail en cas de refus du rail principal.

Voir aussi

Créer un encaissement carte · Encaissements directs

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

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: CreateSwitchChargeDto

ChampObligatoireTypeDescription
amountOuinumberAmount in XOF francs
currency_codeNonenum ("XOF")-
panOuistring-
expiryOuistringMM/YY or YYMM
cvvOuistring-
customer_idNonstring-
customer_emailNonstring-
customer_nameNonstring-
customer_phoneNonstring-
descriptionNonstring-
payment_referenceNonstring-
product_idNonstring-
subscription_idNonstring-
checkout_session_idNonstring-
quantityNonnumber-
metadataNonobject-
ecom_ipNonstringCustomer IP for EComIp

Exemple de corps :

{
  "amount": 10000,
  "pan": "4221941234569109",
  "expiry": "06/25",
  "cvv": "123"
}

Réponses

StatutDescription
201Switch 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/switch" \
  -H "X-API-KEY: $LOMI_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{"amount":10000,"pan":"4221941234569109","expiry":"06/25","cvv":"123"}'

OpenAPI

  • operationId: ChargesController_createSwitchCharge
  • Operation: POST /charge/switch

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

Sur cette page