SalamPay API Documentation

Accept payments via Wave, Orange Money, Free Money and more with a single API integration.

Base URL
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.

Request 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.

POST

Create Checkout Session

Create a checkout session to redirect your customer to the SalamPay payment page.

POST /v1/checkout/sessions
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

200 OK
{
  "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
200Success
400Bad Request - Invalid parameters
401Unauthorized - Invalid API key
403Forbidden - Access denied
404Not Found - Resource doesn't exist
429Too Many Requests - Rate limit exceeded
500Server Error - Something went wrong

SDKs & Libraries

Use our official SDKs for faster integration.

PHP

salampay-php

PHP SDK

composer require salampay/salampay-php
JS

salampay-js

JavaScript/Node.js SDK

npm install @salampay/salampay-js
Py

salampay-python

Python SDK

pip install salampay
Dart

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