Collections
Payment Links
Payment Links let you generate shareable URLs that accept card, mobile money, bank transfer, or USSD payments — without writing a checkout form yourself. Useful for invoices, donations, event tickets, and any scenario where you need to collect money without a custom flow.
Links can be fixed-amount (you set the price) or flexible (the payer chooses within limits). They support use caps, expiry dates, custom slugs, and per-link analytics.
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /payment-links | Create a new link |
| GET | /payment-links | List all links (paginated) |
| GET | /payment-links/{id} | Get link details + charge stats |
| PATCH | /payment-links/{id} | Update a link |
| DELETE | /payment-links/{id} | Archive a link (irreversible) |
Create a Payment Link
| Field | Required | Description |
|---|---|---|
title | Required | Display title shown on the payment page, e.g. Invoice #123. |
amount_type | Required | fixed — exact amount. flexible — payer picks amount. |
currency | Required | ISO 4217 code, e.g. RWF. |
amount | If fixed | The exact amount to collect. |
min_amount | Optional | Minimum payer amount (flexible only). |
max_amount | Optional | Maximum payer amount (flexible only). |
payment_types | Optional | Array of accepted methods: card, mobile_money, ussd, bank_transfer. Defaults to all. |
slug | Optional | Custom URL slug. Auto-generated if omitted. |
description | Optional | Extended description shown on the payment page. |
redirect_url | Optional | Where to send the payer after payment completes. |
max_uses | Optional | Maximum number of successful payments. null = unlimited. |
expires_at | Optional | Expiry date/time in format YYYY-MM-DD HH:MM:SS. |
collect_phone | Optional | Ask payer for phone number. Default true. |
collect_name | Optional | Ask payer for name. Default true. |
collect_address | Optional | Ask payer for address. Default false. |
logo_url | Optional | Logo image URL shown on the payment page. |
metadata | Optional | Custom JSON object for your internal reference. |
cURL
curl -X POST \ https://pay.digitalservicescenter.rw/generation/v2/payment-links \ -H "X-DGS-API-Key: YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "title": "Invoice #123", "amount_type": "fixed", "amount": 50000, "currency": "RWF", "payment_types": ["card", "mobile_money"], "max_uses": 1, "expires_at": "2026-12-31 23:59:59" }'
JSON
{
"title": "Invoice #123",
"amount_type": "fixed",
"amount": 50000,
"currency": "RWF",
"payment_types": ["card", "mobile_money"],
"max_uses": 1,
"expires_at": "2026-12-31 23:59:59"
}
JSON — Success Response
{
"status": "success",
"message": "Payment link created",
"link": {
"id": "25a5643d-31de-490d-808d-82af72fdd097",
"slug": "invoice-123",
"url": "https://pay.digitalservicescenter.rw/generation/pay/invoice-123",
"title": "Invoice #123",
"amount_type": "fixed",
"amount": 50000,
"currency": "RWF",
"payment_types": ["card", "mobile_money"],
"use_count": 0,
"max_uses": 1,
"status": "active",
"expires_at": "2026-12-31 23:59:59",
"created_at": "2026-04-03 10:00:00"
}
}
Get Link Details & Stats
cURL
curl -X GET \ https://pay.digitalservicescenter.rw/generation/v2/payment-links/25a5643d-31de-490d-808d-82af72fdd097 \ -H "X-DGS-API-Key: YOUR_API_KEY"
JSON — Includes stats and recent charges
{
"status": "success",
"link": { /* same fields as create response */ },
"stats": {
"total_charges": 4,
"successful_charges": 1,
"pending_charges": 0,
"failed_charges": 3,
"total_collected": 500,
"currency": "RWF"
},
"recent_charges": [
{
"id": "5de825d0-...",
"amount": "500.00",
"currency": "RWF",
"status": "success",
"created_at": "2026-03-09 15:56:32"
}
]
}
Archive (Delete) a Link
JSON — Archive response
{
"status": "success",
"message": "Payment link archived"
}
Archive is Permanent
Once archived, a link cannot be reactivated or used to accept new payments. Archive only when you are certain the link is no longer needed.