lomi.
Payments

Payment Links

Create shareable payment links for products or custom amounts.

The Payment Links API allows you to create reusable, shareable links for accepting payments. Links can be tied to a product or have a custom amount.

TypeDescription
productLinks to a specific product. Amount is calculated from product price.
instantCustom amount payment. Requires amount field.

Request Body

FieldTypeRequiredDescription
link_typestringYesproduct or instant
titlestringYesLink title
currency_codestringYesCurrency (XOF, USD, etc.)
descriptionstringNoLink description
amountnumberInstant onlyAmount for instant links
product_idstringProduct onlyProduct ID for product links
price_idstringNoSpecific price (if product has multiple)
allow_coupon_codebooleanNoAllow discount codes (default: false)
allow_quantitybooleanNoAllow quantity changes (default: false)
require_billing_addressbooleanNoRequire billing (default: true)
expires_atstringNoExpiration date (ISO 8601)
success_urlstringNoSuccess redirect URL
cancel_urlstringNoCancel redirect URL
metadataobjectNoCustom key-value pairs
import { LomiSDK } from '@lomi./sdk';

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

// Product link
const productLink = await lomi.paymentLinks.create({
  link_type: 'product',
  title: 'Premium Subscription',
  currency_code: 'XOF',
  product_id: 'prod_abc123...',
  allow_coupon_code: true,
  success_url: 'https://your-site.com/success',
});

// Instant link (custom amount)
const instantLink = await lomi.paymentLinks.create({
  link_type: 'instant',
  title: 'Donation',
  currency_code: 'XOF',
  amount: 5000,
  description: 'Support our cause',
  success_url: 'https://your-site.com/thank-you',
});

console.log(`Share this link: ${productLink.url}`);
from lomi import LomiClient
import os

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

# Product link
product_link = client.payment_links.create({
    "link_type": "product",
    "title": "Premium Subscription",
    "currency_code": "XOF",
    "product_id": "prod_abc123...",
    "allow_coupon_code": True,
    "success_url": "https://your-site.com/success"
})

# Instant link
instant_link = client.payment_links.create({
    "link_type": "instant",
    "title": "Donation",
    "currency_code": "XOF",
    "amount": 5000,
    "description": "Support our cause"
})

print(f"Share this link: {product_link['url']}")
curl -X POST "https://api.lomi.africa/payment-links" \
  -H "X-API-KEY: $LOMI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "link_type": "product",
    "title": "Premium Subscription",
    "currency_code": "XOF",
    "product_id": "prod_abc123...",
    "allow_coupon_code": true,
    "success_url": "https://your-site.com/success"
  }'

Retrieve all payment links with optional filtering.

Query Parameters

ParameterTypeDescription
linkTypestringFilter by type: product, instant
isActivebooleanFilter by active status
limitnumberResults per page (default: 20)
offsetnumberPagination offset (default: 0)
const links = await lomi.paymentLinks.list({
  linkType: 'product',
  isActive: true,
  limit: 20,
});
links = client.payment_links.list(
    linkType="product",
    isActive=True,
    limit=20
)
curl -X GET "https://api.lomi.africa/payment-links?linkType=product&isActive=true&limit=20" \
  -H "X-API-KEY: $LOMI_API_KEY"

Retrieve details of a specific payment link.

const link = await lomi.paymentLinks.get('pl_abc123...');
console.log(`URL: ${link.url}`);
link = client.payment_links.get('pl_abc123...')
curl -X GET "https://api.lomi.africa/payment-links/pl_abc123..." \
  -H "X-API-KEY: $LOMI_API_KEY"

FieldTypeDescription
idstringUnique identifier
urlstringShareable payment URL
link_typestringproduct or instant
titlestringLink title
descriptionstringLink description
amountnumberAmount (instant links)
currency_codestringCurrency code
product_idstringAssociated product (product links)
is_activebooleanActive status
expires_atstringExpiration timestamp
metadataobjectCustom metadata
created_atstringCreation timestamp

Error Responses

StatusDescription
400Invalid input (e.g., amount on product link)
401Invalid or missing API key
404Link not found or access denied

On this page