lomi.

Create Switch charge

Create Switch charge

Overview

Create Switch charge

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

When to use this

Use when your integration is PCI-DSS compliant and submits card credentials server-side, rather than collecting cards through hosted checkout or embedded Payment Elements.

Good to know

Submitting raw card credentials requires a PCI-DSS-compliant integration. Follow next_action for 3DS redirects and retry_other_rail when the primary rail declines.

See also

Create card charge · Direct charges

Authentication

Merchant routes require an API key in the X-API-KEY header (see Integration overview). Use a test key against https://sandbox.api.lomi.africa and a live key against https://api.lomi.africa.

Endpoint

POST /charge/switch

Base URLs:

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

Request

Path parameters

No path parameters beyond the URL pattern.

Query parameters

No query parameters.

Headers

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

Request body

JSON request payload.

Schema: CreateSwitchChargeDto

FieldRequiredTypeDescription
amountYesnumberAmount in XOF francs
currency_codeNoenum ("XOF")-
panYesstring-
expiryYesstringMM/YY or YYMM
cvvYesstring-
customer_idNostring-
customer_emailNostring-
customer_nameNostring-
customer_phoneNostring-
descriptionNostring-
payment_referenceNostring-
product_idNostring-
subscription_idNostring-
checkout_session_idNostring-
quantityNonumber-
metadataNoobject-
ecom_ipNostringCustomer IP for EComIp

Example body:

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

Responses

StatusDescription
201Switch charge created

Errors

Errors follow the standard JSON error format (status code and machine-readable message). Validate inputs before calling; 401 indicates a missing/invalid key, 404 a missing resource for this organization, 429 rate limiting. For safe retries on create-style calls, send an idempotency key when your flow supports it.

Example

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

Full schemas and Try it: API reference. Machine-readable contract: repo apps/docs/openapi.json.

On this page