SalamPay API Documentation
Accept payments via Wave, Orange Money, Free Money and more with a single API integration.
https://api.salamfay.com/v1
Test Mode
Use test API keys to simulate transactions without real money.
Live Mode
Switch to live keys when you're ready to accept real payments.
Authentication
Authenticate your API requests using Bearer tokens. Include your API key in the Authorization header.
Authorization: Bearer spk_live_your_api_key_here
Keep your API keys secure
Never expose your secret API keys in client-side code or public repositories.
Create Checkout Session
Create a checkout session to redirect your customer to the SalamPay payment page.
curl https://api.salamfay.com/v1/checkout/sessions \
-H "Authorization: Bearer spk_live_..." \
-H "Content-Type: application/json" \
-d '{
"amount": 25000,
"currency": "XOF",
"provider": "wave",
"customer": {
"phone": "+221771234567",
"name": "Amadou Diallo"
},
"metadata": {
"order_id": "ORD-12345"
},
"success_url": "https://example.com/success",
"cancel_url": "https://example.com/cancel"
}'
Request Body
| Parameter | Type | Description |
|---|---|---|
| amount | integer | Required. Amount in smallest currency unit (FCFA) |
| currency | string | Required. Currency code (XOF) |
| provider | string | Payment provider: wave, orange_money, free_money |
| customer.phone | string | Required. Customer phone number (E.164 format) |
| success_url | string | Required. URL to redirect after successful payment |
| cancel_url | string | Required. URL to redirect if payment is cancelled |
| metadata | object | Custom key-value pairs for your reference |
Response
{
"id": "cs_abc123xyz",
"object": "checkout.session",
"amount": 25000,
"currency": "XOF",
"status": "pending",
"checkout_url": "https://pay.salamfay.com/cs_abc123xyz",
"expires_at": "2024-03-20T12:00:00Z"
}
Webhooks
SalamPay sends webhook events to notify your application when payment status changes.
Event Types
| Event | Description |
|---|---|
| checkout.session.completed | Payment was successful |
| checkout.session.expired | Session expired before payment |
| payout.completed | Payout was sent successfully |
| payout.failed | Payout failed |
Webhook Payload
{
"id": "evt_123abc",
"type": "checkout.session.completed",
"created": 1710921600,
"data": {
"object": {
"id": "cs_abc123xyz",
"amount": 25000,
"status": "completed",
"metadata": {
"order_id": "ORD-12345"
}
}
}
}
Errors
SalamPay uses standard HTTP response codes to indicate success or failure.
| Code | Meaning |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid API key |
| 403 | Forbidden - Access denied |
| 404 | Not Found - Resource doesn't exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Server Error - Something went wrong |
SDKs & Libraries
Use our official SDKs for faster integration.
salampay-php
PHP SDK
composer require salampay/salampay-php
salampay-js
JavaScript/Node.js SDK
npm install @salampay/salampay-js
salampay-python
Python SDK
pip install salampay
salampay-flutter
Flutter/Dart SDK
flutter pub add salampay
Testing
Use test API keys to simulate payments without real money.
Test Phone Numbers
+221700000001 - Always succeeds+221700000002 - Always fails+221700000003 - Insufficient funds+221700000004 - Timeout