lomi.
Payments

Direct charges

Initiate direct payments using specific providers like Wave.

The Charges API allows you to initiate direct payments with specific providers. This is useful when you want to build a custom checkout experience or charge a customer directly without redirecting them to a hosted checkout page immediately (though some providers like Wave may still return a checkout URL).

Create a Wave Charge

Initiate a payment request specifically for Wave Mobile Money.

Endpoint

POST /charge/wave

Request Body

FieldTypeRequiredDescription
amountnumberYesThe amount to charge (minimum 100).
currencystringYesThe currency code (must be XOF).
customerobjectYesCustomer details object.
customer.namestringYesFull name of the customer.
customer.emailstringNoEmail address of the customer.
customer.phoneNumberstringNoPhone number of the customer (e.g., +2250102030405).
descriptionstringNoDescription of the charge.
successUrlstringNoURL to redirect after successful payment.
errorUrlstringNoURL to redirect after failed payment.
environmentstringNolive or test (defaults to live).
curl -X POST "https://api.lomi.africa/charge/wave" \
  -H "Content-Type: application/json" \
  -H "X-API-KEY: $LOMI_API_KEY" \
  -d '{
    "amount": 1000,
    "currency": "XOF",
    "customer": {
      "name": "Jane Doe",
      "email": "jane@example.com",
      "phoneNumber": "+2250707070707"
    },
    "description": "Payment for Service",
    "successUrl": "https://your-site.com/success",
    "errorUrl": "https://your-site.com/error"
  }'
const response = await fetch('https://api.lomi.africa/charge/wave', {
  method: 'POST',
  headers: {
    'Content-Type': 'application/json',
    'X-API-KEY': process.env.LOMI_API_KEY!,
  },
  body: JSON.stringify({
    amount: 1000,
    currency: 'XOF',
    customer: {
      name: 'Jane Doe',
      email: 'jane@example.com',
      phoneNumber: '+2250707070707',
    },
    description: 'Payment for Service',
    successUrl: 'https://your-site.com/success',
    errorUrl: 'https://your-site.com/error',
  }),
});

const data = await response.json();
import requests
import os

url = "https://api.lomi.africa/charge/wave"
headers = {
    "Content-Type": "application/json",
    "X-API-KEY": os.environ["LOMI_API_KEY"]
}
payload = {
    "amount": 1000,
    "currency": "XOF",
    "customer": {
        "name": "Jane Doe",
        "email": "jane@example.com",
        "phoneNumber": "+2250707070707"
    },
    "description": "Payment for Service",
    "successUrl": "https://your-site.com/success",
    "errorUrl": "https://your-site.com/error"
}

response = requests.post(url, json=payload, headers=headers)
data = response.json()

Response

Returns a 201 Created status with the Wave session details and checkout URL.

{
  "transactionId": "1a0a4df9-ae73-4776-b955-57522625421c",
  "checkoutUrl": "https://pay.wave.com/c/cos-22txmv4682mee?...",
  "waveSession": {
    "id": "cos-22txmv4682mee",
    "amount": "1000",
    "checkout_status": "open",
    "payment_status": "processing",
    "currency": "XOF",
    "aggregated_merchant_id": "am-1wfm8v3z023p4",
    ...
  }
}

Error Responses

StatusDescription
400Bad Request (e.g., missing provider configuration, invalid amount).
401Unauthorized (invalid API Key).
500Internal Server Error (payment provider failure).

On this page