lomi.
Payments

Payment Requests

Send payment requests to customers with expiration dates.

The Payment Requests API allows you to create timed payment requests for customers. Useful for invoicing and B2B payments.

Create a payment request

Request Body

FieldTypeRequiredDescription
amountnumberYesAmount to request
currency_codestringYesCurrency (XOF, USD, etc.)
expiry_datestringYesExpiration date (ISO 8601)
descriptionstringNoPayment description
customer_idstringNoExisting customer ID
payment_referencestringNoInvoice/order reference
metadataobjectNoCustom key-value pairs
import { LomiSDK } from '@lomi./sdk';

const lomi = new LomiSDK({
  apiKey: process.env.LOMI_API_KEY!,
  environment: 'live',
});

const request = await lomi.paymentRequests.create({
  amount: 50000,
  currency_code: 'XOF',
  expiry_date: '2024-02-15T23:59:59Z',
  description: 'Invoice #INV-2024-001',
  customer_id: 'cus_abc123...',
  payment_reference: 'INV-2024-001',
  metadata: {
    invoice_id: 'INV-2024-001',
  },
});

console.log(`Payment request created: ${request.id}`);
console.log(`Payment URL: ${request.payment_url}`);
from lomi import LomiClient
import os

client = LomiClient(
    api_key=os.environ["LOMI_API_KEY"],
    environment="test"
)

request = client.payment_requests.create({
    "amount": 50000,
    "currency_code": "XOF",
    "expiry_date": "2024-02-15T23:59:59Z",
    "description": "Invoice #INV-2024-001",
    "customer_id": "cus_abc123...",
    "payment_reference": "INV-2024-001"
})

print(f"Payment request: {request['id']}")
curl -X POST "https://api.lomi.africa/payment-requests" \
  -H "X-API-KEY: $LOMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "amount": 50000,
    "currency_code": "XOF",
    "expiry_date": "2024-02-15T23:59:59Z",
    "description": "Invoice #INV-2024-001",
    "customer_id": "cus_abc123...",
    "payment_reference": "INV-2024-001"
  }'

List payment requests

Retrieve all payment requests with optional filtering.

Query Parameters

ParameterTypeDescription
statusstringFilter by status: pending, completed, failed, expired
customerIdstringFilter by customer ID
limitnumberResults per page (default: 20)
offsetnumberPagination offset (default: 0)
const requests = await lomi.paymentRequests.list({
  status: 'pending',
  limit: 20,
});
requests = client.payment_requests.list(status="pending", limit=20)
curl -X GET "https://api.lomi.africa/payment-requests?status=pending&limit=20" \
  -H "X-API-KEY: $LOMI_API_KEY"

Get a payment request

Retrieve details of a specific payment request.

const request = await lomi.paymentRequests.get('pr_abc123...');
console.log(`Status: ${request.status}`);
request = client.payment_requests.get('pr_abc123...')
curl -X GET "https://api.lomi.africa/payment-requests/pr_abc123..." \
  -H "X-API-KEY: $LOMI_API_KEY"

Payment Request Object

FieldTypeDescription
idstringUnique identifier
amountnumberRequested amount
currency_codestringCurrency
statusstringpending, completed, failed, expired
descriptionstringDescription
customer_idstringAssociated customer
payment_referencestringReference number
payment_urlstringURL for customer to pay
expiry_datestringExpiration timestamp
transaction_idstringCreated transaction (when paid)
metadataobjectCustom metadata
created_atstringCreation timestamp

Webhooks

EventDescription
payment_request.completedPayment received
payment_request.expiredRequest expired without payment

Error Responses

StatusDescription
400Invalid input
401Invalid or missing API key
404Request not found

On this page