Initier un paiement softpay
curl --request POST \
--url https://api.saspay.me/api/v1/payments/softpay/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "2500.00",
"currency": "XOF",
"country": "BJ",
"description": "Abonnement mensuel",
"customer": {
"email": "client@example.com",
"first_name": "Awa",
"last_name": "Sossou",
"phone": "+22997505050"
},
"network": "mtn_bj"
}
'import requests
url = "https://api.saspay.me/api/v1/payments/softpay/"
payload = {
"amount": "2500.00",
"currency": "XOF",
"country": "BJ",
"description": "Abonnement mensuel",
"customer": {
"email": "client@example.com",
"first_name": "Awa",
"last_name": "Sossou",
"phone": "+22997505050"
},
"network": "mtn_bj"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '2500.00',
currency: 'XOF',
country: 'BJ',
description: 'Abonnement mensuel',
customer: {
email: 'client@example.com',
first_name: 'Awa',
last_name: 'Sossou',
phone: '+22997505050'
},
network: 'mtn_bj'
})
};
fetch('https://api.saspay.me/api/v1/payments/softpay/', 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://api.saspay.me/api/v1/payments/softpay/",
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' => '2500.00',
'currency' => 'XOF',
'country' => 'BJ',
'description' => 'Abonnement mensuel',
'customer' => [
'email' => 'client@example.com',
'first_name' => 'Awa',
'last_name' => 'Sossou',
'phone' => '+22997505050'
],
'network' => 'mtn_bj'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.saspay.me/api/v1/payments/softpay/"
payload := strings.NewReader("{\n \"amount\": \"2500.00\",\n \"currency\": \"XOF\",\n \"country\": \"BJ\",\n \"description\": \"Abonnement mensuel\",\n \"customer\": {\n \"email\": \"client@example.com\",\n \"first_name\": \"Awa\",\n \"last_name\": \"Sossou\",\n \"phone\": \"+22997505050\"\n },\n \"network\": \"mtn_bj\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.saspay.me/api/v1/payments/softpay/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"2500.00\",\n \"currency\": \"XOF\",\n \"country\": \"BJ\",\n \"description\": \"Abonnement mensuel\",\n \"customer\": {\n \"email\": \"client@example.com\",\n \"first_name\": \"Awa\",\n \"last_name\": \"Sossou\",\n \"phone\": \"+22997505050\"\n },\n \"network\": \"mtn_bj\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saspay.me/api/v1/payments/softpay/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"2500.00\",\n \"currency\": \"XOF\",\n \"country\": \"BJ\",\n \"description\": \"Abonnement mensuel\",\n \"customer\": {\n \"email\": \"client@example.com\",\n \"first_name\": \"Awa\",\n \"last_name\": \"Sossou\",\n \"phone\": \"+22997505050\"\n },\n \"network\": \"mtn_bj\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Payment pushed successfully",
"id": "9c3f2a10-4b7e-4f1a-9d2e-9b6a7c1e4a02",
"status": "PENDING",
"checkout_url": ""
}{
"message": "Cette clé API n'est pas autorisée pour les opérations payin (scope actuel : Payout).",
"code": "api_key_scope_forbidden"
}{
"message": "Réseau inconnu ou inactif : 'mtn_xx'.",
"code": "invalid_method"
}Paiements
Initier un paiement softpay
Push direct d’une demande de paiement sur le téléphone du client
POST
/
payments
/
softpay
/
Initier un paiement softpay
curl --request POST \
--url https://api.saspay.me/api/v1/payments/softpay/ \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"amount": "2500.00",
"currency": "XOF",
"country": "BJ",
"description": "Abonnement mensuel",
"customer": {
"email": "client@example.com",
"first_name": "Awa",
"last_name": "Sossou",
"phone": "+22997505050"
},
"network": "mtn_bj"
}
'import requests
url = "https://api.saspay.me/api/v1/payments/softpay/"
payload = {
"amount": "2500.00",
"currency": "XOF",
"country": "BJ",
"description": "Abonnement mensuel",
"customer": {
"email": "client@example.com",
"first_name": "Awa",
"last_name": "Sossou",
"phone": "+22997505050"
},
"network": "mtn_bj"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
amount: '2500.00',
currency: 'XOF',
country: 'BJ',
description: 'Abonnement mensuel',
customer: {
email: 'client@example.com',
first_name: 'Awa',
last_name: 'Sossou',
phone: '+22997505050'
},
network: 'mtn_bj'
})
};
fetch('https://api.saspay.me/api/v1/payments/softpay/', 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://api.saspay.me/api/v1/payments/softpay/",
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' => '2500.00',
'currency' => 'XOF',
'country' => 'BJ',
'description' => 'Abonnement mensuel',
'customer' => [
'email' => 'client@example.com',
'first_name' => 'Awa',
'last_name' => 'Sossou',
'phone' => '+22997505050'
],
'network' => 'mtn_bj'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.saspay.me/api/v1/payments/softpay/"
payload := strings.NewReader("{\n \"amount\": \"2500.00\",\n \"currency\": \"XOF\",\n \"country\": \"BJ\",\n \"description\": \"Abonnement mensuel\",\n \"customer\": {\n \"email\": \"client@example.com\",\n \"first_name\": \"Awa\",\n \"last_name\": \"Sossou\",\n \"phone\": \"+22997505050\"\n },\n \"network\": \"mtn_bj\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
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))
}HttpResponse<String> response = Unirest.post("https://api.saspay.me/api/v1/payments/softpay/")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": \"2500.00\",\n \"currency\": \"XOF\",\n \"country\": \"BJ\",\n \"description\": \"Abonnement mensuel\",\n \"customer\": {\n \"email\": \"client@example.com\",\n \"first_name\": \"Awa\",\n \"last_name\": \"Sossou\",\n \"phone\": \"+22997505050\"\n },\n \"network\": \"mtn_bj\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.saspay.me/api/v1/payments/softpay/")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": \"2500.00\",\n \"currency\": \"XOF\",\n \"country\": \"BJ\",\n \"description\": \"Abonnement mensuel\",\n \"customer\": {\n \"email\": \"client@example.com\",\n \"first_name\": \"Awa\",\n \"last_name\": \"Sossou\",\n \"phone\": \"+22997505050\"\n },\n \"network\": \"mtn_bj\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Payment pushed successfully",
"id": "9c3f2a10-4b7e-4f1a-9d2e-9b6a7c1e4a02",
"status": "PENDING",
"checkout_url": ""
}{
"message": "Cette clé API n'est pas autorisée pour les opérations payin (scope actuel : Payout).",
"code": "api_key_scope_forbidden"
}{
"message": "Réseau inconnu ou inactif : 'mtn_xx'.",
"code": "invalid_method"
}checkout_url est vide ("") dans l’immense majorité des cas — softpay pousse directement la demande de paiement, sans redirection. Une valeur non vide n’apparaît que si le réseau/gateway choisi retombe exceptionnellement sur un flux de redirection.Authorizations
Clé API secrète du marchand — header Authorization: Bearer sk_live_xxx (ou sk_test_xxx en environnement de test).
Body
application/json
Example:
"2500.00"
Required string length:
3Example:
"XOF"
Required string length:
2Example:
"BJ"
Show child attributes
Show child attributes
Code réseau, cf. référentiel pays/réseaux
Example:
"mtn_bj"
UUID du marchand visé. Ignoré pour une clé API (toujours vous-même) ; pour un token dashboard gérant plusieurs marchands, résout la boutique visée si le header X-Merchant-Id n'est pas fourni.
Example:
"Abonnement mensuel"
ADD_ON : les frais s'ajoutent au montant débité au client. DEDUCTED : les frais sont déduits du montant net reversé au marchand. Défaut : configuration du marchand.
Available options:
ADD_ON, DEDUCTED Code gateway à privilégier si plusieurs sont éligibles pour ce réseau
Response
Paiement poussé avec succès
⌘I