Skip to main content
Danipa

Payment Links

Create shareable payment links that let your customers pay with a single click — no integration required.

Overview

Payment links are the fastest way to accept payments. Create a link, share it with your customer via email, SMS, or social media, and get paid instantly via mobile money or card.

Each payment link has a unique short URL (e.g. https://pay.danipa.com/AbC12345) and a hosted payment page — no frontend integration needed.

Create a Payment Link

curl -X POST https://api.danipa.com/ms/v1/merchants/me/payment-links \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Widget Purchase",
    "description": "Pay for your widget order",
    "amount": 50.00,
    "currency": "GHS",
    "amountFixed": true
  }'

Response:

{
  "id": "pl-1",
  "shortCode": "AbC12345",
  "title": "Widget Purchase",
  "amount": 50.00,
  "currency": "GHS",
  "amountFixed": true,
  "status": "ACTIVE",
  "url": "https://pay.danipa.com/AbC12345",
  "totalCollected": 0,
  "paymentCount": 0,
  "createdAt": "2026-03-13T10:00:00Z"
}

Fixed vs. Flexible Amounts

ModeamountFixedUse Case
FixedtrueSell a product at a set price
FlexiblefalseAccept donations or tips. Optionally set minAmount / maxAmount
{
  "title": "Donate to School Fund",
  "amount": null,
  "currency": "GHS",
  "amountFixed": false,
  "minAmount": 1.00,
  "maxAmount": 500.00
}

List Payment Links

curl https://api.danipa.com/ms/v1/merchants/me/payment-links?page=0&size=20 \
  -H "Authorization: Bearer YOUR_API_KEY"

Returns a paginated response with content, totalElements, totalPages, number, and size.

Expiring Links

Set an expiration date to create time-limited offers:

{
  "title": "Flash Sale - 24h Only",
  "amount": 25.00,
  "currency": "GHS",
  "amountFixed": true,
  "expiresAt": "2026-03-14T23:59:59Z"
}

After the expiration date, the hosted payment page shows an "expired" message and the link status changes to EXPIRED.

Webhook Events

When a customer pays via a payment link, you receive a webhook event:

EventDescription
payment.completedCustomer successfully paid
payment.failedPayment attempt failed
payment.refundedPayment was refunded

See the Webhooks guide for setup and signature verification.

SDK Examples

Java

PaymentLink link = danipa.paymentLinks().create(
    CreatePaymentLinkRequest.builder()
        .title("Widget Purchase")
        .amount(new BigDecimal("50.00"))
        .currency("GHS")
        .amountFixed(true)
        .build()
);

System.out.println("Share this link: " + link.getUrl());

Node.js

const link = await danipa.paymentLinks.create({
  title: 'Widget Purchase',
  amount: 50.00,
  currency: 'GHS',
  amountFixed: true,
});

console.log(`Share this link: ${link.url}`);

PHP

$link = $danipa->paymentLinks->create([
    'title' => 'Widget Purchase',
    'amount' => 50.00,
    'currency' => 'GHS',
    'amountFixed' => true,
]);

echo "Share this link: " . $link->url;

Best Practices

  • Use descriptive titles — Customers see the title on the payment page
  • Set expiration dates for time-sensitive offers to avoid stale links
  • Monitor via webhooks — Don't poll for payment status; use webhooks instead
  • Track with analytics — View payment link performance in the Analytics dashboard