Authentication
All API requests require authentication using an API key.
Authorization: Bearer sk_live_xxxxxxxxxxxxxxxxxxxxxxxx
Use sk_test_* for testing and sk_live_* for production.
POST
/api/v1/payments
Create Payment
Create a new payment transaction.
Request Body
| Parameter | Type | Description |
|---|---|---|
| amount * | integer | Amount in smallest currency unit (e.g., cents) |
| currency * | string | 3-letter currency code (e.g., TZS, KES, USD) |
| method * | string | Payment method: mobile_money, bank_transfer, card |
| customer | object | Customer details (name, phone, email) |
| reference | string | Your internal reference ID |
Example Response
{
"id": "pay_123456789",
"amount": 10000,
"currency": "TZS",
"status": "pending",
"method": "mobile_money",
"customer": {
"name": "John Doe",
"phone": "+255700000000",
"email": "john@example.com"
},
"created_at": "2026-07-25T10:30:00Z"
}
GET
/api/v1/payments/{id}
Get Payment
Retrieve payment details by ID.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
| id * | string | Payment ID |
Example Response
{
"id": "pay_123456789",
"amount": 10000,
"currency": "TZS",
"status": "completed",
"method": "mobile_money",
"customer": {
"name": "John Doe",
"phone": "+255700000000",
"email": "john@example.com"
},
"completed_at": "2026-07-25T10:35:00Z",
"created_at": "2026-07-25T10:30:00Z"
}
POST
/api/v1/payment-links
Create Payment Link
Generate a payment link that can be shared with customers.
Request Body
| Parameter | Type | Description |
|---|---|---|
| amount * | integer | Amount in smallest currency unit |
| currency * | string | 3-letter currency code |
| description * | string | Description of the payment |
| expires_at | string | Expiry date (ISO 8601 format) |
| redirect_url | string | URL to redirect after payment |
Example Response
{
"id": "pl_987654321",
"url": "https://pay.pigapay.com/pl/987654321",
"amount": 10000,
"currency": "TZS",
"description": "Invoice #1234",
"status": "active",
"expires_at": "2026-08-25T10:30:00Z",
"created_at": "2026-07-25T10:30:00Z"
}
GET
/api/v1/transactions
List Transactions
List all transactions with optional filters.
Query Parameters
| Parameter | Type | Description |
|---|---|---|
| status | string | Filter by status: pending, completed, failed |
| from_date | string | Start date (ISO 8601) |
| to_date | string | End date (ISO 8601) |
| limit | integer | Number of results (default: 20, max: 100) |
| offset | integer | Pagination offset |
Example Response
{
"data": [
{
"id": "pay_123456789",
"amount": 10000,
"currency": "TZS",
"status": "completed",
"method": "mobile_money",
"created_at": "2026-07-25T10:30:00Z"
}
],
"pagination": {
"total": 50,
"limit": 20,
"offset": 0
}
}
POST
/api/v1/webhooks
Webhook Events
Receive real-time notifications for payment events.
Supported Events
| Event | Description |
|---|---|
payment.created |
Payment has been created |
payment.completed |
Payment has been completed successfully |
payment.failed |
Payment has failed |
payment.refunded |
Payment has been refunded |
Example Webhook Payload
{
"event": "payment.completed",
"timestamp": "2026-07-25T10:35:00Z",
"data": {
"id": "pay_123456789",
"amount": 10000,
"currency": "TZS",
"status": "completed",
"method": "mobile_money",
"customer": {
"name": "John Doe",
"phone": "+255700000000",
"email": "john@example.com"
}
}
}