Créer un lien de paiement
curl --request POST \
--url https://api.example.com/v1/payment-linksimport requests
url = "https://api.example.com/v1/payment-links"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/payment-links', 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.example.com/v1/payment-links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payment-links"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/payment-links")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payment-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyPayment Links
Créer un lien de paiement
Créer un lien de paiement réutilisable
POST
/
v1
/
payment-links
Créer un lien de paiement
curl --request POST \
--url https://api.example.com/v1/payment-linksimport requests
url = "https://api.example.com/v1/payment-links"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/payment-links', 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.example.com/v1/payment-links",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/payment-links"
req, _ := http.NewRequest("POST", url, nil)
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.example.com/v1/payment-links")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/payment-links")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyCréer un lien de paiement
Crée un lien de paiement qui peut être partagé avec vos clients.Endpoint
POST /v1/payment-links
Body
| Paramètre | Type | Requis | Description |
|---|---|---|---|
title | string | ✅ | Titre affiché au client |
price | integer | ✅ | Montant en FCFA |
currency | string | Devise (défaut: XOF) | |
description | string | Description du produit | |
redirect_url | string | URL de retour après paiement |
Exemple
curl -X POST https://api.sahelpay.ml/v1/payment-links \
-H "Authorization: Bearer sk_test_xxx" \
-H "Content-Type: application/json" \
-d '{
"title": "Abonnement Premium",
"price": 10000,
"description": "Accès illimité pendant 1 mois",
"redirect_url": "https://votre-site.com/merci"
}'
Réponse
{
"success": true,
"data": {
"id": "pl_xyz789",
"title": "Abonnement Premium",
"price": 10000,
"currency": "XOF",
"slug": "abonnement-premium-xyz789",
"url": "https://pay.sahelpay.ml/abonnement-premium-xyz789",
"is_active": true,
"created_at": "2025-12-18T16:45:00.000Z"
}
}
Utilisation
Partagez l’URL avec vos clients :https://pay.sahelpay.ml/abonnement-premium-xyz789
⌘I