Make a Payout
curl --request POST \
--url https://sandbox.fapshi.com/payout \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'apiuser: <api-key>' \
--data '
{
"amount": 250050,
"phone": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"userId": "<string>",
"externalId": "<string>",
"message": "<string>"
}
'const options = {
method: 'POST',
headers: {apiuser: '<api-key>', apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 250050,
phone: '<string>',
name: '<string>',
email: 'jsmith@example.com',
userId: '<string>',
externalId: '<string>',
message: '<string>'
})
};
fetch('https://sandbox.fapshi.com/payout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.fapshi.com/payout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 250050,
'phone' => '<string>',
'name' => '<string>',
'email' => 'jsmith@example.com',
'userId' => '<string>',
'externalId' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"apiuser: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://sandbox.fapshi.com/payout"
payload = {
"amount": 250050,
"phone": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"userId": "<string>",
"externalId": "<string>",
"message": "<string>"
}
headers = {
"apiuser": "<api-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://sandbox.fapshi.com/payout")
.header("apiuser", "<api-key>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 250050,\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"userId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.fapshi.com/payout"
payload := strings.NewReader("{\n \"amount\": 250050,\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"userId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiuser", "<api-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "<string>",
"transId": "<string>",
"dateInitiated": "2023-12-25"
}{
"message": "<string>"
}Endpoints
Make a Payout
Send money to a user’s mobile money, orange money or fapshi account via a payout-enabled service.
POST
/
payout
Make a Payout
curl --request POST \
--url https://sandbox.fapshi.com/payout \
--header 'Content-Type: application/json' \
--header 'apikey: <api-key>' \
--header 'apiuser: <api-key>' \
--data '
{
"amount": 250050,
"phone": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"userId": "<string>",
"externalId": "<string>",
"message": "<string>"
}
'const options = {
method: 'POST',
headers: {apiuser: '<api-key>', apikey: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: 250050,
phone: '<string>',
name: '<string>',
email: 'jsmith@example.com',
userId: '<string>',
externalId: '<string>',
message: '<string>'
})
};
fetch('https://sandbox.fapshi.com/payout', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://sandbox.fapshi.com/payout",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'amount' => 250050,
'phone' => '<string>',
'name' => '<string>',
'email' => 'jsmith@example.com',
'userId' => '<string>',
'externalId' => '<string>',
'message' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"apikey: <api-key>",
"apiuser: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}import requests
url = "https://sandbox.fapshi.com/payout"
payload = {
"amount": 250050,
"phone": "<string>",
"name": "<string>",
"email": "jsmith@example.com",
"userId": "<string>",
"externalId": "<string>",
"message": "<string>"
}
headers = {
"apiuser": "<api-key>",
"apikey": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)HttpResponse<String> response = Unirest.post("https://sandbox.fapshi.com/payout")
.header("apiuser", "<api-key>")
.header("apikey", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 250050,\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"userId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"message\": \"<string>\"\n}")
.asString();package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://sandbox.fapshi.com/payout"
payload := strings.NewReader("{\n \"amount\": 250050,\n \"phone\": \"<string>\",\n \"name\": \"<string>\",\n \"email\": \"jsmith@example.com\",\n \"userId\": \"<string>\",\n \"externalId\": \"<string>\",\n \"message\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("apiuser", "<api-key>")
req.Header.Add("apikey", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"message": "<string>",
"transId": "<string>",
"dateInitiated": "2023-12-25"
}{
"message": "<string>"
}Endpoint
POST /payout
Send money to a user’s mobile money, orange money or fapshi account via a payout-enabled service.
After enabling payouts for a service, that service can no longer collect payments. Use separate services for collections and payouts.
Payout is disabled by default in the live environment. To activate payouts in live environment, first implement and test payouts in sandbox environment, then send an email to Developer Support at support@fapshi.com with your Live API User ONLY and mention that you want to enable payouts on your service.MAKE SURE YOU SEND THE LIVE API USER of your PAYOUT SERVICE.
Refunds: Fapshi has no dedicated refund API. To refund a customer, send the amount back to them with this endpoint from your payout service.
No idempotency. Fapshi does not enforce uniqueness of
externalId; sending the same payout request twice sends the money twice. If a request times out, check whether the payout exists with GET /transaction/{userId} before retrying. See Transaction Handling.Funding Your Payout Service
Each service in your Fapshi account has its own balance. Payments you collect through the API go into your collections service balance, and payouts made with this endpoint are paid from your payout service balance. Before you can make payouts, your payout service needs enough money to cover them. You can fund it in two ways:| Method | How | Speed | Fee |
|---|---|---|---|
| 1. Transfer from your collections service | On the web dashboard (Balances section of your collections service) or the mobile app (Balances/Services tab), transfer the amount you need to your payout service. | Instant | Free (transfers between your own services) |
| 2. Top up your payout service | Add money to your payout service directly with MTN MoMo, MTN MoMo Float, or bank deposit. See Topping Up Your Balance. | Approved manually by Fapshi; can take up to one business day | 2.2% of the amount |
Things to know
- Not automatic: money collected through the API stays in your collections service until you move it.
- Not available through the API: the API can make payouts from your payout service balance, but it cannot move money between services or top up a balance. Use the dashboard or the mobile app for that.
- Check your balance first: call
GET /balancewith your payout service credentials to confirm it can cover the payout. - Payout limits: through the API, there is no limit on the total amount you can pay out. Each individual payout must be between 100 XAF and 500,000 XAF.
Parameters
| Name | Required | Type | Description |
|---|---|---|---|
| amount | Yes | integer | Amount to send (minimum 100 XAF, maximum 500,000 XAF per payout). |
| phone | Conditional | string | Recipient phone number (e.g., 67XXXXXXX). Required when medium is not specified or not "fapshi". |
| medium | No | string | "mobile money", "orange money", or "fapshi". Auto-detected if omitted (requires phone). When set to "fapshi", email is required instead of phone. |
| name | No | string | Recipient’s name. |
| Conditional | string | Recipient’s email. Required when medium is "fapshi". Optional for payout confirmation receipt when medium is not "fapshi". | |
| userId | No | string | Your system’s user ID for payout tracking (1-100 chars; allowed: a-z, A-Z, 0-9, -, _). |
| externalId | No | string | Transaction/order ID for reconciliation (1-100 chars; allowed: a-z, A-Z, 0-9, -, _). |
| message | No | string | Description or reason for payout. |
Required Fields
- When
mediumis not specified:amountandphoneare required. - When
mediumis"fapshi":amountandemailare required.
Sandbox Testing
When testing payouts withmedium set to "fapshi" in the sandbox environment:
- Emails that always return successful transactions:
test.success@fapshi.comandmessi.champion@fapshi.com - Emails that always return failed transactions:
test.failed@fapshi.comandpenaldo.test@fapshi.com - Other emails: Transaction status will be determined in a stochastic (random) manner
Body
application/json